TermTk.TTkCore.constant

TTkConstant

class TTkConstant[source]

Class container of all the constants used in TermTk

class AcceptMode[source]

AcceptOpen

Open

AcceptSave

Save

AcceptOpen = 0

Open

AcceptSave = 1

Save

class Alignment[source]

This type is used to describe alignment.

NONE

No Alignment

LEFT_ALIGN

Aligns with the left edge.

RIGHT_ALIGN

Aligns with the right edge.

CENTER_ALIGN

Centers horizontally in the available space.

JUSTIFY

Justifies the text in the available space.

CENTER_ALIGN = 4

Centers horizontally in the available space.

JUSTIFY = 8

Justifies the text in the available space.

LEFT_ALIGN = 1

Aligns with the left edge.

NONE = 0

No Alignment

RIGHT_ALIGN = 2

Aligns with the right edge.

class CheckState[source]

This class type is used to describe the check status.

Unchecked

The item is unchecked.

PartiallyChecked

The item is partially checked.

Checked

The item is checked.

Checked = 2

The item is checked.

PartiallyChecked = 1

The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked.

Unchecked = 0

The item is unchecked.

class ChildIndicatorPolicy[source]
class ColorType[source]
class Direction[source]

This class type is used to describe the direction

HORIZONTAL

Horizontal direction

VERTICAL

Vertical direction

HORIZONTAL = 3

Horizontal direction

VERTICAL = 12

Vertical direction

class DragDropMode[source]

Specifies the Drag and Drop mode allowed by this widget

NoDragDrop

No Drag and Drop is allowed

AllowDrag

Drag allowed

AllowDrop

Drop allowed

AllowDragDrop

Drag and Drop allowed

AllowDrag = 1

Drag allowed

AllowDragDrop = 3

Drag and Drop allowed

AllowDrop = 2

Drop allowed

NoDragDrop = 0

No Drag and Drop is allowed

class FileMode[source]

AnyFile

The name of a file, whether it exists or not.

ExistingFile

The name of a single existing file.

Directory

The name of a directory.

AnyFile = 0

The name of a file, whether it exists or not.

Directory = 2

The name of a directory. Both files and directories are displayed. However, the native Windows file dialog does not support displaying files in the directory chooser.

ExistingFile = 1

The name of a single existing file.

class InsertPolicy[source]

Specifies what the TTkComboBox should do when a new string is entered by the user.

NoInsert

The string will not be inserted into the combobox.

InsertAtTop

The string will be inserted as the first item in the combobox.

InsertAtBottom

The string will be inserted after the last item in the combobox.

InsertAtBottom = 3

The string will be inserted after the last item in the combobox.

InsertAtTop = 1

The string will be inserted as the first item in the combobox.

NoInsert = 0

The string will not be inserted into the combobox.

class ItemFlag[source]

ItemFlag describes the properties of an item

NoItemFlags

It does not have any properties set.

ItemIsSelectable

It can be selected.

ItemIsEditable

It can be edited.

ItemIsEnabled

The user can interact with the item.

ItemIsEditable = 2

It can be edited.

ItemIsEnabled = 32

The user can interact with the item.

ItemIsSelectable = 1

It can be selected.

NoItemFlags = 0

It does not have any properties set.

class KeyModifier[source]

Input SpecialKey modifiers

Modifier reported by TTkKeyEvent -> mod

NoModifier

No modifier key is pressed.

ShiftModifier

A Shift key on the keyboard is pressed.

ControlModifier

A Ctrl key on the keyboard is pressed.

AltModifier

An Alt key on the keyboard is pressed.

MetaModifier

A Meta key on the keyboard is pressed.

KeypadModifier

A keypad button is pressed.

GroupSwitchModifier

X11 only (unless activated on Windows by a command line argument).

SHIFT

The Shift keys provided on all standard keyboards.

META

The Meta keys.

CTRL

The Ctrl keys.

ALT

The normal Alt keys, but not keys like AltGr.

ALT = 134217728

The normal Alt keys, but not keys like AltGr.

AltModifier = 134217728

An Alt key on the keyboard is pressed.

CTRL = 67108864

The Ctrl keys.

