Modal window and gtk.main()?

View: New views
8 Messages — Rating Filter:   Alert me  

Modal window and gtk.main()?

by Robert Palmqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a problem that I really need some help with. I need to open a new window from my applications main window. This new window need to be modal, I need to be able to get a result from it based on user interaction with it, I need to be able to toggle it between fullscreen and non-fullscreen and I also need it to host a widget without any borders or padding in it.

gtk.Dialog makes it easy to create a window that implements most of the behaviour trough the “run” method. Problem is that I don’t need the separator and the button area. I can hide them but I still en up with a frame or padding between the content areas VBox and the windows borders. I also have to play with the “set_type_hint” method in order for it to accept the “fullscreen” and “unfullscreen” methods.

I wanted to take a look at the source for gtk.Dialog to se if I could mimic the “run” method from a gtk.Window but I never found the actual source for gtk.Dialog.run().

I then read about gtk.main() and gtk.main_quit(). And if I understood the documentation, then I am supposed to be able to run gtm.main() in my main window and call it again from my other window, exit this second main loop with gtk.main_quit(). I tried it out and everything seems to work as intended except that I can’t close the main window when I get back from my second gtk.main(). I am running Ubuntu 9.04 and I also install idle hooks trough gobject.idle_add() in both the main window and my other window.

I haven’t found one single example of how to open another window from the main window with an additional call to gtk.main() and exit from it using gtk.main_quit(). I would happily use the gtk.Dialog class if there was a simple dialog window without additional widgets that I might not use in my dialog (such as the action and content areas gtk.ButtonBox and gtk.VBox) or windows properties (such as extra decorations, frames, padding etc.) or behaviour (such as not being able to set fullscreen) out of my control (trough obvious class member functions or properties). I personally feel that it would make more sense with a gtk.Dialog class that is just an empty dialog without the content and action area etc. and then a sub-class implementing these additional bells and whistles, but that’s me.

Back to my problem, should it be possible to make nested calls to gtk.main() and gtk.main_quit() without any additional calls to prevent side effects (like the main window stop responding to some events)? Note I have no threads of my own running in this application (I use the idle hooks instead of threads).

Could gobject.idle_add() and my idle hooks affect the behaviour of nested calls to gtk.main() and gtk.main_quit()?

Where can I find examples of how to properly use nested calls to gtk.main() and gtk.main_quit() in order to make a window act as a modal dialog without having to use gtk.Dialog (or how can I make my own tgk.Dialog.run method for a regular gtk.Window)?

Is there a way to remove the frame or padding or decoration (or whatever it is) that gtkDialog puts around the content and action area?

Where can I find examples of best practise to implement and handle more than one window (more than one gtk.Window, not  the use of one gtk.Window and additional windows realized with the use of gtk.Dialog or its sub-classes) in a pygtk application (I can’t find any examples in the documentation, the tutorial or the FAQ, am I missing something obvious here?)?

Thankful for any information that can take me further towards a solution to my problem…

Regards / Robert

_______________________________________________________________
Nu kan du vinna riktigt mycket i Betssons Casino!

_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: Modal window and gtk.main()?

by Pietro Battiston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Il giorno gio, 22/10/2009 alle 11.51 -0700, Robert Palmqvist ha scritto:

