WIP: des briques qui passent la compilation

This commit is contained in:
Jean Sirmai 2024-01-13 08:47:28 +01:00
parent 37e2808191
commit c25cb17e94
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 31 additions and 0 deletions

View File

@ -56,6 +56,37 @@ static GtkWidget *my_tree_view;
static GListModel *my_list_model = NULL; static GListModel *my_list_model = NULL;
// view = gtk_list_view_new (model, factory); <<<<<<
typedef struct _GtkSignalListItemFactory GtkSignalListItemFactory;
GtkListItemFactory *gtk_signal_list_item_factory_new (void);
// The “setup” signal is emitted when the factory needs to create a new row widget.
// g_signal_connect (factory, "setup", setup_listitem_cb, NULL); <<<<<<
//
// The “bind” signal is emitted when a row widget needs to be connected to an item from the model.
// g_signal_connect (factory, "bind", bind_listitem_cb, NULL); <<<<<<
//
// Both of these signals take a GtkListItem as argument,
// which is a wrapper object that lets you get at the model item (with gtk_list_item_get_item())
// and also lets you deliver the new row widget (with gtk_list_item_set_child()).
//
// If your “bind” handler connects to signals on the item or does other things that require cleanup,
// you can use the “unbind” signal to do that cleanup. The “setup” signal has a similar counterpart called “teardown”.
static void setup_listitem_cb (GtkListItemFactory *factory, GtkListItem *list_item)
{
GtkWidget *label = gtk_label_new ("");
gtk_list_item_set_child (list_item, label);
}
// user_function can be : setup, bind, unbind or teardown
// Parameters : self, The GtkSignalListItemFactory, listitem, The GtkListItem to bind,
// user_data : user data set when the signal handler was connected.
// Flags: Run First
static void user_function (GtkSignalListItemFactory *self, GtkListItem *listitem, gpointer user_data) {}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// guix shell -m manifest.scm make clean && clear && time make run // guix shell -m manifest.scm make clean && clear && time make run