aboutsummaryrefslogtreecommitdiff
path: root/gui/fatom.h
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2003-08-03 09:31:06 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2003-08-03 09:31:06 +0000
commit9205cba07d9bbb100a5f78d47ddbdd91f7a60b95 (patch)
tree301e706e07461dc32641c2363d4cafaa8232b860 /gui/fatom.h
parent9062f6571522ababba146e483a4b48b71162c484 (diff)
several bug fixes
svn path=/trunk/externals/ggee/; revision=821
Diffstat (limited to 'gui/fatom.h')
-rw-r--r--gui/fatom.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/gui/fatom.h b/gui/fatom.h
index 5aed2dc..f261995 100644
--- a/gui/fatom.h
+++ b/gui/fatom.h
@@ -155,6 +155,16 @@ static void create_widget(t_fatom *x, t_glist *glist)
-from 127 -to 0 \
-command fatom_cb%x\n",canvas,x,x);
}
+
+ /* set the start value */
+ if (!strcmp(x->x_type->s_name,"checkbutton")) {
+ if (x->x_val)
+ sys_vgui(".x%x.c.s%x select\n",x->x_glist,x,x->x_val);
+ else
+ sys_vgui(".x%x.c.s%x deselect\n",x->x_glist,x,x->x_val);
+ } else
+ sys_vgui(".x%x.c.s%x set %f\n",x->x_glist,x,x->x_val);
+
}
@@ -163,14 +173,12 @@ static void create_widget(t_fatom *x, t_glist *glist)
static void fatom_drawme(t_fatom *x, t_glist *glist, int firsttime)
{
- t_canvas *canvas=glist_getcanvas(glist);
+ t_canvas *canvas=x->x_glist;//glist_getcanvas(glist);
DEBUG(post("drawme %d",firsttime);)
if (firsttime) {
- DEBUG(post("glist %x canvas %x",x->x_glist,canvas);)
- if (x->x_glist != canvas) {
- create_widget(x,glist);
- x->x_glist = canvas;
- }
+ DEBUG(post("glist %x canvas %x",x->x_glist,canvas));
+ create_widget(x,glist);
+
sys_vgui(".x%x.c create window %d %d -anchor nw -window .x%x.c.s%x -tags %xS\n",
canvas,text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)+2,x->x_glist,x,x);
@@ -324,6 +332,7 @@ static void fatom_float(t_fatom* x,t_floatarg f)
{
x->x_val = f;
+ if (glist_isvisible(x->x_glist)) {
if (!strcmp(x->x_type->s_name,"checkbutton")) {
if (x->x_val)
sys_vgui(".x%x.c.s%x select\n",x->x_glist,x,f);
@@ -331,6 +340,7 @@ static void fatom_float(t_fatom* x,t_floatarg f)
sys_vgui(".x%x.c.s%x deselect\n",x->x_glist,x,f);
} else
sys_vgui(".x%x.c.s%x set %f\n",x->x_glist,x,f);
+ }
outlet_float(x->x_obj.ob_outlet,f);
}
@@ -362,7 +372,7 @@ static void fatom_save(t_gobj *z, t_binbuf *b)
static void *fatom_new(t_fatom* x,t_floatarg max, t_floatarg min, t_floatarg h)
{
char buf[256];
- x->x_glist = (t_glist*)NULL;
+ x->x_glist = canvas_getcurrent();
x->a_pos.a_type = A_FLOAT;
@@ -375,11 +385,6 @@ static void *fatom_new(t_fatom* x,t_floatarg max, t_floatarg min, t_floatarg h)
else x->x_width = 15;
-/*
- if (o) x->x_height = o;
- else
-*/
-
/* bind to a symbol for slider callback (later make this based on the
filepath ??) */