This document is for OpenStructure version 1.1, the latest version is 2.7 !

Scene Window

The scene win holds a list of all graphical objects currently registered to the gfx.Scene.


Every node of the graphical scene tree is shown as a subnode of the scene. It is possible to select one or more objects in the scenewin (ctrl + <left mouse> ). The available actions of the context menu are applied to all currently selected objects.

class ost.gui.SceneWin

Returns the ContextMenu-instance.

Return type:ContextMenu

Get the SIP-QObject (QWidget), learn more about Mixing PyQt and C++ Widgets.

Return type:PyQt4.QWidget

Hide the Widget


Shows the Widget

Context Menu

The Context Menu of the Scene Window is context sensitive. So, dependent on what is selected in the SceneWin the context menu changes.

Context menu of an entity
Context menu of an entity view

It is possible to extend the Context Menu from python, by creating a QAction and add it to the ContextMenu-Class. If you want to display the action only for certain objects / states, you can pass flags which marks when the action should be shown.

action = QtGui.QAction("Test single entity", cm.qobject)
cm.AddAction(action, gui.ContextActionType.ENTITY | gui.ContextActionType.SINGLE)
class ost.gui.ContextMenu

The ContextMenu is shown whenever the user presses <right click> on the SceneWin

AddAction(action, flags)

Adds the given action to the context menu of the scene window.

  • action (QtCore.QAction) – The Action which should be displayed in the context menu
  • flags (ContextActionTypes) – Flags that indicates, when the context_menu should be active. The action will be shown, when all flags are true.

Get the SIP-QObject (QObject), learn more about Mixing PyQt and C++ Widgets.

Return type:PyQt4.QObject

It is possible to specify flags for new ContextMenu actions of the SceneWin These flags are used, to specify when the action should be shown on the scene window. The actions can be combined by oring them (|). When flags are combined with an or, the resulting object is a ContextActionTypes-object. The following flags are defined by default:


    All selected objects are not the root node


    All selected objects are gfx.GfxObj


    All selected objects are gfx.Entity

  • MAP

    All selected objects are gfx.MapIso


    All selected objects are parts of the same Entity (either Queries or Views)


    All selected objects are named views (created by the user)


    All selected objects are visible (can not be combined with the ENTITY_VIEW flag)


    All selected objects are hidden (can not be combined with the ENTITY_VIEW flag)


    There is only one selected object in the SceneWin


    There are multiple objects selected object in the SceneWin


When multiple ContextActionType objects are being combined with an or (|) you will get an ContextActionTypes-Object.

ctx_act_types = gui.ContextActionType.ENTITY | gui.ContextActionType.SINGLE


Enter search terms or a module, class or function name.


Documentation is available for the following OpenStructure versions:

dev / 2.7 / 2.6 / 2.5 / 2.4 / 2.3.1 / 2.3 / 2.2 / 2.1 / 2.0 / 1.9 / 1.8 / 1.7.1 / 1.7 / 1.6 / 1.5 / 1.4 / 1.3 / 1.2 / 1.11 / 1.10 / (Currently viewing 1.1)

This documentation is still under heavy development!
If something is missing or if you need the C++ API description in doxygen style, check our old documentation for further information.