> I have a problem that I really need some help with. I need to open a
> new window from my applications main window. This new window need to
> be modal, I need to be able to get a result from it based on user
> interaction with it, I need to be able to toggle it between fullscreen
> and non-fullscreen and I also need it to host a widget without any
> borders or padding in it.
>
> gtk.Dialog makes it easy to create a window that implements most of
> the behaviour trough the “run” method. Problem is that I
> don’t need the separator and the button area. I can hide them but
> I still en up with a frame or padding between the content areas VBox
> and the windows borders. I also have to play with the
> “set_type_hint” method in order for it to accept the
> “fullscreen” and “unfullscreen” methods.
>
> I wanted to take a look at the source for gtk.Dialog to se if I could
> mimic the “run” method from a gtk.Window but I never found
> the actual source for gtk.Dialog.run().
>
> I then read about gtk.main() and gtk.main_quit(). And if I understood
> the documentation, then I am supposed to be able to run gtm.main() in
> my main window and call it again from my other window, exit this
> second main loop with gtk.main_quit(). I tried it out and everything
> seems to work as intended except that I can’t close the main
> window when I get back from my second gtk.main(). I am running Ubuntu
> 9.04 and I also install idle hooks trough gobject.idle_add() in both
> the main window and my other window.
>
> I haven’t found one single example of how to open another window
> from the main window with an additional call to gtk.main() and exit
> from it using gtk.main_quit(). I would happily use the gtk.Dialog
> class if there was a simple dialog window without additional widgets
> that I might not use in my dialog (such as the action and content
> areas gtk.ButtonBox and gtk.VBox) or windows properties (such as extra
> decorations, frames, padding etc.) or behaviour (such as not being
> able to set fullscreen) out of my control (trough obvious class member
> functions or properties). I personally feel that it would make more
> sense with a gtk.Dialog class that is just an empty dialog without the
> content and action area etc. and then a sub-class implementing these
> additional bells and whistles, but that’
>
> Back to my problem, should it be possible to make nested calls to
> gtk.main() and gtk.main_quit() without any additional calls to prevent
> side effects (like the main window stop responding to some events)?
> Note I have no threads of my own running in this application (I use
> the idle hooks instead of threads).
>
> Could gobject.idle_add() and my idle hooks affect the behaviour of
> nested calls to gtk.main() and gtk.main_quit()?
>
> Where can I find examples of how to properly use nested calls to
> gtk.main() and gtk.main_quit() in order to make a window act as a
> modal dialog without having to use gtk.Dialog (or how can I make my
> own tgk.Dialog.run method for a regular gtk.Window)?
>
> Is there a way to remove the frame or padding or decoration (or
> whatever it is) that gtkDialog puts around the content and action
> area?
>
> Where can I find examples of best practise to implement and handle
> more than one window (more than one gtk.Window, not  the use of one
> gtk.Window and additional windows realized with the use of gtk.Dialog
> or its sub-classes) in a pygtk application (I can’t find any
> examples in the documentation, the tutorial or the FAQ, am I missing
> something obvious here?)?
>
> Thankful for any information that can take me further towards a
> solution to my problem…
>
> Regards / Robert
>
>
>
> _______________________________________________________________
> Nu kan du vinna riktigt mycket i Betssons Casino!
>
> _______________________________________________
> pygtk mailing list   pygtk@...
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/

Ehm... sorry if my question is very stupid, but it is a risk I want to
take: before playing with main loops, did you take a look at
gtk.Window.set_modal ?

Pietro

_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: Modal window and gtk.main()?

by Christian Becke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert Palmqvist schrieb:
> I wanted to take a look at the source for gtk.Dialog to se if I could
> mimic the “run” method from a gtk.Window but I never found the actual
> source for gtk.Dialog.run().

The source is here:
http://git.gnome.org/cgit/gtk+/tree/gtk/gtkdialog.c#n993

> Where can I find examples of best practise to implement and handle more
> than one window (more than one gtk.Window, not  the use of one
> gtk.Window and additional windows realized with the use of gtk.Dialog or
> its sub-classes) in a pygtk application (I can’t find any examples in
> the documentation, the tutorial or the FAQ, am I missing something
> obvious here?)?

Example:
-----------------------8<-----------------------
import gtk

