GLXCurses.Frame module¶
-
class
GLXCurses.Frame.
Frame
[source]¶ Bases:
GLXCurses.Bin.Bin
Description: The frame widget is a bin that surrounds its child with a decorative frame and an optional label. If present, the label is drawn in a gap in the top side of the frame.
The position of the label can be controlled with
Frame.set_label_align()
.-
label
¶ Text of the frame’s label.
Default value: None
Returns: the label
property valueReturn type: str or None
-
label_widget
¶ A widget to display in place of the usual frame label.
Returns: A widget Return type: GLXCurses.Label or None
-
label_xalign
¶ The horizontal alignment of the label.
Returns: The horizontal alignment of the label. Return type: float
-
label_yalign
¶ The vertical alignment of the label.
Returns: The vertical alignment of the label. Return type: float
-
shadow_type
¶ Appearance of the frame border.
Returns: The shadow type use by the frame Return type: GLXCurses.GLXC.ShadowType
-
new
(label=None)[source]¶ Create a new
Frame
, with optional label text .If label is None, the label is omitted.
Parameters: label (str or None) – the text to use as the label of the frame. Returns: a new Frame
widgetReturn type: Widget
-
set_label
(label)[source]¶ Sets the text of the label.
If label is
None
, the current label is removed.Parameters: label (str or None) – the text to use as the label of the frame.
-
set_label_widget
(label_widget)[source]¶ Sets the label widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title.
Parameters: label_widget ( Widget
) – the new label widget
-
set_label_align
(xalign, yalign)[source]¶ Sets the alignment of the frame widget’s label. The default values for a newly created frame are 0.0 and 0.5.
Parameters: - xalign (float) – The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment.
- yalign (float) – The y alignment of the label. A value of 0.0 aligns under the frame; 1.0 aligns above the frame. If the values are exactly 0.0 or 1.0 the gap in the frame won’t be painted because the label will be completely above or below the frame.
-
set_shadow_type
(shadow_type=None)[source]¶ Sets the shadow type for frame .
Parameters: shadow_type – the new :py:__area_data:ShadowType
-
get_label
()[source]¶ If the frame’s label widget is a
Label
, returns the text in the label widget. (The frame will have aLabel
for the label widget if a non-NULL argument was passed when create theFrame
.)Returns: the text in the label, or :py:__area_data:None if there was no label widget or the label widget was not a Label
. This string is owned by GLXCurses and must not be modified or freed.Return type: str or None
-
get_label_align
()[source]¶ Retrieves the X and Y alignment of the frame’s label.
See also
xalign: X location of frame label
yalign: Y location of frame label
Returns: xalign, yalign Return type: float, float
-
get_label_widget
()[source]¶ Retrieves the label widget for the frame.
See also
Returns: the label widget, or NULL if there is none. Return type: Widget
or :py:__area_data:None
-