Class wibox.widget.textbox
Usage:
wibox.widget{
markup = 'This <i>is</i> a <b>textbox</b>!!!',
align = 'center',
valign = 'center',
widget = wibox.widget.textbox
}
Info:
- Copyright: 2010, 2011 Uli Schlachter, dodo
- Author: Uli Schlachter,dodo
Functions
-
textbox:get_preferred_size (s)
-
Get the preferred size of a textbox.
This returns the size that the textbox would use if infinite space were
available.
- s
integer or screen
The screen on which the textbox will be displayed.
Returns:
-
number
The preferred width.
-
number
The preferred height.
-
textbox:get_height_for_width (width, s)
-
Get the preferred height of a textbox at a given width.
This returns the height that the textbox would use when it is limited to the
given width.
- width
number
The available width.
- s
integer or screen
The screen on which the textbox will be displayed.
Returns:
number
The needed height.
-
textbox:get_preferred_size_at_dpi (dpi)
-
Get the preferred size of a textbox.
This returns the size that the textbox would use if infinite space were
available.
- dpi
number
The DPI value to render at.
Returns:
-
number
The preferred width.
-
number
The preferred height.
-
textbox:get_height_for_width_at_dpi (width, dpi)
-
Get the preferred height of a textbox at a given width.
This returns the height that the textbox would use when it is limited to the
given width.
- width
number
The available width.
- dpi
number
The DPI value to render at.
Returns:
number
The needed height.
-
textbox:set_markup_silently (text)
-
Set the text of the textbox (with
[Pango markup](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html)).
- text
string
The text to set. This can contain pango markup (e.g.
bold
). You can use awful.util.escape to escape
parts of it.
Returns:
boolean
true
Or
-
boolean
false
-
string
Error message explaining why the markup was invalid.
-
wibox.widget.textbox ([text=""[, ignore_markup=false]])
-
Create a new textbox.
- text
string
The textbox content
(default "")
- ignore_markup
boolean
Ignore the pango/HTML markup
(default false)
Returns:
table
A new textbox widget
Object properties
-
wibox.widget.textbox.markup
-
Set the text of the textbox (with
[Pango markup](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html)).
Type:
- text
string
The text to set. This can contain pango markup (e.g.
bold
). You can use awful.util.escape to escape
parts of it.
See also:
-
wibox.widget.textbox.text
-
Set a textbox' text.
Type:
- text
The text to display. Pango markup is ignored and shown as-is.
See also:
-
wibox.widget.textbox.ellipsize
-
Set a textbox' ellipsize mode.
Type:
- mode
Where should long lines be shortened? "start", "middle" or "end"
-
wibox.widget.textbox.wrap
-
Set a textbox' wrap mode.
Type:
- mode
Where to wrap? After "word", "char" or "word_char"
-
wibox.widget.textbox.valign
-
The textbox' vertical alignment
Type:
- mode
Where should the textbox be drawn? "top", "center" or "bottom"
-
wibox.widget.textbox.align
-
Set a textbox' horizontal alignment.
Type:
- mode
Where should the textbox be drawn? "left", "center" or "right"
-
wibox.widget.textbox.font
-
Set a textbox' font
Type:
- font
The font description as string
Theme variables
-
beautiful.font
-
The textbox font.