[pygobject/pygobject-2-28] [gi-demos] run through the demos and remove the FIXMEs that have been fixed



commit 788fc96771046fc64cede392e748b2d1b6b3aa1c
Author: John (J5) Palmieri <johnp redhat com>
Date:   Tue Feb 22 14:35:44 2011 -0500

    [gi-demos] run through the demos and remove the FIXMEs that have been fixed

 demos/gtk-demo/demos/appwindow.py     |   18 ++++++------------
 demos/gtk-demo/demos/assistant.py     |    3 ---
 demos/gtk-demo/demos/builder.py       |    3 ---
 demos/gtk-demo/demos/button_box.py    |   10 +++-------
 demos/gtk-demo/demos/clipboard.py     |    8 ++------
 demos/gtk-demo/demos/colorselector.py |    2 --
 demos/gtk-demo/demos/combobox.py      |    4 +---
 demos/gtk-demo/demos/drawingarea.py   |    3 ---
 8 files changed, 12 insertions(+), 39 deletions(-)
---
diff --git a/demos/gtk-demo/demos/appwindow.py b/demos/gtk-demo/demos/appwindow.py
index fff4a7a..a71720f 100644
--- a/demos/gtk-demo/demos/appwindow.py
+++ b/demos/gtk-demo/demos/appwindow.py
@@ -24,9 +24,6 @@ description = """
 Demonstrates a typical application window with menubar, toolbar, statusbar.
 """
 
-# See FIXME's
-is_fully_bound = False
-
 from gi.repository import Gtk, GdkPixbuf, Gdk
 import sys, os
 import glib
@@ -51,12 +48,11 @@ def activate_action(action, user_data):
         return
 
 
