50. gui.guimain
— Graphical User Interface for pyFormex.¶
This module contains the main functions responsible for constructing and starting the pyFormex GUI.
50.1. Classes defined in module gui.guimain¶
-
class
gui.guimain.
Board
(parent=None)[source]¶ Message board for displaying read-only plain text messages.
-
class
gui.guimain.
FileWatcher
(*args)[source]¶ Watch for changes in files and then execute the associated function.
50.2. Functions defined in module gui.guimain¶
-
gui.guimain.
setAppFont
(font)[source]¶ Set the main application font.
font is either a QFont or a string resulting from the QFont.toString() method
-
gui.guimain.
setAppFontFamily
(family)[source]¶ Set the main application font family to the given family.
-
gui.guimain.
setAppFontSize
(size)[source]¶ Set the main application font size to the given point size.
-
gui.guimain.
setAppearance
()[source]¶ Set all the GUI appearance elements.
Sets the GUI appearance from the current configuration values ‘gui/style’, ‘gui/font’, ‘gui/fontfamily’, ‘gui/fontsize’.
-
gui.guimain.
xwininfo
(*, windowid=None, name=None)[source]¶ Get information about an X window.
Returns the information about an X11 window as obtained from the
xwininfo
command, but parsed as a dict. The window can be specified by its id or by its name. If neither is provided, the user needs to interactively select a window by clicking the mouse in that window.- Parameters
- Returns
dict – Return all the information obtained from calling
xwininfo
for the specified or picked window. If a window id or name is specified that does not exist, an empty dict is returned.
Notes
The window id of the pyFormex main window can be obtained from pf.GUI.winId(). The name of the window is pf.Version().
-
gui.guimain.
pidofxwin
(windowid)[source]¶ Returns the PID of the process that has created the window.
Remark: Not all processes store the PID information in the way it is retrieved here. In many cases (X over network) the PID can not be retrieved. However, the intent of this function is just to find a dangling pyFormex process, and should probably work on a normal desktop configuration.
-
gui.guimain.
findOldProcesses
(max=16)[source]¶ Find old pyFormex GUI processes still running.
There is a maximum to the number of processes that can be detected. 16 will suffice largely, because there is no sane reason to open that many pyFormex GUI’s on the same screen.
Returns the next available main window name, and a list of running pyFormex GUI processes, if any.