Skip to content

Commit

Permalink
docs: add setup property description
Browse files Browse the repository at this point in the history
  • Loading branch information
linkfrg committed Jul 31, 2024
1 parent da33d65 commit e5a622f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/widgets/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ but you can now pass a string with the actual value of the enum: ``"start"``, ``
Overridden properties do not support enums.
For example, you cannot pass an enum to the ``valign`` property.

The ``setup`` property
--------------------
You can pass a callback function to the widget costructor as the ``setup`` property.
The widget will be passed to the callback function as an argument.
This can be useful when you need to perform actions when the widget is initialized (for example, connect to signal).

.. code-block:: python
from ignis.widgets import Widget
Widget.Label(
label="you will not see this text",
setup=lambda self: self.set_label("instead, you will see this")
)
Common widget properties
-------------------------

Expand Down

0 comments on commit e5a622f

Please sign in to comment.