class SecondWin:

        def __init__ (self, parent):
                self.parent = parent
                self.w = gtk.Window ()

                # Disable interaction with parent
                self.w.set_modal (True)

                # Tell WM this is a dialog
                self.w.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_DIALOG)

                # Tell WM this window belongs to parent
                self.w.set_transient_for (parent)
                self.w.connect ("delete-event", self.hide)

                box = gtk.VButtonBox ()
                self.w.add (box)

                b = gtk.Button (stock=gtk.STOCK_CLOSE)
                b.connect ("clicked", self.hide)
                box.add (b)


        def show (self):
                self.w.show_all ()
                # Indicate visually that interaction with parent
                # is not possible while we are shown
                self.parent.set_sensitive (False)


        def hide (self, *args):
                # Indicate visually that interaction with parent
                # is possible again
                self.parent.set_sensitive (True)
                self.w.hide ()
                return True


class MainWin:

        def __init__ (self):
                self.w = gtk.Window ()
                self.w.set_position (gtk.WIN_POS_CENTER)
                self.w.connect ("delete-event", gtk.main_quit)

                box = gtk.VButtonBox ()
                self.w.add (box)

                self.sw = SecondWin (self.w)

                b = gtk.Button ("show second win")
                b.connect ("clicked", self.show_second_win, self.sw)
                box.pack_start (b, False)

                b = gtk.Button (stock=gtk.STOCK_QUIT)
                b.connect ("clicked", gtk.main_quit)
                box.pack_start (b, False)


        def run (self):
                self.w.show_all ()
                gtk.main ()


        def show_second_win (self, button, w):
                w.show ()


w = MainWin ()
w.run ()
----------------------->8-----------------------

HTH.
_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: Modal window and gtk.main()?

by Robert Palmqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/22/09, Pietro Battiston <toobaz@...> wrote:
> Ehm... sorry if my question is very stupid, but it is a risk I want to
> take: before playing with main loops, did you take a look at
> gtk.Window.set_modal ?
>
> Pietro
>
The question is not stupid at all. Yes I took a look at
gtk.Window.set_modal and I played around with it but it didn't seem to
be the root cause of my problem.
_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: Modal window and gtk.main()?

by Robert Palmqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot for your simple example Christian. It works like a charm
and it also made it easy to reproduce my issue. Take a look at the
additions I made to your code. I added an idle hook to each of the
windows and the code now behave like my application (show the second
window and you can't use the button to close the first one anymore,
you can kill it by closing it by the window manager but it will leave
the interpreter hanging). So what have I done wrong? Setting idle
hooks in combination with nested gtk.main() or is it because i call
gtk.events_pending() and gtk.main_iteration(False) in the idle hooks?
I don't know if I am supposed to be able to call gtk.events_pending()
or gtk.main_iteration(False) in an idle hook but it worked until I
started to use a nested gtk.main()...

Example:
-----------------------8<-----
------------------
import gtk, gobject

class SecondWin:

   def __init__ (self, parent):
       self.parent = parent
       self.w = gtk.Window ()

       # Disable interaction with parent
       self.w.set_modal (True)

       # Tell WM this is a dialog
       self.w.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_DIALOG)

       # Tell WM this window belongs to parent
       self.w.set_transient_for (parent)
       self.w.connect ("delete-event", self.hide)

       box = gtk.VButtonBox ()
       self.w.add (box)

       b = gtk.Button (stock=gtk.STOCK_CLOSE)
       b.connect ("clicked", self.hide)
       box.add (b)
       gobject.idle_add(self.on_idle)


   def show (self):
       self.w.show_all ()
       # Indicate visually that interaction with parent
       # is not possible while we are shown
       self.parent.set_sensitive (False)

   def on_idle(self):
       while gtk.events_pending():
          gtk.main_iteration(False)
       return True

   def hide (self, *args):
       # Indicate visually that interaction with parent
       # is possible again
       self.parent.set_sensitive (True)
       self.w.hide ()
       return True


