Circle button with specified text label and image

An example of function which returns circle button with specified text label and image
static Evas_Object*
create_circle_button(Evas_Object *parent, char* text, char* filepath) {
	Evas_Object *button, *image;

	button= elm_button_add(parent);
	elm_object_style_set(button, "circle");
	elm_object_text_set(button, text);
	image = elm_image_add(button);
	elm_image_file_set(image, filepath, NULL);
	elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
	elm_object_part_content_set(button, "icon", image);
	evas_object_smart_callback_add(button, "clicked", NULL, NULL);
	evas_object_show(button);

	return button;
}

Responses

0 Replies