GLXCurses.Window module

class GLXCurses.Window.Window(window_type='TOPLEVEL')[source]

Bases: GLXCurses.Bin.Bin

Creates a new Window, which is a toplevel window that can contain other widgets.

Nearly always, the type of the window should be GLXC.WINDOW_TOPLEVEL.

If you’re implementing something like a popup menu from scratch (which is a bad idea, just use Menu), you might use GLXC.WINDOW_POPUP. GLXC.WINDOW_POPUP is not for dialogs, though in some other toolkits dialogs are called “popups”.

If you simply want an undecorated window (no window borders), use decorated property, don’t use GLXC.WINDOW_POPUP.

Parameters:window_type (str) – type of window contain on GLXC.WindowType list
Returns:a new Window.
Return type:Window
Raises:TypeError – if window_type is not in valid GLXC.WindowType list
accept_focus

Whether the window should receive the input focus.

Default value: TRUE

Returns:the accept_focus property value
Return type:bool
Raises:TypeError – When accept_focus is not a bool type
application

The Application associated with the window.

The application will be kept alive for at least as long as it has any windows associated with it (see application_hold() for a way to keep it alive without windows).

Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the :application property to NULL.

Returns:The Application associated with the window or None
Return type:GLXCurses.Application.Application or None
Raises:TypeError – When application property value is not a GLXCurses.Application instance
attached_to

The widget to which this window is attached. See GLXCurses.Window().set_attached_to().

Examples of places where specifying this relation is useful are for instance a Menu created by a ComboBox, a completion popup window created by Entry or a typeahead search entry created by TreeView.

Returns:The attached_to property value
Return type:GLXCurses.Widget or None
decorated

Whether the window should be decorated by the window manager.

Default is True :return: the decorated property value :rtype: bool

default_height

The default height of the window, used when initially showing the window.

Returns:the default_height property value
Return type:int
default_width

The default width of the window, used when initially showing the window.

Returns:the default_width property value
Return type:int
deletable

Whether the window frame should have a close button.

Returns:The deletable property value
Return type:bool
destroy_with_parent

Get the destroy_with_parent property value

Returns:True if the window will be destroyed when the parent is destroyed.
Return type:bool
focus_on_map

Whether the window should receive the input focus when mapped.

Returns:the focus_on_map property value
Return type:bool
focus_visible

Whether ‘focus rectangles’ are currently visible in this window.

Returns:The focus_visible property value
Return type:bool
gravity

Window gravity defines the meaning of coordinates passed to Window.move().

See Window.move() for more details.

The default window gravity is GLXC.GRAVITY_NORTH_WEST which will typically “do what you mean.”

Returns:window gravity
Return type:str
has_resize_grip

Whether the window has a corner resize grip.

Note that the resize grip is only shown if the window is actually resizable and not maximized.

Use “resize-grip-visible” to find out if the resize grip is currently shown.

Returns:The has_resize_grip property value
Return type:bool
has_toplevel_focus

Whether the input focus is within this Window.

Returns:The has_toplevel_focus property value
Return type:bool
hide_titlebar_when_maximized

Whether the titlebar should be hidden during maximization.

Returns:The hide_titlebar_when_maximized property value
Return type:bool
icon

Icon for this window.

Returns:The icon property value
Return type:curses Extended Characters
icon_name

The icon_name property specifies the name of the themed icon to use as the window icon.

See IconTheme for more details.

Returns:The icon_name property value
Return type:str or None
is_active

Whether the toplevel is the current active window.

Returns:The is_active property value
Return type:bool
is_maximized

Whether the window is maximized.

Returns:The is_maximized property value
Return type:bool
mnemonics_visible

Whether mnemonics are currently visible in this window.

This property is maintained by GLXCurses based on user input, and should not be set by applications.

Returns:The mnemonics_visible property value
Return type:bool
modal

If True`, the window is modal (other windows are not usable while this one is up).

Returns:The modal property value
Return type:bool
resizable

Gets the value set to resizable property.

Returns:True if the user can resize the window
Return type:bool
role

Unique identifier for the window to be used when restoring a session.

Returns:A unique identifier
Return type:str or None
screen

The screen where this window will be displayed.

Returns:The screen where this window will be displayed
Return type:GLXCurses.Screen or None
skip_pager_hint

True if the window should not be in the pager.

Returns:The skip_pager_hint property value
Return type:bool
skip_taskbar_hint

True if the window should not be in the task bar.

Returns:The skip_taskbar_hint property value
Return type:bool
startup_id

The startup_id was originally write-only property for setting window’s startup notification identifier.

See Window.set_startup_id() for more details.

Returns:A identifier or None
Return type:str or None
title

The title of the window.

Default value: None

Returns:the title property value
Return type:str or None
transient_for

Fetches the transient parent for this GLXCurses.Window.

See transient_for.setter for more details about transient windows.

Returns:the transient parent for this GLXCurses.Window, or None if no transient parent has been set.
Return type:GLXCurses.Window or None
type

Return the type property

Returns:GLXC.WindowType
Return type:str
type_hint

Hint to help the desktop environment understand what kind of window this is and how to treat it.

These are hints for the window manager that indicate what type of function the window has.

The window manager can use this when determining decoration and behaviour of the window.

The hint must be set before mapping the window.

Returns:hint for the window manager
Return type:str
urgency_hint

True if the window should be brought to the user’s attention.

Returns:tthe urgency_hint property value
Return type:boot
position

The initial position of the window.

Returns:position constraint
Return type:str
decoration_button_layout

Decorated button layout property

Returns:a layout
Return type:str
decoration_resize_handle

The decoration_resize_handle property

Returns:Decoration resize handle size.
Return type:int
color
draw_widget_in_area()[source]

Be here for be overwrite by every widget

static add_accel_group()[source]

Not implemented

Raises:NotImplementedError – because AccelGroup is not implemented
static remove_accel_group()[source]

Not implemented

Raises:NotImplementedError – because AccelGroup is not implemented
activate_focus()[source]

Activates the current focused widget within the window.

Returns:True if a widget got activated.
Return type:bool
activate_default()[source]

Activates the default widget for the window, unless the current focused widget has been configured to receive the default action (see gtk_widget_set_receives_default()), in which case the focused widget is activated.

Returns:
get_focus()[source]

The get_focus() method returns the current focused widget within the window.

The focus widget is the widget that would have the focus if the toplevel window is focused.

Returns:The current focused GLXCurses.Widget
Return type:GLXCurses.Widget or None
set_default(default_widget=None)[source]

The default widget is the widget that’s activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a Window. When setting (rather than unsetting) the default widget it’s generally easier to call Widget.grab_default() on the widget. Before making a widget the default widget, you must call Widget.set_can_default() on the widget you’d like to make the default.

Parameters:default_widget (GLXCurses.Window) – a GLXCurses.Window or None of unset
Raises:TypeError – if default_widget is not a GLXCurses.Widget instance .
get_default_widget()[source]

Returns the default widget for window . GLXCurses.Window().set_default() for more details.

Returns:the default GLXCurses.Widget, or None if there is none.
Return type:GLXCurses.Widget or None
get_window_type()[source]

Gets the type of the window.

Constants.GLXC.WindowType are GLXC.WINDOW_TOPLEVEL and GLXC.WINDOW_POPUP

Returns:the type of the window
Return type:GLXC.WINDOW_TOPLEVEL or GLXC.WINDOW_POPUP
update_preferred_sizes()[source]