[pygtk] FW: Notebook Pages Not Populating

Freeh Sophia freehsophia at gmail.com
Thu Aug 25 17:57:50 WST 2011

Hello all,

I am working on an application (ReliaFree) using pyGTK2 to provide the
GUI.  All of the data associated with this application is stored in
MySQL databases.  When the database is opened, the data is loaded in a
treeview.  When the user selects an item (row) in the treeview, various
combobox and entry widgets are populated.  These widgets are grouped and
organized on various notebook widget pages.  Since the information can
change depending on whether the selected item is a component or an
assembly, the combobox and entry widgets are created "on the fly" each
time a new item is selected in the treeview.

When I first load the database into the treeview, the widgets on the
first two pages are created, shown, and populated.  However, on the
third page, the widgets are not shown.  No errors are thrown, so I am
assuming they are being created and populated.

    1. If I cycle through all three pages in the notebook before
selecting a new item (row) in the treeview, all of the widgets on all
three pages will be shown thereafter.

    2. If I select a new item (row) in the treeview without first
cycling through the pages, only the widgets on the first page are
shown.  Cycling through the pages causes the widgets to be shown thereafter.

I've been trying to figure out what I'm doing wrong for quite awhile
with no success.  Hopefully someone can point me in the right
direction.  Thanks in advance for your help.

Here is part of the function that loads the third page of the notebook
with the treeview row data:

    def load_calculation_results_tab(self, _index_):

        # Clear any existing widgets from previously selected objects.
        if(self.fraRelResults.get_child() is not None):


        # Load the calculation results with Hardware or FRACA Tree
        elif(_index_ == 2 or _index_ == 3):

            if not self.app.HARDWARE._part:
                 quad4) =




        # Show the calculation results page.
        page = self.notebook.get_nth_page(3)

        return False

Here is part of the function called by the preceding function:

    def load_calc_results_tab(self, x_size, y_size):

        layout = gtk.Layout()
        layout.set_size(x_size, y_size + 300)
        quadrant1 = gtk.Alignment(xalign = 0.50,
                                  yalign = 0.50,
                                  xscale = 1.0,
                                  yscale = 1.0)
        scrollwindow = gtk.ScrolledWindow()

        for i in range(len(self._cr_tab_labels[0])):
            label = _widg.make_label(self._cr_tab_labels[0][i],
                                     150, 25)
            layout.put(label, 5, (30 * i + 5))

        self.txtActiveHt = _widg.make_entry(editable=False, bold=True)
        layout.put(self.txtActiveHt, 155, 5)
        self.txtDormantHt = _widg.make_entry(editable=False, bold=True)
        layout.put(self.txtDormantHt, 155, 35)
        self.txtSoftwareHt = _widg.make_entry(editable=False, bold=True)
        layout.put(self.txtSoftwareHt, 155, 65)






        return(quadrant1, quadrant2, quadrant4)

Freeh Sophia
Marketing GmbH
Emanuelstr. 3,
10317 Berlin
Telefon: +49 (33) 5310967
Email: freehsophia at gmail.com
Site: http://flug.airego.de/

More information about the pygtk mailing list