Re: how to get the parent of a selected row in treeview?

2010-04-26 Thread Arthur 1989
thank you.I will try to implement it. On Mon, Apr 26, 2010 at 7:12 PM, Tadej Borovšak wrote: > Hi. > > You can obtain parent iter like this: > 1a. converting GtkTreeIter that you got from > gtk_tree_view_selection_get_selected() into GtkTreePath using > gtk_tree_model_get_path() > 1b. get sele

how to get the parent of a selected row in treeview?

2010-04-26 Thread Arthur 1989
Hi, i create a tree model using following codes: //~~ GtkTreeStore *treestore; GtkTreeIter toplevel, child; treestore = gtk_tree_store_new(1, G_TYPE_STRING); gtk_tree_store_append(treestore, &toplevel, NULL); gtk_tree_store_set(treestore, &toplevel, 0, "Linux"

Re: what do i get if a cell is empty?

2010-04-24 Thread Arthur 1989
Thank you so much. On Sun, Apr 25, 2010 at 1:14 AM, Tadej Borovšak wrote: > Hello. > > You get NULL pointer. To test for it, you should do something like: > > if( s == NULL ) > { >/* Handle empty string */ > } > > Tadej > > -- > Tadej Borovšak > tadeboro.blogspot.com > tadeb...@gmail.com > t

what do i get if a cell is empty?

2010-04-24 Thread Arthur 1989
Hi, I met this question: I use gtk_tree_model_get(model, &iter, i, &s, -1) to get a cell's content. but when the cell is empty,i am not sure what i really get. i print s out with g_print ("s = %s\n", s) , then i get "s = (null)",so i want to test what's in s, i run this, if (s == EXP) print("s ==

Re: different data types between clist and mysql.

2010-04-23 Thread Arthur 1989
ree_sortable_set_sort_func(GTK_TREE_SORTABLE(model), > l->pos, sort_by_ulong,(gpointer) l->pos, NULL); > break; >case G_TYPE_DOUBLE: >l->sortable=TRUE; >gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(model), > l

different data types between clist and mysql.

2010-04-20 Thread Arthur 1989
Hello, I used *clist* to display data iI fetch from mysql server,but when writing data back into the table of database, I got this question: the data type of clist is always *gchar **, while there are quite a lot of other data types in mysql. What can I do to get this question solved? Any tips will

how to remove the contents of vbox?

2010-04-19 Thread Arthur 1989
hello, I got this func: static void (GtkWidget *vbox) {...}, when passed in an vbox, it should insert a GtkWidget *scrolled_window into the vbox, but I want to clear the contents of vbox first,otherwise the old contents will be displayed as well as the newly inserted widget. I am wondering how to i