class MainWin:

   def __init__ (self):
       self.w = gtk.Window ()
       self.w.set_position (gtk.WIN_POS_CENTER)
       self.w.connect ("delete-event", gtk.main_quit)

       box = gtk.VButtonBox ()
       self.w.add (box)

       self.sw = SecondWin (self.w)

       b = gtk.Button ("show second win")
       b.connect ("clicked", self.show_second_win, self.sw)
       box.pack_start (b, False)

       b = gtk.Button (stock=gtk.STOCK_QUIT)
       b.connect ("clicked", gtk.main_quit)
       box.pack_start (b, False)
       gobject.idle_add(self.on_idle)

   def on_idle(self):
       while gtk.events_pending():
          gtk.main_iteration(False)
       return True

   def run (self):
       self.w.show_all ()
       gtk.main ()


   def show_second_win (self, button, w):
       w.show ()

w = MainWin ()
w.run ()
-----------------------8<-----------------------


On Thu, Oct 22, 2009 at 5:13 PM, Christian Becke <christianbecke@...> wrote:
Robert Palmqvist schrieb:
> I wanted to take a look at the source for gtk.Dialog to se if I could
> mimic the “run” method from a gtk.Window but I never found the actual
> source for gtk.Dialog.run().

The source is here:
http://git.gnome.org/cgit/gtk+/tree/gtk/gtkdialog.c#n993

> Where can I find examples of best practise to implement and handle more
> than one window (more than one gtk.Window, not  the use of one
> gtk.Window and additional windows realized with the use of gtk.Dialog or
> its sub-classes) in a pygtk application (I can’t find any examples in
> the documentation, the tutorial or the FAQ, am I missing something
> obvious here?)?

Example:
-----------------------8<-----------------------
import gtk

class SecondWin:

       def __init__ (self, parent):
               self.parent = parent
               self.w = gtk.Window ()

               # Disable interaction with parent
               self.w.set_modal (True)

               # Tell WM this is a dialog
               self.w.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_DIALOG)

               # Tell WM this window belongs to parent
               self.w.set_transient_for (parent)
               self.w.connect ("delete-event", self.hide)

               box = gtk.VButtonBox ()
               self.w.add (box)

               b = gtk.Button (stock=gtk.STOCK_CLOSE)
               b.connect ("clicked", self.hide)
               box.add (b)


       def show (self):
               self.w.show_all ()
               # Indicate visually that interaction with parent
               # is not possible while we are shown
               self.parent.set_sensitive (False)


       def hide (self, *args):
               # Indicate visually that interaction with parent
               # is possible again
               self.parent.set_sensitive (True)
               self.w.hide ()
               return True


class MainWin:

       def __init__ (self):
               self.w = gtk.Window ()
               self.w.set_position (gtk.WIN_POS_CENTER)
               self.w.connect ("delete-event", gtk.main_quit)

               box = gtk.VButtonBox ()
               self.w.add (box)

               self.sw = SecondWin (self.w)

               b = gtk.Button ("show second win")
               b.connect ("clicked", self.show_second_win, self.sw)
               box.pack_start (b, False)

               b = gtk.Button (stock=gtk.STOCK_QUIT)
               b.connect ("clicked", gtk.main_quit)
               box.pack_start (b, False)


       def run (self):
               self.w.show_all ()
               gtk.main ()


       def show_second_win (self, button, w):
               w.show ()


w = MainWin ()
w.run ()
----------------------->8-----------------------

HTH.
_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Parent Message unknown Re: Modal window and gtk.main()?

by Christian Becke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert Palmqvist schrieb:
> Thanks a lot for your simple example Christian. It works like a charm
> and it also made it easy to reproduce my issue. Take a look at the
> additions I made to your code. I added an idle hook to each of the
> windows and the code now behave like my application (show the second
> window and you can't use the button to close the first one anymore,
> you can kill it by closing it by the window manager but it will leave
> the interpreter hanging).

What exactly are you trying to achieve with the idle_add?
If I understood you correctly, you want to show a secondary window, and
inhibit interaction with the main window as long as the secondary window
is shown, right? If this is the case, there is no need for the idle_add.
If you want to allow interaction with the main window while the
secondary window is shown, just skip the call to window.set_modal.

