Re: gtk_tree_view/store, best way to select all nodes of a branch

2012-09-12 Thread Arne Pagel
My current simple solution is as follows: I use the gtk_tree_model_foreach() function and pass some user data with the current major number of the tree-path. Inside the foreach-function I use gtk_tree_path_to_string, where I check if the first number is identical to the user data. This works,

Re: gtk_tree_view/store, best way to select all nodes of a branch

2012-09-12 Thread David Nečas
On Wed, Sep 12, 2012 at 10:40:11AM +0200, Arne Pagel wrote: My current simple solution is as follows: I use the gtk_tree_model_foreach() function and pass some user data with the current major number of the tree-path. Inside the foreach-function I use gtk_tree_path_to_string, where I check if

populate gtk tree view from outside

2012-09-12 Thread Rudra Banerjee
Dear friends, I have defined a treeview model as follows: enum { COL_FIRST_NAME = 0, COL_LAST_NAME, COL_YEAR_BORN, NUM_COLS } ; static GtkTreeModel * create_and_fill_model (void) { GtkTreeStore *treestore; GtkTreeItertoplevel, child; treestore = gtk_tree_store_new(NUM_COLS,

Re: populate gtk tree view from outside

2012-09-12 Thread Olivier Sessink
On 09/12/2012 12:21 PM, Rudra Banerjee wrote: [..] strAuth = gtk_entry_get_text(GTK_ENTRY(e-entryAuth)); strEditor = gtk_entry_get_text(GTK_ENTRY(e-entryEditor)); Is it possible to add these strAuth, strEditor in those treeview's 1st and 2nd column? just acquire an iterator at the

Re: populate gtk tree view from outside

2012-09-12 Thread Olivier Sessink
On 09/12/2012 06:30 PM, Rudra Banerjee wrote: Oliver, Thanks for your reply. The problem basically is to pass on the function argument from one to other. you need to create a header file (main.h) that has the enum, and extern GtkListStore *treestore; in main.c define GtkListStore *treestore;

Re: populate gtk tree view from outside

2012-09-12 Thread Rudra Banerjee
Oliver, Thanks a lot. Its working properly. Only change that I have made is using gtk_tree_store_append in place of gtk_tree_model_get_iter_first. Thanks a lot again. Regards, On Wed, 2012-09-12 at 21:31 +0200, Olivier Sessink wrote: On 09/12/2012 06:30 PM, Rudra Banerjee wrote: Oliver,

Gtk.DrawingArea: Port to python3/gtk3

2012-09-12 Thread Patrick Shirkey
Hi, How should I convert this gtk3? self.area = Gtk.DrawingArea() #Paints the piano roll (Where the notes are) def paint_widget(self): if self.area.window == None: return colormap = self.area.get_colormap()