Project

General

Profile

Feature #1108 ยป 0077-gtk4x-Implement-bind-create-for-pages.c-save-list-it.patch

Marko Lindqvist, 11/13/2024 06:55 PM

View differences:

client/gui-gtk-5.0/pages.c
gtk_entry_buffer_set_text(gtk_entry_get_buffer(pdialog->entry), filename, -1);
}
/**********************************************************************//**
Save table cell bind function
**************************************************************************/
static void save_factory_bind(GtkSignalListItemFactory *self,
GtkListItem *list_item,
gpointer user_data)
{
FcSaveRow *row;
GtkWidget *child = gtk_list_item_get_child(list_item);
row = gtk_list_item_get_item(list_item);
gtk_label_set_text(GTK_LABEL(child), row->pretty_name);
}
/**********************************************************************//**
Save table cell setup function
**************************************************************************/
static void save_factory_setup(GtkSignalListItemFactory *self,
GtkListItem *list_item,
gpointer user_data)
{
gtk_list_item_set_child(list_item, gtk_label_new(""));
}
/**********************************************************************//**
Create a new save dialog.
**************************************************************************/
......
GtkBox *vbox;
GtkListStore *store;
GtkCellRenderer *rend;
GtkListItemFactory *factory;
GtkTreeSelection *selection;
struct save_dialog *pdialog;
......
/* Tree view. */
store = save_dialog_store_new();
factory = gtk_signal_list_item_factory_new();
g_signal_connect(factory, "bind", G_CALLBACK(save_factory_bind),
nullptr);
g_signal_connect(factory, "setup", G_CALLBACK(save_factory_setup),
nullptr);
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
gtk_widget_set_hexpand(view, TRUE);
gtk_widget_set_vexpand(view, TRUE);
    (1-1/1)