Module: wibox.drawable
Handling of drawables.
A drawable is something that can be drawn to.
Info:
- Copyright: 2012 Uli Schlachter
-
Originally authored by: Uli Schlachter
(Full contributors list available on our github project)
Methods
:find_widgets (x, y) | Find a widget by a point. | |
:set_widget (widget) | Set the widget that the drawable displays | |
:set_bg (c) | Set the background of the drawable | |
:set_bgimage (image) |
Set the background image of the drawable
If image is a function, it will be called with (context, cr, width, height)
as arguments.
|
|
:set_fg (c) | Set the foreground of the drawable |
Methods
- :find_widgets (x, y)
-
Find a widget by a point.
The drawable must have drawn itself at least once for this to work.
Parameters:
- x X coordinate of the point
- y Y coordinate of the point
Returns:
-
table
A table containing a description of all the widgets that
contain the given point. Each entry is a table containing this drawable as
its
.drawable
entry, the widget under.widget
and the instance of wibox.hierarchy describing the size and position of the widget under.hierarchy
. For convenience,.x
,.y
,.width
and.height
contain an approximation of the widget's extents on the surface.widget_width
andwidget_height
contain the exact size of the widget in its own, local coordinate system (which may e.g. be rotated and scaled). - :set_widget (widget)
-
Set the widget that the drawable displays
Parameters:
- widget
- :set_bg (c)
-
Set the background of the drawable
Parameters:
- c The background to use. This must either be a cairo pattern object, nil or a string that gears.color() understands.
See also:
- :set_bgimage (image)
-
Set the background image of the drawable
If
image
is a function, it will be called with(context, cr, width, height)
as arguments. Any other arguments passed to this method will be appended.Parameters:
- image A background image or a function
- :set_fg (c)
-
Set the foreground of the drawable
Parameters:
- c The foreground to use. This must either be a cairo pattern object, nil or a string that gears.color() understands.
See also: