Place
This capability documents one focused aspect of the widget interface (Tk/Tcl-style behavior + bootstack extensions).
Note: You typically won’t use
bootstack.core.capabilities.placedirectly. This page describes the behavior that widgets expose.
Place geometry manager helpers (place).
Tk's place geometry manager positions widgets using absolute coordinates
and/or relative fractions of the container size.
place is useful for:
- overlays (badges, floating buttons, popovers)
- precise positioning inside a fixed-size container
- small "anchor" adjustments that don't fit grid/pack well
Notes
placeis generally less adaptive thangridorpackfor resizable UIs.- Relative coordinates (
relx,rely,relwidth,relheight) are fractions of the container size (0.0–1.0).
place
place(cnf: dict[str, Any] | None = None, **kw: Any) -> Self
Position this widget using the place geometry manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cnf
|
dict[str, Any] | None
|
Optional dict of place options. |
None
|
**kw
|
Any
|
Place options. Common options include: - x, y: Absolute coordinates in pixels (relative to container). - relx, rely: Relative coordinates (0.0–1.0) of the container size. - width, height: Absolute size in pixels. - relwidth, relheight: Relative size (0.0–1.0) of the container size. - anchor: Which point of the widget is placed at (x, y) / (relx, rely) (e.g. "nw", "center", "se"). - bordermode: How to interpret x/y relative to container borders. |
{}
|
Returns:
| Type | Description |
|---|---|
Self
|
Self for method chaining. |
place_configure
place_configure(
cnf: dict[str, Any] | None = None, **kw: Any
) -> Self
Alias for place().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cnf
|
dict[str, Any] | None
|
Optional dict of place options. |
None
|
**kw
|
Any
|
Place options (see |
{}
|
Returns:
| Type | Description |
|---|---|
Self
|
Self for method chaining. |
place_forget
place_forget() -> Self
Unmap this widget and forget its place configuration.
Returns:
| Type | Description |
|---|---|
Self
|
Self for method chaining. |
place_info
place_info() -> dict[str, Any]
Return this widget's current place configuration.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dict containing the current place options for this widget |
dict[str, Any]
|
(x, y, relx, rely, width, height, etc.). |
place_slaves
place_slaves() -> list[Any]
Return the widgets managed by place in this container.
Returns:
| Type | Description |
|---|---|
list[Any]
|
A list of child widgets managed by place. |