inkex.gui.app module#

Gtk Application base classes, providing a way to load a GtkBuilder with a specific glade/ui file containing windows, and building a usable pythonic interface from them.

class inkex.gui.app.GtkApp(start_loop=False, start_gui=True, **kwargs)[source]#

Bases: object

This wraps gtk builder and allows for some extra functionality with windows, especially the management of gtk main loops.

Parameters
  • start_loop (bool, optional) – If set to true will start a new gtk main loop. Defaults to False.

  • start_gui (bool, optional) – Used as local propertes if unset and passed to primary window when loaded. Defaults to True.

property prefix#

Folder prefix added to ui_dir

property windows#

Returns a list of windows for this app

property ui_dir#

This is often the local directory

property ui_file#

If a single file is used for multiple windows

property app_name#

Set this variable in your class

property window#

Return the primary window

run()[source]#

Run the gtk mainloop with ctrl+C and keyboard interrupt additions

get_ui_file(window)[source]#

Load any given gtk builder file from a standard location.

init_gui()[source]#

Initialise all of our windows and load their signals

load_window(name, *args, **kwargs)[source]#

Load a specific window from our group of windows

load_window_extract(name, **kwargs)[source]#

Load a child window as a widget container

proto_window(name)[source]#

Loads a Glade window as a window without initialisation, used for extracting widgets from windows without loading them as windows.

remove_window(window)[source]#

Remove the window from the list and exit if none remain

exit()[source]#

Exit our gtk application and kill gtk main if we have to