ControlModifier = 67108864

A Ctrl key on the keyboard is pressed.

GroupSwitchModifier = 1073741824

X11 only (unless activated on Windows by a command line argument). A Mode_switch key on the keyboard is pressed.

KeypadModifier = 536870912

A keypad button is pressed.

META = 268435456

The Meta keys.

MetaModifier = 268435456

A Meta key on the keyboard is pressed.

NoModifier = 0

No modifier key is pressed.

SHIFT = 33554432

The Shift keys provided on all standard keyboards.

ShiftModifier = 33554432

A Shift key on the keyboard is pressed.

class KeyType[source]

Input Key Types

Key type reported by TTkKeyEvent -> key

Character

Input Char Key

SpecialKey

Input Special Key

Character = 1

Input Char Key

SpecialKey = 2

Input Special Key

class LayoutItemTypes[source]

Types used internally in TTkLayouts

LayoutItem

Item Type Layout

WidgetItem

Item Type Widget

LayoutItem = 1

Item Type Layout

WidgetItem = 2

Item Type Widget

class LineWrapMode[source]

Those constants describes which wrapping status is required in the document

FixedWidth = 3

Wrapping around a fixed width

NoWrap = 0

No Wrapping is applied

WidgetWidth = 1

Wrapping around the Widget width

class MouseEvent[source]

Input Mouse Event

Events reported by TTkMouseEvent -> evt

NoEvent

Press

Release

Drag

Move

WHEEL_Up

WHEEL_Down

class MouseKey[source]

Input Mouse Key

Events reported by TTkMouseEvent -> key

NoButton

The button state does not refer to any button.

AllButtons

This value corresponds to a mask of all possible mouse buttons.

LeftButton

The left button is pressed, or an event refers to the left button.

RightButton

The right button.

MidButton

The middle button.

MiddleButton

The middle button.

Wheel

The wheel control

AllButtons = 134217727

This value corresponds to a mask of all possible mouse buttons. Use to set the ‘acceptedButtons’ property of a MouseArea to accept ALL mouse buttons.

LeftButton = 1

The left button is pressed, or an event refers to the left button. (The left button may be the right button on left-handed mice.)

MidButton = 4

The middle button.

MiddleButton = 4

The middle button.

NoButton = 0

The button state does not refer to any button.

RightButton = 2

The right button.

Wheel = 8

The wheel control

class ScrollBarPolicy[source]
class ShortcutContext[source]

For a TTkShortcut event to occur, the shortcut’s key sequence must be entered by the user in a context where the shortcut is active. The possible contexts are these:

WidgetShortcut

The shortcut is active when its parent widget has focus.

WidgetWithChildrenShortcut

The shortcut is active when its parent widget, or any of its children has focus.

WindowShortcut

The shortcut is active when its parent widget is a logical subwidget of the active top-level window.

ApplicationShortcut

The shortcut is active when one of the applications windows are active.

ApplicationShortcut = 2

The shortcut is active when one of the applications windows are active.

WidgetShortcut = 0

The shortcut is active when its parent widget has focus.

WidgetWithChildrenShortcut = 3

The shortcut is active when its parent widget, or any of its children has focus. Children which are top-level widgets, except pop-ups, are not affected by this shortcut context.

WindowShortcut = 1

The shortcut is active when its parent widget is a logical subwidget of the active top-level window.

class SortOrder[source]

This enum describes how the items in a widget are sorted.

AscendingOrder

The items are sorted ascending e.g.

DescendingOrder

The items are sorted descending e.g.

AscendingOrder = 0

The items are sorted ascending e.g. starts with ‘AAA’ ends with ‘ZZZ’ in Latin-1 locales

DescendingOrder = 1

The items are sorted descending e.g. starts with ‘ZZZ’ ends with ‘AAA’ in Latin-1 locales

class TTkItemSelectionModel[source]

These values describes the way the selection model will be updated.

NoUpdate

No selection will be made.

Clear

The complete selection will be cleared.

Select

All specified indexes will be selected.

Deselect

All specified indexes will be deselected.

Toggle

All specified indexes will be selected or deselected depending on their current state.

Current

The current selection will be updated.