> So what have I done wrong? Setting idle
> hooks in combination with nested gtk.main() or is it because i call
> gtk.events_pending() and gtk.main_iteration(False) in the idle hooks?
> I don't know if I am supposed to be able to call gtk.events_pending()
> or gtk.main_iteration(False) in an idle hook but it worked until I
> started to use a nested gtk.main()...

You are not using a nested gtk.main. You'd have to call gtk.main a
second time for that.

You are misusing gtk.main_iteration. It is intended for integrating a
gtk mainloop into another mainloop, or stepping through the gtk mainloop
 while there is no gtk mainloop running. Just don't call
gtk.main_iteration while there is a gtk mainloop running.

>
> Example:
> -----------------------8<-----------------------
> import gtk, gobject
>
> class SecondWin:
>
>     def __init__ (self, parent):
>         self.parent = parent
>         self.w = gtk.Window ()
>
>         # Disable interaction with parent
>         self.w.set_modal (True)
>
>         # Tell WM this is a dialog
>         self.w.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
>
>         # Tell WM this window belongs to parent
>         self.w.set_transient_for (parent)
>         self.w.connect ("delete-event", self.hide)
>
>         box = gtk.VButtonBox ()
>         self.w.add (box)
>
>         b = gtk.Button (stock=gtk.STOCK_CLOSE)
>         b.connect ("clicked", self.hide)
>         box.add (b)
>         gobject.idle_add(self.on_idle)
>
>
>     def show (self):
>         self.w.show_all ()
>         # Indicate visually that interaction with parent
>         # is not possible while we are shown
>         self.parent.set_sensitive (False)
>
>     def on_idle(self):
>         while gtk.events_pending():
>            gtk.main_iteration(False)
>         return True
>
>     def hide (self, *args):
>         # Indicate visually that interaction with parent
>         # is possible again
>         self.parent.set_sensitive (True)
>         self.w.hide ()
>         return True
>
>
> class MainWin:
>
>     def __init__ (self):
>         self.w = gtk.Window ()
>         self.w.set_position (gtk.WIN_POS_CENTER)
>         self.w.connect ("delete-event", gtk.main_quit)
>
>         box = gtk.VButtonBox ()
>         self.w.add (box)
>
>         self.sw = SecondWin (self.w)
>
>         b = gtk.Button ("show second win")
>         b.connect ("clicked", self.show_second_win, self.sw)
>         box.pack_start (b, False)
>
>         b = gtk.Button (stock=gtk.STOCK_QUIT)
>         b.connect ("clicked", gtk.main_quit)
>         box.pack_start (b, False)
>         gobject.idle_add(self.on_idle)
>
>     def on_idle(self):
>         while gtk.events_pending():
>            gtk.main_iteration(False)
>         return True
>
>     def run (self):
>         self.w.show_all ()
>         gtk.main ()
>
>
>     def show_second_win (self, button, w):
>         w.show ()
>
> w = MainWin ()
> w.run ()
> -----------------------8<-----------------------

_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: Modal window and gtk.main()?

