ui

package
v0.0.0-...-b34c1d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ele

type Ele struct {
	element.Ele
}

Ele provides a base implementation of an ui element.

func (*Ele) AcceptsKeyboadFocus

func (el *Ele) AcceptsKeyboadFocus() bool

AcceptsKeyboadFocus returns true if this ui element accepts the focus during keyboard traversal.

func (*Ele) Destroy

func (el *Ele) Destroy()

Destroy removes the ui element from the UI and cleans up its resources. Once destroyed you cannot refer to this ui element again or you will get a bad path name error from the interpreter.

func (*Ele) EnableGeometryAutoSize

func (el *Ele) EnableGeometryAutoSize(enable bool)

EnableGeometryAutoSize sets if the element should change it size when requested to do so by a geometry manager.

The geometry manager normally computes how large a master must be to just exactly meet the needs of its slaves, and it sets the requested width and height of the master to these dimensions. This causes geometry information to propagate up through a window hierarchy to a top-level window so that the entire sub-tree sizes itself to fit the needs of the leaf windows. However, this command may be used to turn off propagation for one or more masters. If propagation is disabled then it will not set the requested width and height of the master window. This may be useful if, for example, you wish for a master window to have a fixed size that you specify.

func (*Ele) Focus

func (el *Ele) Focus(force bool)

Focus gives focus to the ui element.

func (*Ele) GetClass

func (el *Ele) GetClass() string

GetClass gets the ui element class. See [element.class] for class names.

func (*Ele) GetCursor

func (el *Ele) GetCursor() string

GetCursor gets the cursor of the ui element. See [option.cursor] for cursor names.

func (*Ele) GetCursorPos

func (el *Ele) GetCursorPos() []int

GetCursorPos gets the x and y position of the cursor on the ui element.

If the mouse pointer is on the same screen as the ui element, it returns a list with two integers, which are the pointer's x and y coordinates measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as ui element then both of the returned coordinates are -1.

func (*Ele) GetCursorXPos

func (el *Ele) GetCursorXPos() int

GetCursorXPos gets the x position of the cursor on the ui element.

If the mouse pointer is on the same screen as the ui element, it returns the pointer's x coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is measured in the virtual root. If the mouse pointer is not on the same screen as ui element then -1 is returned.

func (*Ele) GetCursorYPos

func (el *Ele) GetCursorYPos() int

GetCursorYPos gets the y position of the cursor on the ui element.

If the mouse pointer is on the same screen as the ui element, it returns the pointer's y coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is measured in the virtual root. If the mouse pointer is not on the same screen as ui element then -1 is returned.

func (*Ele) GetHeight

func (el *Ele) GetHeight() int

GetHeight gets the height of the ui element.

Returns an int giving a ui element height in pixels. When a ui element is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfil the window's needs.

func (*Ele) GetOSHandle

func (el *Ele) GetOSHandle() int64

GetOSHandle gets the OS specific window handle.

Returns a low-level platform-specific identifier for a window. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows HWND. On the Macintosh the value has no meaning outside Tk.

func (*Ele) GetScreenHeight

func (el *Ele) GetScreenHeight() int

GetScreenHeight gets the height of the screen this ui element is on.

func (*Ele) GetScreenWidth

func (el *Ele) GetScreenWidth() int

GetScreenWidth gets the width of the screen this ui element is on.

func (*Ele) GetStyle

func (el *Ele) GetStyle() string

GetStyle gets the ui element class. See [element.style] for style names.

func (*Ele) GetWidth

func (el *Ele) GetWidth() int

GetWidth gets the width of the ui element.

Returns an int giving a ui element width in pixels. When a ui element is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfil the window's needs.

func (*Ele) GetXPos

func (el *Ele) GetXPos(relativeToParent bool) int

GetXPos gets the x position of the ui element. You may need to wait until the ui element has been updated for this to return the correct value.

func (*Ele) GetYPos

func (el *Ele) GetYPos(relativeToParent bool) int

GetYPos gets the y position of the ui element. You may need to wait until the ui element has been updated for this to return the correct value.

func (*Ele) Lower

func (el *Ele) Lower(e element.Element)

Lower lowers a ui element below another if specified or below all of its siblings in the stacking order

func (*Ele) Raise

func (el *Ele) Raise(e element.Element)

Raise raises a ui element above another if specified or above all of its siblings in the stacking order.

func (*Ele) SetCursor

func (el *Ele) SetCursor(cursor string)

SetCursor sets the cursor of the ui element. See [option.cursor] for cursor names.

func (*Ele) SetGridColumnWeight

func (el *Ele) SetGridColumnWeight(column, weight int)

SetGridColumnWeight is used by the grid geometry manager to configure column weights.

func (*Ele) SetGridRowWeight

func (el *Ele) SetGridRowWeight(row, weight int)

SetGridRowWeight is used by the grid geometry manager to configure row weights.

func (*Ele) SetKeyboadFocus

func (el *Ele) SetKeyboadFocus(focus bool)

SetKeyboadFocus sets that this ui element accepts the focus during keyboard traversal.

func (*Ele) Update

func (el *Ele) Update()

Update causes operations that are normally deferred, such as display updates and window layout calculations, to be performed immediately.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL