GTK4_GG_hack/hot.c

54 lines
2.0 KiB
C

#include <stdio.h>
#include <gtk-4.0/gtk/gtk.h>
#include "warm.h"
#include "cold.h"
#include "widgets.h"
#include "pages.h"
#include "texts.h"
// https://forge.a-lec.org/gem-graph/gem-graph-client/src/branch/devel/Makefile
// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery
// https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management
// GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL
//------------------------------------------------------------------------------
// TODO cliquer sur "RUN" --> affiche "STOP" (et inversement)
static GtkWidget *get_RUN_STOP_label(){
GtkWidget *RS_label = gtk_label_new (" R U N\n S T O P");
gtk_widget_set_size_request (GTK_WIDGET (RS_label), 20, 30);
return RS_label;
}
static GtkWidget *get_scroll_speed(){
GtkAdjustment *speed_adjust = gtk_adjustment_new (0, 0, 100, 1, 0, 0);
GtkWidget *scroll_speed = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, speed_adjust);
gtk_widget_set_size_request (GTK_WIDGET (scroll_speed), 2, 140);
return scroll_speed;
}
static GtkBox *get_speed_scrolling_box(){
GtkBox *speed_scrolling_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // spacing = 2
gtk_box_append (speed_scrolling_box, GTK_WIDGET (gtk_label_new (" "))); // AD HOC (pour "centrer")
gtk_box_append (speed_scrolling_box, get_scroll_speed());
return speed_scrolling_box;
}
static GtkWidget *get_STEP_by_STEP_Label(){
GtkWidget *RS_label = gtk_label_new (" Step\n\n(show\nactive\n rule)");
gtk_widget_set_size_request (GTK_WIDGET (RS_label), 20, 30);
return RS_label;
}
GtkBox *get_RUN_STOP_box(){
GtkBox *RUN_STOP_box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 20));
gtk_box_append (RUN_STOP_box, gtk_label_new ("\n"));
gtk_box_append (RUN_STOP_box, get_RUN_STOP_label());
gtk_box_append (RUN_STOP_box, GTK_WIDGET (get_speed_scrolling_box()));
gtk_box_append (RUN_STOP_box, get_STEP_by_STEP_Label());
gtk_box_append (RUN_STOP_box, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)));
return RUN_STOP_box;
}