Re: [pygtk] Implementation of interfaces in PyGtk
On Thu, 2003-03-27 at 01:53, Oliver M. Haynold wrote: Hello: I have a problem understanding PyGtk and couldn't find anything in the documentation (presumably because I searched in all the wrong places). I don't understand how exactly one can tell PyGtk that a new class implements some GInterface. Specifically I have a tree model which works very fine and it subclassed like this: class TopicsTreeModel(gtk.GenericTreeModel): # implementation goes here Now I would like to add drag and drop functionality, which (for the role as a DD source) requires my new class to implement gtk.TreeDragSource. Perhaps the most pythonic way of doing this would be to inherit from gtk.TreeDragSource like this: class TopicsTreeModel(gtk.GenericTreeModel, gtk.TreeDragSource): # implementation goes here However, that raises an error: File stdin, line 15, in ? TypeError: multiple bases have instance lay-out conflict Is there something I don't understand about the PyGtk implementation of GInterfaces? Any help or reference to the appropriate part of the documentation would be greatly appreciated. Yours, Oliver I can't answer your question but I'm very interested in this topic, too. I'd like to subclass gtk.Combo and implement gtk.CellRenderer to use it within a tree view. So if anyone knows how to handle Glib interfaces I'd very appreciate it. Thomas ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] putting a treeview column in 'edit mode'
On Fri, 2003-03-07 at 14:40, florian wrote: hi! im wondering if its possible to put a treeview column automatically/or manually via the code in 'edit mode'. basically have a shortcut which creates a new row in the treeview. i would like that the user can then right away type the text in a column of that just created row. thanks in advance! ciao! florian tree_view.set_cursor( path, col, gtk.TRUE ) tree_view.grab_focus() should do it. Thomas ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] treeview listsource
On Tue, 2003-02-11 at 02:38, Anthony Tekatch wrote: How can I get changes to ListStore to show up in the GtkTreeView? I have used glade-2 to create my window. The following code snippet does not update the GtkTreeView that I named cat_clist. cat_clist = widgets.get_widget('cat_clist') model = gtk.ListStore(gobject.TYPE_STRING) cat_clist.set_model(model) iter = model.append() model.set(iter,0,text) Thanks in advance! You have to append at least one column. Something like this: renderer = gtk.CellRendererText() col = gtk.TreeViewColumn( 'Title', renderer ) col.set_property( 'resizable', 1 ) col.add_attribute( renderer, 'text', 0 ) cat_list.append_column( col ) -- Thomas Speck [EMAIL PROTECTED] ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] (no subject)
Hi, I'd like to use a combo box to edit some entries in a tree view. Seems I have to implement the CellEditable interface by subclassing gtk.Combo and adding the interface gtk.CellEditable. Unfortunately there is nothing like gobject.type_register to do this. Any ideas? Thanks -- Thomas Speck [EMAIL PROTECTED] ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/