# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1252594067 -7200
# Node ID 5b2c3a9a508886ea7c8dba17d178fa8a2aab04e0
# Parent  f8a52f4e5b80970c640a3a21e55cc8963d29a1df
gdialog: create body objects *before* menubar

This should ease some class of initialization order
problems.

For example the history dialog creates its graphview object
in get_body. Menu item states might depend on what's in the
body (e.g. initial toggle calls for "view" menu items)

diff --git a/hggtk/gdialog.py b/hggtk/gdialog.py
--- a/hggtk/gdialog.py
+++ b/hggtk/gdialog.py
@@ -408,6 +408,19 @@ class GDialog(gtk.Window):
         if x >= 0 and x < w and y >= 0 and y < h:
             self.move(x, y)
 
+        self.tooltips = gtk.Tooltips()
+        toolbar = gtk.Toolbar()
+        tbuttons =  self.get_tbbuttons()
+        for tbutton in tbuttons:
+            toolbar.insert(tbutton, -1)
+        self.toolbar = toolbar
+
+        # Subclass returns the main body
+        body = self.get_body()
+
+        # Subclass provides extra stuff in bottom hbox
+        extras = self.get_extras()
+
         menus = self.get_menu_list()
         if menus:
             allmenus = [
@@ -450,19 +463,6 @@ class GDialog(gtk.Window):
                 item.set_right_justified(rightjustified)
                 menubar.append(item)
 
-        self.tooltips = gtk.Tooltips()
-        toolbar = gtk.Toolbar()
-        tbuttons =  self.get_tbbuttons()
-        for tbutton in tbuttons:
-            toolbar.insert(tbutton, -1)
-        self.toolbar = toolbar
-
-        # Subclass returns the main body
-        body = self.get_body()
-
-        # Subclass provides extra stuff in bottom hbox
-        extras = self.get_extras()
-
         vbox = gtk.VBox(False, 0)
         self.add(vbox)
         if menus:

------------------------------------------------------------------------------
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