Rows

All indexes will be expanded to span rows.

Columns

All indexes will be expanded to span columns.

SelectCurrent

A combination of Select and Current, provided for convenience.

ToggleCurrent

A combination of Toggle and Current, provided for convenience.

ClearAndSelect

A combination of Clear and Select, provided for convenience.

Clear = 1

The complete selection will be cleared.

ClearAndSelect = 3

A combination of Clear and Select, provided for convenience.

Columns = 64

All indexes will be expanded to span columns.

Current = 16

The current selection will be updated.

Deselect = 4

All specified indexes will be deselected.

NoUpdate = 0

No selection will be made.

Rows = 32

All indexes will be expanded to span rows.

Select = 2

All specified indexes will be selected.

SelectCurrent = 18

A combination of Select and Current, provided for convenience.

Toggle = 8

All specified indexes will be selected or deselected depending on their current state.

ToggleCurrent = 24

A combination of Toggle and Current, provided for convenience.

class WindowFlag[source]

Those flags are used to enable customization of the window controls.

WindowReduceButtonHint

Adds a reduce button.

WindowMinimizeButtonHint

Adds a minimize button.

WindowMaximizeButtonHint

Adds a maximize button.

WindowMinMaxButtonsHint

Adds a minimize and a maximize button.

WindowCloseButtonHint

Adds a close button.

WindowCloseButtonHint = 134217728

Adds a close button.

WindowMaximizeButtonHint = 32768

Adds a maximize button.

WindowMinMaxButtonsHint = 49152

Adds a minimize and a maximize button.

WindowMinimizeButtonHint = 16384

Adds a minimize button.

WindowReduceButtonHint = 512

Adds a reduce button.

class WrapMode[source]

Those constants describes how text is wrapped in a document.

WordWrap

Text is wrapped at word boundaries.

WrapAnywhere

Text can be wrapped at any point on a line, even if it occurs in the middle of a word.

WrapAtWordBoundaryOrAnywhere

If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.

WordWrap = 1

Text is wrapped at word boundaries.

WrapAnywhere = 3

Text can be wrapped at any point on a line, even if it occurs in the middle of a word.

WrapAtWordBoundaryOrAnywhere = 4

If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.

TTkK

class TTkK[source]
class AcceptMode

AcceptOpen

Open

AcceptSave

Save

AcceptOpen = 0

Open

AcceptSave = 1

Save

class Alignment

This type is used to describe alignment.

NONE

No Alignment

LEFT_ALIGN

Aligns with the left edge.

RIGHT_ALIGN

Aligns with the right edge.

CENTER_ALIGN

Centers horizontally in the available space.

JUSTIFY

Justifies the text in the available space.

CENTER_ALIGN = 4

Centers horizontally in the available space.

JUSTIFY = 8

Justifies the text in the available space.

LEFT_ALIGN = 1

Aligns with the left edge.

NONE = 0

No Alignment

RIGHT_ALIGN = 2

Aligns with the right edge.

class CheckState

This class type is used to describe the check status.

Unchecked

The item is unchecked.

PartiallyChecked

The item is partially checked.

Checked

The item is checked.

Checked = 2

The item is checked.

PartiallyChecked = 1

The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked.

Unchecked = 0

The item is unchecked.

class ChildIndicatorPolicy
class ColorType
class Direction

This class type is used to describe the direction

HORIZONTAL

Horizontal direction

VERTICAL

Vertical direction

HORIZONTAL = 3

Horizontal direction

VERTICAL = 12

Vertical direction

class DragDropMode

Specifies the Drag and Drop mode allowed by this widget

NoDragDrop

No Drag and Drop is allowed

AllowDrag

Drag allowed

AllowDrop

Drop allowed

AllowDragDrop

Drag and Drop allowed

AllowDrag = 1

Drag allowed

AllowDragDrop = 3

Drag and Drop allowed

AllowDrop = 2

Drop allowed

NoDragDrop = 0

No Drag and Drop is allowed

class FileMode

AnyFile

The name of a file, whether it exists or not.

ExistingFile

The name of a single existing file.

Directory

The name of a directory.

AnyFile = 0

The name of a file, whether it exists or not.

