changeset 9:229986217a3d

bug fix: view is not displayed when it splits the view Left/Right
author Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
date Wed, 17 Nov 2010 23:59:48 +0100
parents 55df0b15706b
children d2cbc0278b30
files Gtk/gui.py
diffstat 1 files changed, 10 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/Gtk/gui.py	Wed Nov 17 21:05:56 2010 +0100
+++ b/Gtk/gui.py	Wed Nov 17 23:59:48 2010 +0100
@@ -1213,7 +1213,7 @@
         self.__path: the position or path of the view in the page notebook
         self.__connected: boolean value, True means that the View object sends
             and receives signals from/to others views
-        self.__widget: main widget. a gtk.Toolbar?
+        self.__widget: main widget. a gtk.VBox
         self.__view: the object to show:
             * DecompositionList object
             * Description object
@@ -1244,14 +1244,7 @@
         _cell = gtk.CellRendererText()
         _combobox.pack_start(_cell, True)
         _combobox.add_attribute(_cell, 'text', 0)
-        _vbox = gtk.VBox()
-        _vbox.show()
-        _toolitem = gtk.ToolItem()
-        _toolitem.set_expand(True)
-        _toolitem.add(_vbox)
-        _toolitem.show()
-        self.__widget = gtk.Toolbar()
-        self.__widget.insert(_toolitem, 0)
+        self.__widget = gtk.VBox()
         _hbox = gtk.HBox()
         if view_type == "DecompositionList":
             self.__view = DecompositionList(budget, weakref.ref(self),
@@ -1297,8 +1290,8 @@
         _view_icon.show()
         _combobox.connect("changed", self._change_combo)
         _combobox.show()
-        _vbox.pack_start(_hbox,False)
-        _vbox.pack_start(self.__view.widget, True, True)
+        self.__widget.pack_start(_hbox,False)
+        self.__widget.pack_start(self.__view.widget, True, True)
         _hbox.pack_start(_view_icon, False, False,0)
         _hbox.pack_start(_combobox, False, False,0)
         _invisible = gtk.HBox()
@@ -1357,9 +1350,7 @@
         _wr_page = self.__view.page
         _path = self.__view.path
         _path_record = self.__view.active_path_record
-        _toolitem = self.__widget.get_nth_item(0)
-        _vbox= _toolitem.get_children()[0]
-        _hbox = _vbox.get_children()[0]
+        _hbox = self.__widget.get_children()[0]
         _combobox = _hbox.get_children()[1]
         _hbox.remove(_combobox)
         _invisible = _hbox.get_children()[1]
@@ -1370,8 +1361,8 @@
         _hbox.remove(_connected_button)
         _close_button = _hbox.get_children()[1]
         _hbox.remove(_close_button)
-        _vbox.remove(self.__view.widget)
-        _vbox.remove(_hbox)
+        self.__widget.remove(self.__view.widget)
+        self.__widget.remove(_hbox)
         _hbox.destroy()
         _view_icon = gtk.Image()
         if _index == 0:
@@ -1415,8 +1406,8 @@
         _hbox.pack_start(_connected_button, False, False, 0)
         _hbox.pack_start(_close_button, False, False, 0)
         _hbox.show()
-        _vbox.pack_start(_hbox, False, False, 0)
-        _vbox.pack_start(self.__view.widget, True, True, 0)
+        self.__widget.pack_start(_hbox, False, False, 0)
+        self.__widget.pack_start(self.__view.widget, True, True, 0)
 
     def _menu_view(self, widget):
         """_menu_view(widget)
@@ -1577,12 +1568,10 @@
         runMessage
         clear(self)
     """
-    # TODO:  *control the position paned separator. Now is always 200 pixels
+    # TODO:  *control the position paned separator. Now is always in the middle
     # TODO:     can be with a float(0.0-1.0) aspect ratio
     # TODO:          0.0 no space for widget1
     # TODO:          1.0 all the space for widget1
-    # TODO:  *control the position pane separator when the size of the window
-    # TODO:     change with the same ascpect ratio
 
     def __init__(self, orientation, path, item1, item2):
         """__init__(oritentation, path, item1, item2)
@@ -1612,7 +1601,6 @@
             raise ValueError, _("Invalid orientation.")
         self.__widget.pack1(item1.widget,True,False)
         self.__widget.pack2(item2.widget,True,False)
-        self.__widget.set_position(200)
         self.__widget.show()
         self.__items = [item1, item2]
         self.__path = path