numericalmodel.gui package

Graphical user interface for a NumericalModel. This module is only useful if the system package python3-gi is installed to provide the gi module.

To install, use your system’s package manager and install python3-gi.

On Debian/Ubuntu:

sudo apt-get install python3-gi

Note

If you don’t have system privileges, there is also the (experimental) pgi module on PyPi that you can install via:

pip3 install --user pgi

Theoretically, the NumericalModelGui might work with this package as well.

class numericalmodel.gui.NumericalModelGui(numericalmodel)[source]

Bases: numericalmodel.utils.LoggerObject

class for a GTK gui to run a NumericalModel interactively

Parameters:numericalmodel (NumericalModel) – the NumericalModel to run
__getitem__(key)[source]

When indexed, return the corresponding Glade gui element

Parameters:key (str) – the Glade gui element name
quit(*args)[source]

Stop the gui

run()[source]

Run the gui

setup_gui()[source]

Set up the GTK gui elements

setup_signals(signals, handler)[source]

This is a workaround to signal.signal(signal, handler) which does not work with a GLib.MainLoop for some reason. Thanks to: http://stackoverflow.com/a/26457317/5433146

Parameters:
  • signals (list) – the signals (see signal module) to connect to
  • handler (callable) – function to be executed on these signals
builder

The gui’s GtkBuilder. This is a read-only property.

Getter:Return the GtkBuilder, load the gladefile if necessary.
Type:GtkBuilder
gladefile

The gui’s Glade file. This is a read-only property.

Type:str