v_sim.UiMain

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Gtk.Window Gtk.Window Gtk.Bin->Gtk.Window Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container v_sim.UiMain v_sim.UiMain Gtk.Window->v_sim.UiMain

Subclasses:

None

Methods

Inherited:

Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

v_sim.UiMainClass (5), Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

createMain (panel, renderWindow, renderArea)

class

getCurrentPanel ()

class

getDefaultRendering ()

class

getRememberPosition ()

class

initPanels (data)

class

new (oneWindow)

class

runCommandLine (data)

class

setRememberPosition (val)

buildInteractiveDialog ()

class_setCurrentPanel ()

getLastOpenDirectory ()

getRendering ()

getSelectedDirectory (parent, multiple, dir)

quit (force)

setLastOpenDirectory (directory, type)

Virtual Methods

Inherited:

Gtk.Window (5), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Window (33), Gtk.Container (3), Gtk.Widget (39)

Style Properties

Inherited:

Gtk.Window (2), Gtk.Widget (17)

Signals

Inherited:

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

DataFocused

This signal is emitted when dataObj has been displayed on the rendering window and is ready for use.

DirectoryChanged

The current directory has been changed.

Fields

Inherited:

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

aboutDialog

Gtk.Widget

r

interactiveDialog

Gtk.Widget

r

pairsDialog

Gtk.Widget

r

parent

Gtk.Window

r

priv

v_sim.UiMainPrivate

r

renderingWindow

Gtk.Widget

r

Class Details

class v_sim.UiMain(*args, **kwargs)
Bases:

Gtk.Window

Abstract:

No

Structure:

v_sim.UiMainClass

Structure to describe the main interface of V_Sim.

classmethod createMain(panel, renderWindow, renderArea)
Parameters:

A convenience routine to create a command panel, a rendering window and links them together.

classmethod getCurrentPanel()
Returns:

the command Panel.

Return type:

v_sim.UiMain

This routine can be used to get the command panel, everywhere from V_Sim.

classmethod getDefaultRendering()
Returns:

the rendering window.

Return type:

v_sim.UiRenderingWindow

Get the rendering window of V_Sim.

classmethod getRememberPosition()
Returns:

True if set.

Return type:

bool

V_Sim can store the position of its main windows. Use this routine to get the status of this capability.

classmethod initPanels(data)
Parameters:

data (object or None) – a pointer on a v_sim.UiMain object.

Returns:

always False.

Return type:

bool

Call the init routines for the different panels.

classmethod new(oneWindow)
Parameters:

oneWindow (bool) – a boolean.

Returns:

a newly create command panel.

Return type:

Gtk.Widget

Create the command panel window and is dependencies, such as the associated rendering window… WARNING: some part are still currently static, so only once instance can be created at a time. If oneWindow argument is True, then the rendering area is creating in the same Gtk.Window on the right of the panel.

classmethod runCommandLine(data)
Parameters:

data (object or None) – a pointer on a v_sim.UiMain object.

Returns:

always False.

Return type:

bool

Call the get routines from the command line module and associate the different tasks to the different panels. For a version that do not use the panels, call v_sim.ui_runCommandLine() instead.

classmethod setRememberPosition(val)
Parameters:

val (bool) – an boolean.

V_Sim can try to remember the position of its main windows, then open them again will result in a positioning on screen equivalent to previous position.

buildInteractiveDialog()

Create the mouse action dialog window (if not already done).

class_setCurrentPanel()

After having created the command panel with v_sim.UiMain.new(), use this routine to declare it as the current command panel.

getLastOpenDirectory()
Returns:

a string owned by V_Sim.

Return type:

str

V_Sim stores the last open directory to set the file chooser to this one the next time it will come. Use v_sim.UiMain.setLastOpenDirectory() to store it after a Gtk.ResponseType.OK has been returned by a file chooser and then initialise each new with this routine.

getRendering()
Returns:

the v_sim.UiRenderingWindow controled by this self panel.

Return type:

v_sim.UiRenderingWindow

Retrieve the rendering window controlled by self.

New in version 3.8.

getSelectedDirectory(parent, multiple, dir)
Parameters:
  • parent (Gtk.Window or None) – if None, the command panel window is used ;

  • multiple (bool) – if True, multiple directories can be selected ;

  • dir (str or None) – if not None, give the opening directory.

Returns:

a newly allocated array of paths, None terminated. Use GLib.strfreev() to free it after use. If no directory is selected, then None is returned.

Return type:

[str]

General procedure to get the location of one or more directories. In the multiple case, all selected directories shares a common ancestor since the selection is done through the same selector that for single directory but with multiple selection activated. If dir is None the last opened (and stored) directory is used (see v_sim.UiMain.getLastOpenDirectory() and v_sim.UiMain.setLastOpenDirectory()).

quit(force)
Parameters:

force (bool) – if True, override the preference of a quiting dialog and quit.

Quit the program. If the preference to have a confirm dialog is set, then it raises the little warning window before quiting (or not).

setLastOpenDirectory(directory, type)
Parameters:
  • directory (str) – a full path to a directory ;

  • type (v_sim.UiDirectoryType) – the kind of directory to set the remember flag on.

V_Sim stores the last open directory to set the file chooser to this one the next time it will come. Use this routine each time a file chooser returns Gtk.ResponseType.OK. The given string will be copied and can be freed after use.

Signal Details

v_sim.UiMain.signals.DataFocused(ui_main, dataObj)
Signal Name:

DataFocused

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:

This signal is emitted when dataObj has been displayed on the rendering window and is ready for use.

New in version 3.7.

v_sim.UiMain.signals.DirectoryChanged(ui_main, kind)
Signal Name:

DirectoryChanged

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:
  • ui_main (v_sim.UiMain) – The object which received the signal

  • kind (int) – a flag.

The current directory has been changed. The kind of directory is defined by kind (see #).

New in version 3.6.