Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26302
Modified Files: Tag: desiredata desire.c Log Message: first attempt at inlet tooltips
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.65 retrieving revision 1.1.2.217.2.66 diff -C2 -d -r1.1.2.217.2.65 -r1.1.2.217.2.66 *** desire.c 13 Dec 2006 06:33:33 -0000 1.1.2.217.2.65 --- desire.c 13 Dec 2006 07:22:44 -0000 1.1.2.217.2.66 *************** *** 1167,1183 **** /* ------------------------ event handling ------------------------ */
- void canvas_inlettip(t_canvas* x,t_object* ob,int closest,int xpos,int ypos) { - /* - if (!sys_tooltips) return; - if (ob->ob_pd->c_firstin) closest--; - if (closest < 0) - sys_vgui(".x%lx.c create text %d %d -anchor sw -text "%s" -tags y\n", - (t_int)x, xpos, ypos,ob->ob_pd->c_firsttip->s_name); - else - sys_vgui(".x%lx.c create text %d %d -anchor sw -text "%s" -tags y\n", - (t_int)x, xpos, ypos-4,inlet_tip(ob->inlet,closest)); - */ - } - /* set a canvas up as a graph-on-parent. Set reasonable defaults for any missing paramters and redraw things if necessary. */ --- 1167,1170 ---- *************** *** 6248,6251 **** --- 6235,6252 ---- }
+ static void canvas_object_get_tips(t_canvas *x, t_symbol *name) { + t_text *o; + if (sscanf(name->s_name,"x%lx",(long*)&o)<1) {pd_error(x,"gargamel was here"); return;} + char foo[666]; + if (o->ob_pd->c_firstin) strcpy(foo,o->ob_pd->c_firsttip->s_name); else strcpy(foo,""); + int n = obj_ninlets(x); + char *foop = foo; + for (int i=!!o->ob_pd->c_firstin; i<n; i++) { + strcat(foo," "); + strcat(foo,inlet_tip(o->inlet,i)); + } + sys_mgui(o,"tips=","S",foo); + } + static long canvas_children_count(t_canvas *x) { long n=0; *************** *** 7500,7503 **** --- 7501,7505 ---- class_addmethod3(c,canvas_object_delete,"object_delete","s"); class_addmethod3(c,canvas_object_insert,"object_insert","*"); + class_addmethod3(c,canvas_object_get_tips,"object_get_tips","s"); class_addmethod3(c,canvas_text_setto,"text_setto","*"); class_addmethod3(c,canvas_with_reply,"with_reply","*");