static void mknob_draw_new(t_mknob *x, t_glist *glist) { int xpos=text_xpix(&x->x_gui.x_obj, glist); int ypos=text_ypix(&x->x_gui.x_obj, glist); int r = xpos + (x->x_val + 50)/100; int xc=xpos+x->x_gui.x_w/2; int yc=ypos+x->x_gui.x_w/2; t_canvas *canvas=glist_getcanvas(glist); sys_vgui(".x%lx.c create oval %d %d %d %d -fill #%6.6x -tags %xBASE\n", canvas,xpos,ypos,xpos + x->x_gui.x_w, ypos + x->x_gui.x_w, x->x_gui.x_bcol,x); sys_vgui(".x%lx.c create polygon %d %d %d %d %d %d -fill #%6.6x -tags %xKNOB\n", glist_getcanvas(glist), xc,ypos,xc-4,yc,xc+4,yc,x->x_gui.x_fcol,x); mknob_update_knob(x,glist); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ -font {{%s} %d bold} -fill #%6.6x -tags %xLABEL\n",
static void mknob_draw_new(t_mknob *x, t_glist *glist) { int xpos=text_xpix(&x->x_gui.x_obj, glist); int ypos=text_ypix(&x->x_gui.x_obj, glist); int r = xpos + (x->x_val + 50)/100; t_float xc=xpos+x->x_gui.x_w/2.0; t_float yc=ypos+x->x_gui.x_w/2.0; t_float rc=x->x_gui.x_w/2.0; t_canvas *canvas=glist_getcanvas(glist); t_gobj *y = (t_gobj *)x; t_object *ob = pd_checkobject(&y->g_pd); /* GOP objects are unable to call findrtext triggering consistency check error */ t_rtext *yyyy = NULL; if (!glist->gl_isgraph || glist_istoplevel(glist)) yyyy = glist_findrtext(canvas, (t_text *)&ob->ob_g); /* on GOP we cause segfault as apparently text_gettag() returns bogus data */ char *nlet_tag; if (yyyy) nlet_tag = rtext_gettag(yyyy); else nlet_tag = "bogus"; sys_vgui(".x%lx.c create circle %f %f -r %f -fill #%6.6x -tags {%xBASE %xMKNOB %s}\n", canvas,xc,yc,rc, x->x_gui.x_bcol, x, x, nlet_tag); /*sys_vgui(".x%lx.c create circle %f %f -r %f -stroke \"\" -fill #%6.6x -tags {%xCENTER %xMKNOB}\n", canvas,xc,yc,3.5, x->x_gui.x_fcol, x, x);*/ /*sys_vgui(".x%lx.c create ppolygon %d %d %d %d %d %d -fill #%6.6x -tags {%xKNOB %xMKNOB}\n", glist_getcanvas(glist), (int)xc,ypos,(int)xc-4,(int)yc,(int)xc+4,(int)yc,x->x_gui.x_fcol,x,x);*/ sys_vgui(".x%lx.c create ppolygon %f %d %f %f -strokewidth 2 -stroke #%6.6x -tags {%xKNOB %xMKNOB %s}\n", canvas,xc,ypos,xc,yc,x->x_gui.x_fcol,x,x,nlet_tag); mknob_update_knob(x,glist); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ -font {{%s} %d bold} -fill #%6.6x -tags {%xLABEL %xMKNOB %s}\n",
static void mknob_draw_update(t_mknob *x, t_glist *glist) { if (glist_isvisible(glist)) { mknob_update_knob(x,glist); /*if(x->x_val == x->x_center) { if(!x->x_thick) { sys_vgui(".x%lx.c itemconfigure %xKNOB -width 7\n", canvas, x); x->x_thick = 1; } } else { if(x->x_thick) { sys_vgui(".x%lx.c itemconfigure %xKNOB -width 3\n", canvas, x); x->x_thick = 0; } }*/ } }