1

I want the background color (or image) of elementary widget (also container) like a grid or box.

How can I set background color of the elementary widget?

In the EFL elementary documentation, I found elm_bg functions, but I can't set it as background to other elementary containers...

zcoop98
  • 2,590
  • 1
  • 18
  • 31
pius lee
  • 1,164
  • 1
  • 12
  • 28

3 Answers3

3

Use elm_table widget. By using table, you can pack multiple objects into the same position.

  1. create elm_table.
  2. create elm_bg (you can set bg by color or a image.
  3. pack that bg into table with the same position of your container widget.

Thanks.

SeoZ
  • 41
  • 3
  • but I can't use table container in my window. must be sure to surround every widgets to table for background? – pius lee Jul 15 '14 at 07:05
  • Can you not use a table at the top level and put your entire layout into that cell along with the background? – andy.xyz Oct 17 '14 at 18:22
1

Also asked on tizen.org, this part is unclear apparently

https://developer.tizen.org/ko/forums/native-application-development/how-change-button-background-color

Theming is the way to go, sample code shared at previous URL.

RzR
  • 3,068
  • 29
  • 26
1
Evas_Object *bg = elm_bg_add(parent);

// Set a color
elm_bg_color_set(bg, 64, 127, 256);

// Set a background image
elm_bg_file_set(bg, "/path/to/the/image", NULL);

// Create your grid or box component with the background as parent
Evas_object *box = elm_box_add(bg);

/* Load content at the topmost layer of the background */
/* Note that the background has a swallow part and there is where our box will go */
elm_object_content_set(bg, box);