Directory = 2

The name of a directory. Both files and directories are displayed. However, the native Windows file dialog does not support displaying files in the directory chooser.

ExistingFile = 1

The name of a single existing file.

class InsertPolicy

Specifies what the TTkComboBox should do when a new string is entered by the user.

NoInsert

The string will not be inserted into the combobox.

InsertAtTop

The string will be inserted as the first item in the combobox.

InsertAtBottom

The string will be inserted after the last item in the combobox.

InsertAtBottom = 3

The string will be inserted after the last item in the combobox.

InsertAtTop = 1

The string will be inserted as the first item in the combobox.

NoInsert = 0

The string will not be inserted into the combobox.

class ItemFlag

ItemFlag describes the properties of an item

NoItemFlags

It does not have any properties set.

ItemIsSelectable

It can be selected.

ItemIsEditable

It can be edited.

ItemIsEnabled

The user can interact with the item.

ItemIsEditable = 2

It can be edited.

ItemIsEnabled = 32

The user can interact with the item.

ItemIsSelectable = 1

It can be selected.

NoItemFlags = 0

It does not have any properties set.

class KeyModifier

Input SpecialKey modifiers

Modifier reported by TTkKeyEvent -> mod

NoModifier

No modifier key is pressed.

ShiftModifier

A Shift key on the keyboard is pressed.

ControlModifier

A Ctrl key on the keyboard is pressed.

AltModifier

An Alt key on the keyboard is pressed.

MetaModifier

A Meta key on the keyboard is pressed.

KeypadModifier

A keypad button is pressed.

GroupSwitchModifier

X11 only (unless activated on Windows by a command line argument).

SHIFT

The Shift keys provided on all standard keyboards.

META

The Meta keys.

CTRL

The Ctrl keys.

ALT

The normal Alt keys, but not keys like AltGr.

ALT = 134217728

The normal Alt keys, but not keys like AltGr.

AltModifier = 134217728

An Alt key on the keyboard is pressed.

CTRL = 67108864

The Ctrl keys.

ControlModifier = 67108864

A Ctrl key on the keyboard is pressed.

GroupSwitchModifier = 1073741824

X11 only (unless activated on Windows by a command line argument). A Mode_switch key on the keyboard is pressed.

KeypadModifier = 536870912

A keypad button is pressed.

META = 268435456

The Meta keys.

MetaModifier = 268435456

A Meta key on the keyboard is pressed.

NoModifier = 0

No modifier key is pressed.

SHIFT = 33554432

The Shift keys provided on all standard keyboards.

ShiftModifier = 33554432

A Shift key on the keyboard is pressed.

class KeyType

Input Key Types

Key type reported by TTkKeyEvent -> key

Character

Input Char Key

SpecialKey

Input Special Key

Character = 1

Input Char Key

SpecialKey = 2

Input Special Key

class LayoutItemTypes

Types used internally in TTkLayouts

LayoutItem

Item Type Layout

WidgetItem

Item Type Widget

LayoutItem = 1

Item Type Layout

WidgetItem = 2

Item Type Widget

class LineWrapMode

Those constants describes which wrapping status is required in the document

FixedWidth = 3

Wrapping around a fixed width

NoWrap = 0

No Wrapping is applied

WidgetWidth = 1

Wrapping around the Widget width

class MouseEvent

Input Mouse Event

Events reported by TTkMouseEvent -> evt

NoEvent

Press

Release

Drag

Move

WHEEL_Up

WHEEL_Down

class MouseKey

Input Mouse Key

Events reported by TTkMouseEvent -> key

NoButton

The button state does not refer to any button.

AllButtons

This value corresponds to a mask of all possible mouse buttons.

LeftButton

The left button is pressed, or an event refers to the left button.

RightButton

The right button.

MidButton

The middle button.

MiddleButton

The middle button.

Wheel

The wheel control

AllButtons = 134217727

This value corresponds to a mask of all possible mouse buttons. Use to set the ‘acceptedButtons’ property of a MouseArea to accept ALL mouse buttons.

LeftButton = 1

The left button is pressed, or an event refers to the left button. (The left button may be the right button on left-handed mice.)

