Hi.
Here' are two small patches for the code in the pygtk-demo/demo
code so the code will execute without warnings about using
deprecated functions. These patches are for the pygtk2
tree.
Thanks. There will be a few more small patches like these
coming, as I'm trying to fix the sample code to run with
pygtk2 and gtk+-2.0.
Index: menu.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/examples/pygtk-demo/demos/menu.py,v
retrieving revision 1.2
diff -u -r1.2 menu.py
--- menu.py 2001/09/14 09:57:29 1.2
+++ menu.py 2002/03/24 01:10:20
@@ -46,7 +46,7 @@
menuitem = gtk.MenuItem('bar')
menuitem.set_submenu(create_menu(2))
- menuitem.right_justify()
+ menuitem.set_right_justified(gtk.TRUE)
menubar.add(menuitem)
vbox2 = gtk.VBox(spacing=10)
Index: toolbar.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/examples/pygtk-demo/demos/toolbar.py,v
retrieving revision 1.4
diff -u -r1.4 toolbar.py
--- toolbar.py 2001/09/14 09:57:29 1.4
+++ toolbar.py 2002/03/24 01:10:20
@@ -48,7 +48,7 @@
win.connect('destroy', lambda win: gtk.main_quit())
win.set_title("Toolbar")
- win.set_policy(gtk.FALSE, gtk.TRUE, gtk.TRUE)
+ win.set_resizable(gtk.TRUE)
win.set_border_width(5)
pix, mask = gtk.gdk.pixmap_colormap_create_from_xpm_d(None,
@@ -57,29 +57,39 @@
toolbar = gtk.Toolbar()
win.add(toolbar)
-
+
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Horizontal", "Horizontal toolbar layout",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_orient_cb, toolbar,
gtk.ORIENTATION_HORIZONTAL)
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Vertical", "Vertical toolbar layout",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_orient_cb, toolbar,
gtk.ORIENTATION_VERTICAL)
toolbar.append_space()
-
+
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Icons", "Only show toolbar icons",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_style_cb, toolbar, gtk.TOOLBAR_ICONS)
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Text", "Only show toolbar texts",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_style_cb, toolbar, gtk.TOOLBAR_TEXT)
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Both", "Show toolbar icons and text",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_style_cb, toolbar, gtk.TOOLBAR_BOTH)
toolbar.append_space()
@@ -89,12 +99,16 @@
toolbar.append_space()
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Enable", "Enable tooltips",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_tooltips_cb, toolbar, gtk.TRUE)
+ image = gtk.Image()
+ image.set_from_pixmap(pix,mask)
button = toolbar.append_item("Disable", "Disable tooltips",
- None, gtk.Pixmap(pix, mask), None, None)
+ None, image, None, None)
button.connect("clicked", set_tooltips_cb, toolbar, gtk.FALSE)
win.show_all()
--
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/