2

This warning appears when I add a custom Gtk.Box in a Gtk.Stack.

class MainWindow(Gtk.ApplicationWindow):

    """
    Class that inherits of Gtk.ApplicationWindow and that represents the main window application
    """

    def __init__(self, app):
        super().__init__(application=app)

        self.builder = Gtk.Builder.new_from_file(UIS_PATH + 'main_window.xml')

        self.set_titlebar(self.builder.get_object('mw_headerbar'))
        self.add(self.builder.get_object('mw_main_vbox'))

        stack = self.builder.get_object('mw_main_stack')
        stack.add_titled(PersonsFom(self), 'persons_form', 'Gestão de Pessoas')

        sidebar = Gtk.StackSidebar()
        sidebar.set_stack(stack)
        sidebar.set_size_request(200, -1)
        mw_main_hbox = self.builder.get_object('mw_main_hbox')
        mw_main_hbox .pack_start(sidebar, expand=False, fill=True, padding=0)
        mw_main_hbox.reorder_child(sidebar, 0)

The warning appears when the execution flow is line stack.add_titled(PersonsFom(self), 'persons_form', 'Gestão de Pessoas'). PersonsForm is a sub-class of Gtk.Box containing several components such as buttons, Boxes, Grids, Entries, ... I do not understand what you mean this warning.

The MainWindow class has parts built with glade file and PersonsForm has too. I will also leave the PersonsForm code.

The git repository.

Matheus Saraiva
  • 1,144
  • 1
  • 11
  • 33
  • Show your glade file. – andlabs Oct 07 '16 at 01:40
  • FTR, I've been getting the same error with Glade from Arch repos *(there were also others, and the window didn't appear)* till upgraded the system. – Hi-Angel Oct 10 '16 at 05:20
  • Are you sure the message shows up with that code? Because looking through your repository I see an `images_chooser_dialog`... and I'm not sure what else is adding things to a dialog – andlabs Oct 11 '16 at 04:10
  • Yes! It is showed. But if I create the `Gtk.HeaderBar` by python code and remove the `HeaderBar` in the glade file, the error is not showing. Sorry for delay. – Matheus Saraiva Oct 16 '16 at 00:26
  • In fact I think it's a bug in GTK 3.20. I did run the code without making changes on GTK 3.18 and the error does not appear. – Matheus Saraiva Oct 16 '16 at 19:35

0 Answers0