Documentation ¶
Index ¶
- type Ele
- func (el *Ele) AcceptsKeyboadFocus() bool
- func (el *Ele) Destroy()
- func (el *Ele) EnableGeometryAutoSize(enable bool)
- func (el *Ele) Focus(force bool)
- func (el *Ele) GetClass() string
- func (el *Ele) GetCursor() string
- func (el *Ele) GetCursorPos() []int
- func (el *Ele) GetCursorXPos() int
- func (el *Ele) GetCursorYPos() int
- func (el *Ele) GetHeight() int
- func (el *Ele) GetOSHandle() int64
- func (el *Ele) GetScreenHeight() int
- func (el *Ele) GetScreenWidth() int
- func (el *Ele) GetStyle() string
- func (el *Ele) GetWidth() int
- func (el *Ele) GetXPos(relativeToParent bool) int
- func (el *Ele) GetYPos(relativeToParent bool) int
- func (el *Ele) Lower(e element.Element)
- func (el *Ele) Raise(e element.Element)
- func (el *Ele) SetCursor(cursor string)
- func (el *Ele) SetGridColumnWeight(column, weight int)
- func (el *Ele) SetGridRowWeight(row, weight int)
- func (el *Ele) SetKeyboadFocus(focus bool)
- func (el *Ele) Update()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ele ¶
Ele provides a base implementation of an ui element.
func (*Ele) AcceptsKeyboadFocus ¶
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 ¶
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) GetCursor ¶
GetCursor gets the cursor of the ui element. See [option.cursor] for cursor names.
func (*Ele) GetCursorPos ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
GetScreenHeight gets the height of the screen this ui element is on.
func (*Ele) GetScreenWidth ¶
GetScreenWidth gets the width of the screen this ui element is on.
func (*Ele) GetWidth ¶
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 ¶
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 ¶
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 ¶
Lower lowers a ui element below another if specified or below all of its siblings in the stacking order
func (*Ele) Raise ¶
Raise raises a ui element above another if specified or above all of its siblings in the stacking order.
func (*Ele) SetCursor ¶
SetCursor sets the cursor of the ui element. See [option.cursor] for cursor names.
func (*Ele) SetGridColumnWeight ¶
SetGridColumnWeight is used by the grid geometry manager to configure column weights.
func (*Ele) SetGridRowWeight ¶
SetGridRowWeight is used by the grid geometry manager to configure row weights.
func (*Ele) SetKeyboadFocus ¶
SetKeyboadFocus sets that this ui element accepts the focus during keyboard traversal.