WIP: suite lecture + premier essai d'écriture de fonctions dans ui/tree.c : GtkWidget
This commit is contained in:
parent
14b326435b
commit
355a6d4969
|
@ -41,6 +41,7 @@ int main(int argc, char **argv)
|
|||
|
||||
app = gem_graph_client_application_new("org.alec.gemgraph",
|
||||
G_APPLICATION_DEFAULT_FLAGS);
|
||||
Hello();
|
||||
|
||||
res = g_application_run(G_APPLICATION(app), argc, argv);
|
||||
return res;
|
||||
|
|
|
@ -29,3 +29,51 @@
|
|||
#include "../../include/ui.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
COL_NAME = 0,
|
||||
COL_AGE,
|
||||
NUM_COLS
|
||||
} ;
|
||||
|
||||
static GtkTreeModel *
|
||||
create_and_fill_model (void)
|
||||
{
|
||||
GtkListStore *store = gtk_list_store_new (NUM_COLS,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_UINT);
|
||||
|
||||
/* Append a row and fill in some data */
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
COL_NAME, "Heinz El-Mann",
|
||||
COL_AGE, 51,
|
||||
-1);
|
||||
|
||||
/* append another row and fill in some data */
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
COL_NAME, "Jane Doe",
|
||||
COL_AGE, 23,
|
||||
-1);
|
||||
|
||||
/* ... and a third row */
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
COL_NAME, "Joe Bungop",
|
||||
COL_AGE, 91,
|
||||
-1);
|
||||
|
||||
return GTK_TREE_MODEL (store);
|
||||
}
|
||||
|
||||
void Hello(void)
|
||||
{
|
||||
GtkWidget *view; // = gtk_tree_view_new ();
|
||||
printf("Hello, from src/ui/tree.c ! -------------------------\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue