diff options
author | Johan Dahlin <johan@src.gnome.org> | 2005-02-23 18:11:20 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2005-02-23 18:11:20 +0000 |
commit | 38dfe02c72ffdf8a89d92455d08279a6fd1ae64a (patch) | |
tree | 5d2e8d5fb3d5110943b18a86489bd1560d22c4d3 /examples | |
parent | 5f7d0830c3df16de471b47e193a705bdcd3ae7fc (diff) | |
download | pygtk-38dfe02c72ffdf8a89d92455d08279a6fd1ae64a.tar.gz |
Don't use gtk.TRUE/gtk.FALSE anymore.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/neil/TAppli.py | 8 | ||||
-rwxr-xr-x | examples/neil/TAppli2.py | 8 | ||||
-rwxr-xr-x | examples/neil/TAppli3.py | 8 | ||||
-rwxr-xr-x | examples/neil/TAppli4.py | 6 | ||||
-rwxr-xr-x | examples/neil/TAppli5.py | 6 | ||||
-rw-r--r-- | examples/pygtk-demo/demos/appwindow.py | 2 | ||||
-rw-r--r-- | examples/pygtk-demo/demos/buttonbox.py | 16 | ||||
-rw-r--r-- | examples/pygtk-demo/demos/changedisplay.py | 2 | ||||
-rw-r--r-- | examples/pygtk-demo/demos/colorsel.py | 2 | ||||
-rwxr-xr-x | examples/simple/scribble.py | 14 | ||||
-rwxr-xr-x | examples/simple/simple.py | 4 |
11 files changed, 38 insertions, 38 deletions
diff --git a/examples/neil/TAppli.py b/examples/neil/TAppli.py index 5e45947b..13185b29 100755 --- a/examples/neil/TAppli.py +++ b/examples/neil/TAppli.py @@ -62,7 +62,7 @@ class Application: ('/_Edit/_Paste', '<control>V', edit_cb, 3, '') ]) self.w_menubar = itemf.get_widget('<main>') - self.w_vbox.pack_start(self.w_menubar, expand=FALSE) + self.w_vbox.pack_start(self.w_menubar, expand=False) self.w_menubar.show() def init_list(self): @@ -81,7 +81,7 @@ class Application: c.show() def init_button(self): - t = GtkTable(rows=1, cols=2, homogeneous=TRUE) + t = GtkTable(rows=1, cols=2, homogeneous=True) b1 = GtkButton('Do it!') b1.connect('clicked', self.doit) b2 = GtkButton('Quit') @@ -89,7 +89,7 @@ class Application: t.attach(b1, 0, 1, 0, 1, yoptions=0, xpadding=2, ypadding=2) t.attach(b2, 1, 2, 0, 1, yoptions=0, xpadding=2, ypadding=2) - self.w_vbox.pack_end(t, expand=FALSE) + self.w_vbox.pack_end(t, expand=False) b1.show() b2.show() @@ -117,7 +117,7 @@ class Application: print "Idle:", self.idlecount # if measuring time ##self.quit() - return TRUE + return True if(__name__=="__main__"): diff --git a/examples/neil/TAppli2.py b/examples/neil/TAppli2.py index 2d3a9162..471f48a0 100755 --- a/examples/neil/TAppli2.py +++ b/examples/neil/TAppli2.py @@ -46,7 +46,7 @@ class Application: ('/_Edit/_Paste', '<control>V', edit_cb, 3, '') ]) self.w_menubar = itemf.get_widget('<main>') - self.w_vbox.pack_start(self.w_menubar, expand=FALSE) + self.w_vbox.pack_start(self.w_menubar, expand=False) self.w_menubar.show() def init_text(self): @@ -82,14 +82,14 @@ class Application: #self.w_text.queueDraw() elif action == 2: print "File:Open" - fname = GtkExtra.file_open_box(modal=FALSE) + fname = GtkExtra.file_open_box(modal=False) if fname: try: f=open(fname, "r") except IOError: return self.w_text.freeze() - while TRUE: + while True: line = f.readline() if line == "": break @@ -99,7 +99,7 @@ class Application: print "File:Save" elif action == 4: print "File:Save As" - print GtkExtra.file_save_box(modal=FALSE), "chosen" + print GtkExtra.file_save_box(modal=False), "chosen" elif action == 5: print "File:Close" elif action == 6: diff --git a/examples/neil/TAppli3.py b/examples/neil/TAppli3.py index a49d5449..7b96af53 100755 --- a/examples/neil/TAppli3.py +++ b/examples/neil/TAppli3.py @@ -44,7 +44,7 @@ class Application: ('/_Edit/_Paste', '<control>V', edit_cb, 3, '') ]) self.w_menubar = itemf.get_widget('<main>') - self.w_vbox.pack_start(self.w_menubar, expand=FALSE) + self.w_vbox.pack_start(self.w_menubar, expand=False) self.w_menubar.show() def init_text(self): @@ -79,14 +79,14 @@ class Application: #self.w_text.queueDraw() elif action == 2: print "File:Open" - fname = GtkExtra.file_open_box(modal=FALSE) + fname = GtkExtra.file_open_box(modal=False) if fname: try: f=open(fname, "r") except IOError: return self.w_text.freeze() - while TRUE: + while True: line = f.readline() if line == "": break @@ -99,7 +99,7 @@ class Application: pixmap='bomb.xpm') elif action == 4: print "File:Save As" - print GtkExtra.file_save_box(modal=FALSE), "chosen" + print GtkExtra.file_save_box(modal=False), "chosen" elif action == 5: print "File:Close" elif action == 6: diff --git a/examples/neil/TAppli4.py b/examples/neil/TAppli4.py index ec6b5461..fe290a2f 100755 --- a/examples/neil/TAppli4.py +++ b/examples/neil/TAppli4.py @@ -47,7 +47,7 @@ class Application: ('/_Help/_About', '<control>A', help_cb, 1, '') ]) self.w_menubar = itemf.get_widget('<main>') - self.w_vbox.pack_start(self.w_menubar, expand=FALSE) + self.w_vbox.pack_start(self.w_menubar, expand=False) self.w_menubar.show() def init_canvas(self): @@ -70,7 +70,7 @@ class Application: print "File:New" elif action == 2: print "File:Open" - print GtkExtra.file_open_box(modal=FALSE), "chosen" + print GtkExtra.file_open_box(modal=False), "chosen" elif action == 3: print "FileSave" dlg=GtkExtra.message_box("Test Application", @@ -78,7 +78,7 @@ class Application: ("OK",), pixmap='bomb.xpm') elif action == 4: print "File:Save As" - print GtkExtra.file_save_box(modal=FALSE), "chosen" + print GtkExtra.file_save_box(modal=False), "chosen" elif action == 5: print "File:Close" elif action == 6: diff --git a/examples/neil/TAppli5.py b/examples/neil/TAppli5.py index f8b33dc5..8e531ff6 100755 --- a/examples/neil/TAppli5.py +++ b/examples/neil/TAppli5.py @@ -69,7 +69,7 @@ class Application: ('/_Help/_About', '<control>A', help_cb, 1, '') ]) self.w_menubar = itemf.get_widget('<main>') - self.w_vbox.pack_start(self.w_menubar, expand=FALSE) + self.w_vbox.pack_start(self.w_menubar, expand=False) self.w_menubar.show() def init_text(self): @@ -109,7 +109,7 @@ class Application: #self.w_text.queueDraw() elif action == 2: print "File:Open" - print GtkExtra.file_open_box(modal=FALSE), "chosen" + print GtkExtra.file_open_box(modal=False), "chosen" elif action == 3: print "File:Save" GtkExtra.message_box("Test Application", @@ -117,7 +117,7 @@ class Application: ("OK",), pixmap='bomb.xpm') elif action == 4: print "File:Save As" - print GtkExtra.message_box(modal=FALSE), "chosen" + print GtkExtra.message_box(modal=False), "chosen" elif action == 5: print "File:Close" GtkExtra.message_box("Test Application", diff --git a/examples/pygtk-demo/demos/appwindow.py b/examples/pygtk-demo/demos/appwindow.py index f1365dd6..b29b63ec 100644 --- a/examples/pygtk-demo/demos/appwindow.py +++ b/examples/pygtk-demo/demos/appwindow.py @@ -114,7 +114,7 @@ class ApplicationMainWindowDemo(gtk.Window): bar = merge.get_widget("/MenuBar") bar.show() - table = gtk.Table(1, 4, gtk.FALSE) + table = gtk.Table(1, 4, False) self.add(table) table.attach(bar, diff --git a/examples/pygtk-demo/demos/buttonbox.py b/examples/pygtk-demo/demos/buttonbox.py index cf201dfa..91b434b2 100644 --- a/examples/pygtk-demo/demos/buttonbox.py +++ b/examples/pygtk-demo/demos/buttonbox.py @@ -53,13 +53,13 @@ class ButtonBoxDemo(gtk.Window): vbox.set_border_width(10) frame_horiz.add(vbox) - vbox.pack_start(create_bbox(gtk.TRUE, "Spread", 40, gtk.BUTTONBOX_SPREAD), + vbox.pack_start(create_bbox(True, "Spread", 40, gtk.BUTTONBOX_SPREAD), padding=0) - vbox.pack_start(create_bbox(gtk.TRUE, "Edge", 40, gtk.BUTTONBOX_EDGE), + vbox.pack_start(create_bbox(True, "Edge", 40, gtk.BUTTONBOX_EDGE), padding=5) - vbox.pack_start(create_bbox(gtk.TRUE, "Start", 40, gtk.BUTTONBOX_START), + vbox.pack_start(create_bbox(True, "Start", 40, gtk.BUTTONBOX_START), padding=5) - vbox.pack_start(create_bbox(gtk.TRUE, "End", 40, gtk.BUTTONBOX_END), + vbox.pack_start(create_bbox(True, "End", 40, gtk.BUTTONBOX_END), padding=5) frame_vert = gtk.Frame("Vertical Button Boxes") @@ -69,13 +69,13 @@ class ButtonBoxDemo(gtk.Window): hbox.set_border_width(10) frame_vert.add(hbox) - hbox.pack_start(create_bbox(gtk.FALSE, "Spread", 40, gtk.BUTTONBOX_SPREAD), + hbox.pack_start(create_bbox(False, "Spread", 40, gtk.BUTTONBOX_SPREAD), padding=0) - hbox.pack_start(create_bbox(gtk.FALSE, "Edge", 40, gtk.BUTTONBOX_EDGE), + hbox.pack_start(create_bbox(False, "Edge", 40, gtk.BUTTONBOX_EDGE), padding=5) - hbox.pack_start(create_bbox(gtk.FALSE, "Start", 40, gtk.BUTTONBOX_START), + hbox.pack_start(create_bbox(False, "Start", 40, gtk.BUTTONBOX_START), padding=5) - hbox.pack_start(create_bbox(gtk.FALSE, "End", 40, gtk.BUTTONBOX_END), + hbox.pack_start(create_bbox(False, "End", 40, gtk.BUTTONBOX_END), padding=5) self.show_all() diff --git a/examples/pygtk-demo/demos/changedisplay.py b/examples/pygtk-demo/demos/changedisplay.py index 592a7e0f..c3ce8bd5 100644 --- a/examples/pygtk-demo/demos/changedisplay.py +++ b/examples/pygtk-demo/demos/changedisplay.py @@ -87,7 +87,7 @@ class QueryForToplevel(gtk.Window): self.connect("button-release-event", self.button_release_event_cb) # Process events until clicked is set by button_release_event_cb. - # We pass in may_block=TRUE since we want to wait if there + # We pass in may_block=True since we want to wait if there # are no events currently. # while self.query_clicked is False: diff --git a/examples/pygtk-demo/demos/colorsel.py b/examples/pygtk-demo/demos/colorsel.py index d3f6c904..252d09c4 100644 --- a/examples/pygtk-demo/demos/colorsel.py +++ b/examples/pygtk-demo/demos/colorsel.py @@ -54,7 +54,7 @@ class ColorSelectorDemo(gtk.Window): colorsel.set_previous_color(self.color) colorsel.set_current_color(self.color) - colorsel.set_has_palette(gtk.TRUE) + colorsel.set_has_palette(True) response = dialog.run() diff --git a/examples/simple/scribble.py b/examples/simple/scribble.py index be20f887..035b7d0f 100755 --- a/examples/simple/scribble.py +++ b/examples/simple/scribble.py @@ -13,26 +13,26 @@ def configure_event(widget, event): win = widget.window width, height = win.get_size() pixmap = gtk.gdk.Pixmap(win, width, height) - pixmap.draw_rectangle(widget.get_style().white_gc, gtk.TRUE, + pixmap.draw_rectangle(widget.get_style().white_gc, True, 0, 0, width, height) - return gtk.TRUE + return True def expose_event(widget, event): x, y, width, height = event.area gc = widget.get_style().fg_gc[gtk.STATE_NORMAL] widget.window.draw_drawable(gc, pixmap, x, y, x, y, width, height) - return gtk.FALSE + return False def draw_brush(widget, x, y): x, y = int(x), int(y) - pixmap.draw_rectangle(widget.get_style().black_gc, gtk.TRUE, + pixmap.draw_rectangle(widget.get_style().black_gc, True, x-5, y-5, 10, 10) widget.queue_draw() def button_press_event(widget, event): if event.button == 1 and pixmap != None: draw_brush(widget, event.x, event.y) - return gtk.TRUE + return True def motion_notify_event(widget, event): if event.is_hint: @@ -42,7 +42,7 @@ def motion_notify_event(widget, event): state = event.state if state & gtk.gdk.BUTTON1_MASK and pixmap != None: draw_brush(widget, x, y) - return gtk.TRUE + return True def main(): win = gtk.Window() @@ -70,7 +70,7 @@ def main(): gtk.gdk.POINTER_MOTION_HINT_MASK) button = gtk.Button(stock=gtk.STOCK_QUIT) - vbox.pack_start(button, expand=gtk.FALSE, fill=gtk.FALSE) + vbox.pack_start(button, expand=False, fill=False) button.connect("clicked", lambda widget, win=win: win.destroy()) button.show() win.show() diff --git a/examples/simple/simple.py b/examples/simple/simple.py index 43d808a9..f350ab8d 100755 --- a/examples/simple/simple.py +++ b/examples/simple/simple.py @@ -17,8 +17,8 @@ def destroy(*args): window = gobject.new(gtk.Window, type=gtk.WINDOW_TOPLEVEL, title='Hello World', - allow_grow=gtk.FALSE, - allow_shrink=gtk.FALSE, + allow_grow=False, + allow_shrink=False, border_width=10) window.connect("destroy", destroy) |