pydui.widgets package¶
Submodules¶
pydui.widgets.edit module¶
- class pydui.widgets.edit.PyDuiEdit¶
Bases:
PyDuiPGView
- static build_name() str ¶
- property editable: bool¶
- get_font() str ¶
- get_fontsize() int ¶
- get_signals() List[str] ¶
- layout(x: float, y: float, width: float, height: float, constraint: PyDuiLayoutConstraint)¶
- on_post_init()¶
- parse_attrib(k: str, v: str)¶
Parse single attribute
- Parameters:
attrib (Dict[str, str]) – attributes dict key=value …
- set_font(font: str)¶
- set_fontsize(fontsize: int)¶
- property text: str¶
pydui.widgets.icon module¶
- class pydui.widgets.icon.PyDuiIcon¶
Bases:
PyDuiLabel
- static build_name() str ¶
- parse_attrib(k: str, v: str)¶
Parse single attribute
- Parameters:
attrib (Dict[str, str]) – attributes dict key=value …
pydui.widgets.label module¶
- class pydui.widgets.label.PyDuiLabel¶
Bases:
PyDuiPGView
Label widget
- font¶
font family name
- Type:
str
- fontsize¶
fontsize in pt unit
- Type:
int
- fontcolor¶
font color
- Type:
Gdk.RGBA
- ellipsis¶
ellipsis mode, [NONE, START, MIDDLE, END], default is END
- Type:
str
- wrap¶
wrap mode, [NONE, WORD, CHAR, WORD_CHAR], default is WORD
- Type:
str
- halign¶
horizontal TextAlign, [CENTER, STAET, END], default is CENTER
- Type:
str
- valign¶
vertical TextAlign, [CENTER, STAET, END], default is CENTER
- Type:
str
- line_spacing¶
line spacing
- Type:
float
- autofit¶
text is autofit or not
- Type:
bool
- autofit_padding¶
when autofit is set, autofit area padding
- Type:
Rect
- text_padding¶
text padding
- Type:
Rect
- static build_name() str ¶
- estimate_size(parent_width: float, parent_height: float, constraint: PyDuiLayoutConstraint) Tuple[float, float] ¶
- parse_attrib(k: str, v: str)¶
Parse single attribute
- Parameters:
attrib (Dict[str, str]) – attributes dict key=value …
- property text: str¶
pydui.widgets.listview module¶
- class pydui.widgets.listview.PyDuiListNode¶
Bases:
object
- class pydui.widgets.listview.PyDuiListView¶
Bases:
PyDuiLayoutWithPogaSupport
- add_child(child: PyDuiWidget)¶
Add child widget.
if child has been added, ignore.
- Parameters:
child (PyDuiWidget) – child widget
- add_child_at(child: PyDuiWidget, index: int)¶
Add child widget at index
if the index overbound, it will add widget to last position.
- Parameters:
child (PyDuiWidget) – child widget
index (int) – target index
- Returns:
return widget object.
- Return type:
- static build_name() str ¶
- reload()¶
- remove_child(child: PyDuiWidget)¶
Remove child widget.
- Parameters:
widget (PyDuiWidget) – widget object
- remove_child_at(index: int)¶
Remove child widget at index
if the index overbound, do nothing.
- Parameters:
index (int) – widget index
- remove_child_by_id(widget_id: str)¶
Remove child widget by widget_id
- Parameters:
widget_id (str) – widget id
- set_datasource(datasource: PyDuiListViewDataSource)¶
- class pydui.widgets.listview.PyDuiListViewDataSource(*args, **kwargs)¶
Bases:
Protocol
- abstract item_count() int ¶
- abstract item_node(index: int) PyDuiListNode ¶
- class pydui.widgets.listview.PyDuiListViewDelegate(*args, **kwargs)¶
Bases:
Protocol
- abstract create_item_by_node(index: int, node: PyDuiListNode) PyDuiWidget ¶
- abstract item_height(index: int) float ¶
pydui.widgets.pgview module¶
- class pydui.widgets.pgview.PyDuiPGView¶
Bases:
PyDuiWidget
,PogaView
- bounds_size() Tuple[float, float] ¶
Return the layout bounds size.
- Returns:
bounds size, mainly equal the frame size.
- Return type:
Tuple[float, float]
- static build_name() str ¶
- frame_origin() Tuple[float, float] ¶
Return frame position.
- Returns:
Return frame (x, y) position.
- Return type:
Tuple[float, float]
- is_container() bool ¶
Return current view is container or not.
- Returns:
Return True is container.
- Return type:
bool
- parse_attrib(k: str, v: str)¶
Parse single attribute
- Parameters:
attrib (Dict[str, str]) – attributes dict key=value …
- poga_layout() PogaLayout ¶
Return PogaLayout
- Returns:
PogaLayout object
- Return type:
PogaLayout
- set_frame_position_and_size(x: float, y: float, width: float, height: float)¶
Set the frame position and size.
- Parameters:
x (float) – Frame x position
y (float) – Frame y position
width (float) – Frame width
height (float) – Frame height
- size_that_fits(width: float, height: float) Tuple[float, float] ¶
Calculate the frame size.
- Parameters:
width (float) – Parent layout width.
height (float) – Parent layout height.
- Returns:
Return frame size (width, height).
- Return type:
Tuple[float, float]
- subviews() List[PogaView] ¶
Return subviews, subview type must be PogaView.
- Returns:
subviews
- Return type:
Iterable[PogaView]
- subviews_count() int ¶
Return subviews count.
- Returns:
subviews count
- Return type:
int
pydui.widgets.picture module¶
- class pydui.widgets.picture.PyDuiPicture¶
Bases:
PyDuiLabel
- static build_name() str ¶
- parse_attrib(k: str, v: str)¶
Parse single attribute
- Parameters:
attrib (Dict[str, str]) – attributes dict key=value …
pydui.widgets.scrollbar module¶
- class pydui.widgets.scrollbar.PyDuiScrollbar¶
Bases:
PyDuiLayout
- static build_name() str ¶
- get_signals() List[str] ¶
- layout(x: float, y: float, width: float, height: float, constraint: PyDuiLayoutConstraint)¶
- Parameters:
x (float) – x offset relative to parent
y (float) – y offset relative to parent
width (float) – widget width
height (float) – widget height
constraint (PyDuiLayoutConstraint) – layout constraint
- on_post_init()¶
- parse_attrib(k: str, v: str)¶
Parse single attribute
- Parameters:
attrib (Dict[str, str]) – attributes dict key=value …
- property scroll_position: float¶
- set_scrollbar_type(type: PyDuiScrollbarType)¶
- update_scroller(size: float)¶
Module contents¶
Widget Module