The background widget is used for setting a solid color, image or Edje group as a background to a window (unless it has transparency enabled) or any container object.
It works just like an image, but has some properties useful to a background, like setting it to tiled, centered, scaled or stretched.
Layout content parts¶
overlay- overlay of the bg
- class efl.elementary.Background(Object parent, *args, **kwargs)¶
This is the class that actually implements the widget.
efl.evas.Object) – The parent object
**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
The color on a given background widget.
This property reflects the color used for the background rectangle, in RGB format. Each color component’s range is from 0 to 255.
You probably only want to use this property if you haven’t previously set
file, so that you just want a solid color background.
(int r, int g, int b)
- color_set(r, g, b)¶
The file (image or edje collection) giving life for the background.
This property contains the image file name (and edje group) used in the background object. If the image comes from an Edje group, it will be stretched to completely fill the background object. If it comes from a traditional image file, it will by default be centered in this widget’s are (thus retaining its aspect), what could lead to some parts being not visible. You may change the mode of exhibition for a real image file with
Once the image is set, a previously set one will be deleted, even if file is None.
This will only affect the contents of one of the background’s swallow spots, namely “elm.swallow.background”. If you want to achieve the
efl.elementary.layout_class.LayoutClass’s file setting behavior, you’ll have to call that method on this object.
string file, optional string group
RuntimeError – if setting the file failed.
- file_set(filename, group=None)¶
The size of the pixmap representation of the image set on a given background widget.
This property sets a new size for pixmap representation of the given bg image. It allows for the image to be loaded already in the specified size, reducing the memory usage and load time (for example, when loading a big image file with its load size set to a smaller size)
This is just a hint for the underlying system. The real size of the pixmap may differ depending on the type of image being loaded, being bigger than requested.
This function just makes sense if an image file was set with
(int w, int h)
- load_size_set(w, h)¶
The mode of display for a given background widget’s image.
This property reflects how the background widget will display its image. This will only work if
filewas previously set with an image file. The image can be displayed tiled, scaled, centered or stretched.