by Robert Palmqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use the idle_add to do background work on idle time in both windows (one is loading files from a queue, files are added to that queue on and drag and drop. The other windows is preloading files if there is anything to preload in its queue and so on... It works really well.

I use nested calls to gtk.main() but the problem was my use of gtk.main_iteration. It was a rest from a previous solution and I don't really need it anymore. I just cut-and-pasted it from the FAQ when I needed a way to force update of some widgets. But it can be done in a better way if a utilize the idle hooks a bit differently. The root cause of my problem became quite obvious when I added my code to your simple example. I shared it becuase someone else might run into the same problem.

I just had to remove gtk.main_iteration from my idle hooks to make nested calls to gtk.main work as intended. Thanks a lot for your help.

On Fri, Oct 23, 2009 at 6:03 AM, Christian Becke <christianbecke@...> wrote:
Robert Palmqvist schrieb:
> Thanks a lot for your simple example Christian. It works like a charm
> and it also made it easy to reproduce my issue. Take a look at the
> additions I made to your code. I added an idle hook to each of the
> windows and the code now behave like my application (show the second
> window and you can't use the button to close the first one anymore,
> you can kill it by closing it by the window manager but it will leave
> the interpreter hanging).

What exactly are you trying to achieve with the idle_add?
If I understood you correctly, you want to show a secondary window, and
inhibit interaction with the main window as long as the secondary window
is shown, right? If this is the case, there is no need for the idle_add.
If you want to allow interaction with the main window while the
secondary window is shown, just skip the call to window.set_modal.

> So what have I done wrong? Setting idle
> hooks in combination with nested gtk.main() or is it because i call
> gtk.events_pending() and gtk.main_iteration(False) in the idle hooks?
> I don't know if I am supposed to be able to call gtk.events_pending()
> or gtk.main_iteration(False) in an idle hook but it worked until I
> started to use a nested gtk.main()...

You are not using a nested gtk.main. You'd have to call gtk.main a
second time for that.

You are misusing gtk.main_iteration. It is intended for integrating a
gtk mainloop into another mainloop, or stepping through the gtk mainloop
 while there is no gtk mainloop running. Just don't call
gtk.main_iteration while there is a gtk mainloop running.

>
> Example:
> -----------------------8<-----------------------
> import gtk, gobject
>
> class SecondWin:
>
>     def __init__ (self, parent):
>         self.parent = parent
>         self.w = gtk.Window ()
>
>         # Disable interaction with parent
>         self.w.set_modal (True)
>
>         # Tell WM this is a dialog
>         self.w.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
>
>         # Tell WM this window belongs to parent
>         self.w.set_transient_for (parent)
>         self.w.connect ("delete-event", self.hide)
>
>         box = gtk.VButtonBox ()
>         self.w.add (box)
>
>         b = gtk.Button (stock=gtk.STOCK_CLOSE)
>         b.connect ("clicked", self.hide)
>         box.add (b)
>         gobject.idle_add(self.on_idle)
>
>
>     def show (self):
>         self.w.show_all ()
>         # Indicate visually that interaction with parent
>         # is not possible while we are shown
>         self.parent.set_sensitive (False)
>
>     def on_idle(self):
>         while gtk.events_pending():
>            gtk.main_iteration(False)
>         return True
>
>     def hide (self, *args):
>         # Indicate visually that interaction with parent
>         # is possible again
>         self.parent.set_sensitive (True)
>         self.w.hide ()
>         return True
>
>
> class MainWin:
>
>     def __init__ (self):
>         self.w = gtk.Window ()
>         self.w.set_position (gtk.WIN_POS_CENTER)
>         self.w.connect ("delete-event", gtk.main_quit)
>
>         box = gtk.VButtonBox ()
>         self.w.add (box)
>
>         self.sw = SecondWin (self.w)
>
>         b = gtk.Button ("show second win")
>         b.connect ("clicked", self.show_second_win, self.sw)
>         box.pack_start (b, False)
>
>         b = gtk.Button (stock=gtk.STOCK_QUIT)
>         b.connect ("clicked", gtk.main_quit)
>         box.pack_start (b, False)
>         gobject.idle_add(self.on_idle)
>
>     def on_idle(self):
>         while gtk.events_pending():
>            gtk.main_iteration(False)
>         return True
>
>     def run (self):
>         self.w.show_all ()
>         gtk.main ()
>
>
>     def show_second_win (self, button, w):
>         w.show ()
>
> w = MainWin ()
> w.run ()
> -----------------------8<-----------------------

_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: Modal window and gtk.main()?

by John Stowers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>
> Where can I find examples of how to properly use nested calls to
> gtk.main() and gtk.main_quit() in order to make a window act as a
> modal dialog without having to use gtk.Dialog (or how can I make my
> own tgk.Dialog.run method for a regular gtk.Window)?

gtk.Widget.grab_add ?

John


_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/