2 @package libtextworker.interface.base
3 @brief The base of all GUIs in libtextworker
11 from enum
import Flag, auto
12 from typing
import Callable, Literal
32 The base class for libtextworker GUI widgets.
34 Use these variables before starting your work:
35 * Parent_ArgName: parent widget keyword in __init__'s kwds
36 * Styles: Widget styles, if able to use
37 * _Frame: Not all widgets require this. GUI toolkit's Frame widget.
38 If used, the actual widget will be placed into a frame.
39 __init__ function will return the (modified) args + kwds.
42 Parent_ArgName: Literal[
"master",
"parent",
"Parent",
"Master"] | str
44 Frame: object |
None =
None
45 _Frame: Callable |
None =
None
49 Usually this is called in WidgetBase-derived classes in order to modify
50 their args and kwds. The widget also will be placed into a frame if
52 If not specified, do nothing.
57 if "w_styles" in kwds:
58 this.Styles = kwds[
"w_styles"]
64 if not this.Parent_ArgName
in kwds:
66 target_parent = temp[0]
70 target_parent = kwds[this.Parent_ArgName]
71 kwds.pop(this.Parent_ArgName)
73 this.Frame = this._Frame(**{this.Parent_ArgName: target_parent})
def __init__(this, *args, **kwds)