MidButton = 4

The middle button.

MiddleButton = 4

The middle button.

NoButton = 0

The button state does not refer to any button.

RightButton = 2

The right button.

Wheel = 8

The wheel control

class ScrollBarPolicy
class ShortcutContext

For a TTkShortcut event to occur, the shortcut’s key sequence must be entered by the user in a context where the shortcut is active. The possible contexts are these:

WidgetShortcut

The shortcut is active when its parent widget has focus.

WidgetWithChildrenShortcut

The shortcut is active when its parent widget, or any of its children has focus.

WindowShortcut

The shortcut is active when its parent widget is a logical subwidget of the active top-level window.

ApplicationShortcut

The shortcut is active when one of the applications windows are active.

ApplicationShortcut = 2

The shortcut is active when one of the applications windows are active.

WidgetShortcut = 0

The shortcut is active when its parent widget has focus.

WidgetWithChildrenShortcut = 3

The shortcut is active when its parent widget, or any of its children has focus. Children which are top-level widgets, except pop-ups, are not affected by this shortcut context.

WindowShortcut = 1

The shortcut is active when its parent widget is a logical subwidget of the active top-level window.

class SortOrder

This enum describes how the items in a widget are sorted.

AscendingOrder

The items are sorted ascending e.g.

DescendingOrder

The items are sorted descending e.g.

AscendingOrder = 0

The items are sorted ascending e.g. starts with ‘AAA’ ends with ‘ZZZ’ in Latin-1 locales

DescendingOrder = 1

The items are sorted descending e.g. starts with ‘ZZZ’ ends with ‘AAA’ in Latin-1 locales

class TTkItemSelectionModel

These values describes the way the selection model will be updated.

NoUpdate

No selection will be made.

Clear

The complete selection will be cleared.

Select

All specified indexes will be selected.

Deselect

All specified indexes will be deselected.

Toggle

All specified indexes will be selected or deselected depending on their current state.

Current

The current selection will be updated.

Rows

All indexes will be expanded to span rows.

Columns

All indexes will be expanded to span columns.

SelectCurrent

A combination of Select and Current, provided for convenience.

ToggleCurrent

A combination of Toggle and Current, provided for convenience.

ClearAndSelect

A combination of Clear and Select, provided for convenience.

Clear = 1

The complete selection will be cleared.

ClearAndSelect = 3

A combination of Clear and Select, provided for convenience.

Columns = 64

All indexes will be expanded to span columns.

Current = 16

The current selection will be updated.

Deselect = 4

All specified indexes will be deselected.

NoUpdate = 0

No selection will be made.

Rows = 32

All indexes will be expanded to span rows.

Select = 2

All specified indexes will be selected.

SelectCurrent = 18

A combination of Select and Current, provided for convenience.

Toggle = 8

All specified indexes will be selected or deselected depending on their current state.

ToggleCurrent = 24

A combination of Toggle and Current, provided for convenience.

class WindowFlag

Those flags are used to enable customization of the window controls.

WindowReduceButtonHint

Adds a reduce button.

WindowMinimizeButtonHint

Adds a minimize button.

WindowMaximizeButtonHint

Adds a maximize button.

WindowMinMaxButtonsHint

Adds a minimize and a maximize button.

WindowCloseButtonHint

Adds a close button.

WindowCloseButtonHint = 134217728

Adds a close button.

WindowMaximizeButtonHint = 32768

Adds a maximize button.

WindowMinMaxButtonsHint = 49152

Adds a minimize and a maximize button.

WindowMinimizeButtonHint = 16384

Adds a minimize button.

WindowReduceButtonHint = 512

Adds a reduce button.

class WrapMode

Those constants describes how text is wrapped in a document.

WordWrap

Text is wrapped at word boundaries.

WrapAnywhere

Text can be wrapped at any point on a line, even if it occurs in the middle of a word.

WrapAtWordBoundaryOrAnywhere

If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.

WordWrap = 1

Text is wrapped at word boundaries.

WrapAnywhere = 3

Text can be wrapped at any point on a line, even if it occurs in the middle of a word.

WrapAtWordBoundaryOrAnywhere = 4

If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.