Delegates, which combine some UI, some signals, some signal handlers, and some properties,
copyright: | 2009-2010 by pygtkhelpers Authors |
---|---|
license: | LGPL2 or later |
Base delegate functionality.
This is abstract.
It uses hand-created, and gtk.Builder created ui’s, and combinations of the two, and is responsible for automatically loading ui files from resources, and connecting signals.
Additionally, it is a gobject.GObject subclass, and so can be used with the gsignal, and gproperty functions from pygtkhelpers.utils in order to add property and signal functionality.
The abstract elements of this class are:
- The way it gets a toplevel widget from a ui file
- How it creates a default toplevel widget if one was not found in the ui file, or no ui file is specified.
Add a slave delegate
Create any UI by hand.
Override to create additional UI here.
This can contain any instance initialization, so for example mutation of the gtk.Builder generated UI, or creating the UI in its entirety.
Get the toplevel widget from a gtk.Builder file.
Call hide on the toplevel widget
Hide the widget and quit the main loop
This method is called when the model is changed
Call show_all on the toplevel widget
Show the main widget and run the gtk loop
A View that is a slave
Get the toplevel widget from a gtk.Builder file.
The slave view implementation first searches for the widget named as self.toplevel_name (which defaults to “main”. If this is missing, the first toplevel widget is discovered in the Builder file, and it’s immediate child is used as the toplevel widget for the delegate.
Show the main widget in a window and run the gtk loop
A View that is a toplevel widget
Get the toplevel widget from a gtk.Builder file.
The main view implementation first searches for the widget named as self.toplevel_name (which defaults to “main”. If this is missing, or not a gtk.Window, the first toplevel window found in the gtk.Builder is used.
A View that is a Window
Get the first toplevel widget in a gtk.Builder hierarchy.
This is mostly used for guessing purposes, and an explicit naming is always going to be a better situation.