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 &#8220run&#8221 method. Problem is that I
> don&#8217t 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
> &#8220set_type_hint&#8221 method in order for it to accept the
> &#8220fullscreen&#8221 and &#8220unfullscreen&#8221 methods.
> 
> I wanted to take a look at the source for gtk.Dialog to se if I could
> mimic the &#8220run&#8221 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&#8217t 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&#8217t 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&#8217t 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@daa.com.au
> 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@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to