gtk_single_selection_new < it works fine ! (see line 60 in the sand_box)
This commit is contained in:
parent
f44c7d1f1e
commit
aff067662d
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
static void on_destroy (GtkWidget *widget, gpointer data) {if (data) g_print (data); exit(0);}
|
static void on_destroy (GtkWidget *widget, gpointer data) {if (data) g_print (data); exit(0);}
|
||||||
|
|
||||||
|
|
||||||
static void setup_cb (GtkSignalListItemFactory *self, GtkListItem *listitem, gpointer user_data) {
|
static void setup_cb (GtkSignalListItemFactory *self, GtkListItem *listitem, gpointer user_data) {
|
||||||
GtkWidget *my_label = gtk_label_new (NULL);
|
GtkWidget *my_label = gtk_label_new (NULL);
|
||||||
gtk_list_item_set_child (listitem, my_label);
|
gtk_list_item_set_child (listitem, my_label);
|
||||||
|
@ -54,11 +53,11 @@ static void and_now_let_s_climb_that_tree (GtkWidget *in_that_box)
|
||||||
|
|
||||||
GtkStringList *my_string_list = gtk_string_list_new ((const char * const *) my_array);
|
GtkStringList *my_string_list = gtk_string_list_new ((const char * const *) my_array);
|
||||||
|
|
||||||
gint selected = 3;
|
gint selected = 7;
|
||||||
if (1) printf("The item n°%d of my array is the string \"%s\"\n",\
|
if (1) printf("The item n°%d of my array is the string \"%s\"\n",\
|
||||||
selected, gtk_string_list_get_string (my_string_list, selected));
|
selected, gtk_string_list_get_string (my_string_list, selected));
|
||||||
|
|
||||||
GtkNoSelection *my_selection = gtk_no_selection_new (G_LIST_MODEL (my_string_list));
|
GtkNoSelection *my_selection = gtk_single_selection_new (G_LIST_MODEL (my_string_list));
|
||||||
|
|
||||||
GtkListItemFactory *my_factory = gtk_signal_list_item_factory_new ();
|
GtkListItemFactory *my_factory = gtk_signal_list_item_factory_new ();
|
||||||
g_signal_connect (my_factory, "setup", G_CALLBACK (setup_cb), NULL);
|
g_signal_connect (my_factory, "setup", G_CALLBACK (setup_cb), NULL);
|
||||||
|
@ -89,4 +88,3 @@ void on_activate_window_creation (GtkApplication *app, gpointer data) {
|
||||||
// guix shell -m manifest.scm && pkg-config --libs gtk4 make clean && clear && time make run
|
// guix shell -m manifest.scm && pkg-config --libs gtk4 make clean && clear && time make run
|
||||||
// my local widgets examples are in user/jean/01/GTK4/tree (learning)/The_Gnome_way/demos/gtk-demo
|
// my local widgets examples are in user/jean/01/GTK4/tree (learning)/The_Gnome_way/demos/gtk-demo
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue