Skip to content

Commit c0cbff9

Browse files
MrMinojonathanslenders
authored andcommitted
Document dont_extend_* parameters of Label
1 parent 87cd853 commit c0cbff9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

prompt_toolkit/widgets/base.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,19 @@ class Label:
321321
"""
322322
Widget that displays the given text. It is not editable or focusable.
323323
324-
:param text: The text to be displayed. (This can be multiline. This can be
325-
formatted text as well.)
324+
:param text: Text to display. Can be multiline. All value types accepted by
325+
:class:`prompt_toolkit.layout.FormattedTextControl` are allowed,
326+
including a callable.
326327
:param style: A style string.
327328
:param width: When given, use this width, rather than calculating it from
328329
the text size.
330+
:param dont_extend_width: When `True`, don't take up more width than
331+
preferred, i.e. the length of the longest line of
332+
the text, or value of `width` parameter, if
333+
given. `True` by default
334+
:param dont_extend_height: When `True`, don't take up more width than the
335+
preferred height, i.e. the number of lines of
336+
the text. `False` by default.
329337
"""
330338

331339
def __init__(

0 commit comments

Comments
 (0)