Elementary table container

This code snippet demonstrates how to create an elementary table container, set its basic properties and add the data to the cells.
//create the table
Evas_Object *table = elm_table_add(ad->win);
elm_win_resize_object_add(ad->win, table);
evas_object_show(table);

//set basic properties
elm_table_padding_set(table, 5, 5);
elm_table_homogeneous_set(table, EINA_TRUE);

//populate the table with sample data
for(int i = 0; i<3; i++){
	for(int j= 0; j<5; j++){
		Evas_Object *label = elm_label_add(ad->win);
		char buf[6];
		snprintf(buf, sizeof(buf), "(%d,%d)", i, j);
		elm_object_text_set(label, buf);
		evas_object_show(label);
		
		elm_table_pack(table, label, i, j, 1, 1);
	}
}

Responses

0 Replies