-    dialog = Gtk.MessageDialog(message_type=Gtk.MessageType.INFO,
+    dialog = Gtk.MessageDialog(parent=window,
+                               message_type=Gtk.MessageType.INFO,
                                buttons=Gtk.ButtonsType.CLOSE,
                                text='You activated action: "%s" of type %s' % (name, _type))
 
-    # FIXME: this should be done in the constructor
-    dialog.set_transient_for(window)
     dialog.connect('response', widget_destroy)
     dialog.show()
 
@@ -123,9 +119,9 @@ Boston, MA 02111-1307, USA.
         pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
 
     transparent = pixbuf.add_alpha(True, 0xff, 0xff, 0xff)
-    # FIXME: override Gtk.show_about_dialog
-    #        make about dailog constructor take a parent argument
-    about = Gtk.AboutDialog(program_name='GTK+ Code Demos',
+    about = Gtk.AboutDialog(
+                parent=window, 
+                program_name='GTK+ Code Demos',
 			    version='0.1',
 			    copyright='(C) 2010 The PyGI Team',
 			    license=license,
@@ -136,10 +132,8 @@ Boston, MA 02111-1307, USA.
 			    logo=transparent,
 			    title='About GTK+ Code Demos')
 
-    about.set_transient_for(window)
     about.connect('response', widget_destroy)
-    about.show()
-
+    about.run()
 
 action_entries = (
     ("FileMenu", None, "_File"),                # name, stock id, label
diff --git a/demos/gtk-demo/demos/assistant.py b/demos/gtk-demo/demos/assistant.py
index e1a7ecd..8285d04 100644
--- a/demos/gtk-demo/demos/assistant.py
+++ b/demos/gtk-demo/demos/assistant.py
@@ -26,9 +26,6 @@ an operation into several simpler sequential steps, and to guide the user
 through these steps.
 """
 
-# See FIXME's
-is_fully_bound = True
-
 from gi.repository import Gtk, GdkPixbuf
 
 class AssistantApp:
diff --git a/demos/gtk-demo/demos/builder.py b/demos/gtk-demo/demos/builder.py
index 5ecf748..15af254 100644
--- a/demos/gtk-demo/demos/builder.py
+++ b/demos/gtk-demo/demos/builder.py
@@ -24,9 +24,6 @@ description = """
 Demonstrates an interface loaded from a XML description.
 """
 
-# See FIXME's
-is_fully_bound = True
-
 from gi.repository import Gtk, GdkPixbuf, Gdk
 import os
 
diff --git a/demos/gtk-demo/demos/button_box.py b/demos/gtk-demo/demos/button_box.py
index 7cd8d52..04d3419 100644
--- a/demos/gtk-demo/demos/button_box.py
+++ b/demos/gtk-demo/demos/button_box.py
@@ -24,9 +24,6 @@ description = """
 The Button Box widgets are used to arrange buttons with padding.
 """
 
-# See FIXME's
-is_fully_bound = False
-
 from gi.repository import Gtk
 
 class ButtonBoxApp:
@@ -101,14 +98,13 @@ class ButtonBoxApp:
         bbox.set_layout(layout)
         bbox.set_spacing(spacing)
 
-        # FIXME: GtkButton consturctor should take a stock_id
-        button = Gtk.Button.new_from_stock(Gtk.STOCK_OK)
+        button = Gtk.Button(Gtk.STOCK_OK)
         bbox.add(button)
 
-        button = Gtk.Button.new_from_stock(Gtk.STOCK_CANCEL)
+        button = Gtk.Button(Gtk.STOCK_CANCEL)
         bbox.add(button)
 
-        button = Gtk.Button.new_from_stock(Gtk.STOCK_HELP)
+        button = Gtk.Button(Gtk.STOCK_HELP)
         bbox.add(button)
 
         return frame
diff --git a/demos/gtk-demo/demos/clipboard.py b/demos/gtk-demo/demos/clipboard.py
index 6cfa4a4..759c0f7 100644
--- a/demos/gtk-demo/demos/clipboard.py
+++ b/demos/gtk-demo/demos/clipboard.py
@@ -56,9 +56,7 @@ class ClipboardApp:
         entry = Gtk.Entry()
         hbox.pack_start(entry, True, True, 0)
 
-        #FIXME: have the button constuctor take a stock_id
-        # create button
-        button = Gtk.Button.new_from_stock(Gtk.STOCK_COPY)
+        button = Gtk.Button(Gtk.STOCK_COPY)
         hbox.pack_start(button, False, False, 0)
         button.connect('clicked', self.copy_button_clicked, entry)
 
@@ -73,9 +71,7 @@ class ClipboardApp:
         # create secondary entry
         entry = Gtk.Entry()
         hbox.pack_start(entry, True, True, 0)
-        #FIXME: have the button constuctor take a stock_id
-        # create button
-        button = Gtk.Button.new_from_stock(Gtk.STOCK_PASTE)
+        button = Gtk.Button(Gtk.STOCK_PASTE)
         hbox.pack_start(button, False, False, 0)
         button.connect('clicked', self.paste_button_clicked, entry)
 
diff --git a/demos/gtk-demo/demos/colorselector.py b/demos/gtk-demo/demos/colorselector.py
index ed1e330..f3dd74f 100644
--- a/demos/gtk-demo/demos/colorselector.py
+++ b/demos/gtk-demo/demos/colorselector.py
@@ -32,8 +32,6 @@ from gi.repository import Gtk, Gdk
 
 class ColorSelectorApp:
     def __init__(self):
-        # FIXME: we should allow Gdk.Color to be allocated without parameters
-        #        Also color doesn't seem to work
         self.color = Gdk.RGBA()
         self.color.red = 0
         self.color.blue = 1
diff --git a/demos/gtk-demo/demos/combobox.py b/demos/gtk-demo/demos/combobox.py
index ce24d65..710c34b 100644
--- a/demos/gtk-demo/demos/combobox.py
+++ b/demos/gtk-demo/demos/combobox.py
@@ -113,9 +113,7 @@ class ComboboxApp:
         combo.add_attribute(renderer, 'text', 0)
         combo.set_cell_data_func(renderer, self.is_capital_sensistive, None)
 
-        # FIXME: make new_from_indices work
-        #        make constructor take list or string of indices
-        path = Gtk.TreePath.new_from_string('0:8')
+        path = Gtk.TreePath('0:8')
         treeiter = model.get_iter(path)
         combo.set_active_iter(treeiter)
 
diff --git a/demos/gtk-demo/demos/drawingarea.py b/demos/gtk-demo/demos/drawingarea.py
index ce2f6a9..1d7471d 100644
--- a/demos/gtk-demo/demos/drawingarea.py
+++ b/demos/gtk-demo/demos/drawingarea.py
@@ -34,9 +34,6 @@ and drag in the scribble area to draw squiggles. Resize the window
 to clear the area.
 """
 
-# See FIXME's
-is_fully_bound = False
-
 from gi.repository import Gtk, Gdk
 import cairo
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]