# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1252593380 -7200
# Node ID f8a52f4e5b80970c640a3a21e55cc8963d29a1df
# Parent  c4ec7968bc252bbaddb11a223d80bcdec676416f
gdialog: move packing of widgets to the end of _setup_gtk

Move them together into a separate block.

This will ease separation of order of object creation
from order of packing (see next change).

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

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