On Wed, Nov 4, 2009 at 3:20 PM, Peer Sommerlund
<peer.sommerl...@gmail.com> wrote:
> I'm trying to use the update dialog, but is a little puzzled about how to do
> it.
>
> In history.py the function show_dialog looks like this:
> def show_dialog(self, dlg):
>        dlg.set_transient_for(self)
>        dlg.show_all()
>        dlg.present()
>        if gtk.pygtk_version < (2, 12, 0):
>            # Workaround for old PyGTK (< 2.12.0) issue.
>            # See background of this: f668034aeda3
>            dlg.set_transient_for(None)
>
> On my system (Windows, GTK+ 2.10) it will generate a dialog window with no
> entry in the process bar, which is not modal (I can still use the
> application), and it will also not stay on top. This is very unfortunate if
> I change to another application and then back to THG -- where did my dialog
> go?
>
> If I change the code to
> def show_dialog(self, dlg):
>        dlg.show_all()
>        dlg.run()
>
> then the window will have an entry in the process bar and stay on top as
> well. As a bonus, the application cannot accept input.
>
> What is the bennefit of set_transient_for and present? Maybe something on
> Unix?

I think TK added those calls originally as a result of following this PyGTK FAQ:

http://faq.pygtk.org/index.py?req=show&file=faq10.003.htp

At the time, I think was to make the dialog spawn on top of the main
app to work around some bug.  Yuki found that it has bad behavior on
modern PyGtk versions on Windows, and that's why it's conditional.
I'm afraid no one understands it very well.

See also:

http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--set-transient-for

If your simplified version works ok with PyGtk 2.10, I'm ok with doing
that throughout.

--
Steve Borho

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to