aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_widget_label.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2006-08-07 20:25:34 +0000
committerCarsten Haitzler <raster@rasterman.com>2006-08-07 20:25:34 +0000
commit9266f27f0fa3410100131aed93427d158dd2c4ce (patch)
tree4ff1893faa9b6c03b0c2ad2fb95e6fbc642cf584 /src/bin/e_widget_label.c
parentbe less rememebr write happy (diff)
downloadenlightenment-9266f27f0fa3410100131aed93427d158dd2c4ce.tar.gz
aaah....
first a few patches - authors mailed. then - bg selector work. and a few sample bg's. system bg's dir and user bg dir - new bg dialog should also handle multihead simply too. picture select button does work - but its only as smart as the old one (the code was built off the old one). that needs a little work, but now the bg selector is fast and slick - comes up instantly. resiable too. SVN revision: 24443
Diffstat (limited to 'src/bin/e_widget_label.c')
-rw-r--r--src/bin/e_widget_label.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/bin/e_widget_label.c b/src/bin/e_widget_label.c
index 5d73f7ff6..7a066f9c4 100644
--- a/src/bin/e_widget_label.c
+++ b/src/bin/e_widget_label.c
@@ -2,7 +2,14 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
-
+
+typedef struct _E_Widget_Data E_Widget_Data;
+struct _E_Widget_Data
+{
+ Evas_Object *text;
+};
+
+static void _e_wid_del_hook(Evas_Object *obj);
/* local subsystem functions */
/* externally accessible functions */
@@ -11,12 +18,17 @@ e_widget_label_add(Evas *evas, const char *label)
{
Evas_Object *obj, *o;
Evas_Coord mw, mh;
+ E_Widget_Data *wd;
obj = e_widget_add(evas);
-
+ e_widget_del_hook_set(obj, _e_wid_del_hook);
+ wd = calloc(1, sizeof(E_Widget_Data));
+ e_widget_data_set(obj, wd);
+
o = edje_object_add(evas);
e_theme_edje_object_set(o, "base/theme/widgets",
"widgets/label");
+ wd->text = o;
edje_object_part_text_set(o, "label", label);
evas_object_show(o);
edje_object_size_min_calc(o, &mw, &mh);
@@ -24,6 +36,29 @@ e_widget_label_add(Evas *evas, const char *label)
e_widget_min_size_set(obj, mw, mh);
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
-
+
return obj;
}
+
+EAPI void
+e_widget_label_text_set(Evas_Object *obj, const char *text)
+{
+ E_Widget_Data *wd;
+ Evas_Coord mw, mh;
+
+ wd = e_widget_data_get(obj);
+ edje_object_part_text_set(wd->text, "label", text);
+ edje_object_size_min_calc(wd->text, &mw, &mh);
+ evas_object_resize(wd->text, mw, mh);
+ return;
+}
+
+static void
+_e_wid_del_hook(Evas_Object *obj)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ free(wd);
+}
+