diff options
author | Matt Wilson <msw@redhat.com> | 2001-09-18 14:46:59 +0000 |
---|---|---|
committer | Matt Wilson <msw@src.gnome.org> | 2001-09-18 14:46:59 +0000 |
commit | 67c610179e9c8fc8e04ea78472b006bd7080c652 (patch) | |
tree | 5c61b44b56045969567a28277106443412f6bfe2 /examples | |
parent | 80159e0b65b537adec9a177ffd81d097a78862a1 (diff) | |
download | pygtk-67c610179e9c8fc8e04ea78472b006bd7080c652.tar.gz |
fixed to work with new namespace
2001-09-18 Matt Wilson <msw@redhat.com>
* examples/pygtk-demo/demos/treemodel.py: fixed to work with new
namespace
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pygtk-demo/demos/treemodel.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/pygtk-demo/demos/treemodel.py b/examples/pygtk-demo/demos/treemodel.py index 2d7065ad..4f691218 100644 --- a/examples/pygtk-demo/demos/treemodel.py +++ b/examples/pygtk-demo/demos/treemodel.py @@ -8,8 +8,8 @@ description = 'Tree Model' import gtk # to create a new GtkTreeModel from python, you must derive from -# PyGtkTreeModel. -class MyTreeModel(gtk.PyGtkTreeModel): +# TreeModel. +class MyTreeModel(gtk.TreeModel): '''This class represents the model of a tree. The iterators used to represent positions are converted to python objects when passed to the on_* methods. This means you can use any python object to @@ -25,10 +25,10 @@ class MyTreeModel(gtk.PyGtkTreeModel): TREE_SIBLINGS = 5 def __init__(self): '''constructor for the model. Make sure you call - PyGtkTreeModel.__init__''' - gtk.PyGtkTreeModel.__init__(self) + PyTreeModel.__init__''' + gtk.TreeModel.__init__(self) - # the implementations for GtkTreeModel methods are prefixed with on_ + # the implementations for TreeModel methods are prefixed with on_ def on_get_flags(self): '''returns the GtkTreeModelFlags for this particular type of model''' return 0 @@ -88,20 +88,20 @@ class MyTreeModel(gtk.PyGtkTreeModel): return node[:-1] def main(): - window = gtk.GtkWindow() + window = gtk.Window() if __name__ == '__main__': window.connect('destroy', lambda win: gtk.main_quit()) window.set_title('Menus') - scrolled_window = gtk.GtkScrolledWindow() + scrolled_window = gtk.ScrolledWindow() scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) window.add(scrolled_window) model = MyTreeModel() - tree_view = gtk.GtkTreeView(model) - cell = gtk.GtkCellRendererText() + tree_view = gtk.TreeView(model) + cell = gtk.CellRendererText() # the text in the column comes from column 0 - column = gtk.GtkTreeViewColumn("tuples", cell, text=0) + column = gtk.TreeViewColumn("tuples", cell, text=0) tree_view.append_column(column) scrolled_window.add(tree_view) |