[gnome-devel-docs] tutorials python: dialog example, modal dialogflags



commit f685e916e22b5ab0a202c0a77cbfcf7412d9d196
Author: Marta Maria Casetti <mmcasetti gmail com>
Date:   Tue May 22 14:57:54 2012 +0100

    tutorials python: dialog example, modal dialogflags

 platform-demos/C/samples/dialog.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/platform-demos/C/samples/dialog.py b/platform-demos/C/samples/dialog.py
index 498d16d..3c45f3e 100644
--- a/platform-demos/C/samples/dialog.py
+++ b/platform-demos/C/samples/dialog.py
@@ -14,7 +14,7 @@ class MyWindow(Gtk.ApplicationWindow):
         button.show()
         
     def on_button_click(self, *args):
-        dialog = Gtk.Dialog("A Gtk+ Dialog", self, Gtk.DialogFlags.DESTROY_WITH_PARENT)
+        dialog = Gtk.Dialog("A Gtk+ Dialog", self, Gtk.DialogFlags.MODAL)
         dialog.add_button(button_text="OK", response_id=Gtk.ResponseType.OK)
         # otherwise, we can add buttons as
         # dialog.add_button(button_text="Another button", response_id=42)
@@ -28,6 +28,7 @@ class MyWindow(Gtk.ApplicationWindow):
         
     def on_response(self, widget, response_id):
         print "response_id is", response_id
+        widget.destroy()
                 
 class MyApplication(Gtk.Application):
     def __init__(self):



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