Module albow.layout.Frame
Source code
from albow.core.ui.Widget import Widget
class Frame(Widget):
"""
A Frame is a container widget that adds a border around a client widget at a specified distance.
"""
border_width: int = 1
"""
The width of the border
"""
margin: int = 2
"""
The spacing between border and widget
"""
def __init__(self, client: Widget, border_spacing: int = None, **kwds):
"""
Args:
client: The widget to wrap
border_spacing: Distance between the edges of the client and the border line.
**kwds:
"""
super().__init__(**kwds)
self.client = client
if border_spacing is not None:
self.margin = self.border_width + border_spacing
d = self.margin
w, h = client.size
self.size = (w + 2 * d, h + 2 * d)
client.topleft = (d, d)
self.add(client)
Classes
class Frame (client, border_spacing=None, **kwds)
-
A Frame is a container widget that adds a border around a client widget at a specified distance.
Args
client
- The widget to wrap
border_spacing
- Distance between the edges of the client and the border line.
**kwds:
Source code
class Frame(Widget): """ A Frame is a container widget that adds a border around a client widget at a specified distance. """ border_width: int = 1 """ The width of the border """ margin: int = 2 """ The spacing between border and widget """ def __init__(self, client: Widget, border_spacing: int = None, **kwds): """ Args: client: The widget to wrap border_spacing: Distance between the edges of the client and the border line. **kwds: """ super().__init__(**kwds) self.client = client if border_spacing is not None: self.margin = self.border_width + border_spacing d = self.margin w, h = client.size self.size = (w + 2 * d, h + 2 * d) client.topleft = (d, d) self.add(client)
Ancestors
Inherited members
Widget
:add
add_anchor
add_centered
anchor
attention_lost
augment_mouse_event
bg_color
bg_image
border_color
border_width
call_handler
call_parent_handler
defer_drawing
dismiss
draw
draw_over
fg_color
focus
focus_switch
font
get_cursor
get_focus
get_margin_rect
get_root
get_top_widget
get_visible
global_to_local
has_focus
inherited
invalidate
is_gl_container
key_down
key_up
local_to_global
margin
menu_bar
parent
parent_resized
present
rect
relative_mode
remove
remove_anchor
resized
scale_bg
sel_color
set_parent
set_size_for_text
tab_stop
visible