--- On Mon, 7/11/11, Hans-Christoph Steiner <[email protected]> wrote:
> From: Hans-Christoph Steiner <[email protected]> > Subject: implementing tooltips WAS: [PD] Pd-extended 0.43 updates: lots of > new editing features > To: "Jonathan Wilkes" <[email protected]> > Cc: "Martin Peach" <[email protected]>, "Mathieu Bouchard" > <[email protected]>, "pd-list" <[email protected]> > Date: Monday, July 11, 2011, 11:18 PM > > On Jul 11, 2011, at 3:58 PM, Jonathan Wilkes wrote: > > > > > > > --- On Mon, 7/11/11, Mathieu Bouchard <[email protected]> > wrote: > > > >> From: Mathieu Bouchard <[email protected]> > >> Subject: Re: [PD] Pd-extended 0.43 updates: lots > of new editing features > >> To: "Martin Peach" <[email protected]> > >> Cc: "pd-list" <[email protected]> > >> Date: Monday, July 11, 2011, 7:45 PM > >> On Mon, 11 Jul 2011, Martin Peach > >> wrote: > >>> On 2011-07-11 12:06, Jonathan Wilkes wrote: > >>>> But I'm not sure where to store the > tooltip > >> string... > >>> > >>> Not sure if that's what you mean, but in max > the > >> assist method receives a number corresponding to > the inlet > >> or outlet and returns a pointer to the appropriate > string, > >> so the string is already stored somewhere in the > memory > >> allocated to the object. > >> > >> Not necessarily : the assist-method could be > storing the > >> data anywhere, or generating it on-the-fly from > whatever. > > > > Hm... > > > > 1 when creating an xlet for the first time, bind its > tag on <Enter> and <Leave> to call > pdtk_tooltips, and send $canvas, $inletno and $object_name > as arguments > > > > 2 in tcl, search helppath for $object_name-help.pd, > then parse it for $inletno (which I added as a pd META tag > for every internal help patch-- plus lots of externals, > too) > > > > 3 filter the matching line in tcl to display > everything after $inletno minus the semicolon. (I.e., "text > 20 20 INLET_0 float symbol bang;" becomes "float symbol > bang") > > > > 4 create that text on a little tooltip rectangle on > $canvas; delete it on <Leave> > > > > All you add on the pd side is a sys_gui call to create > the binding, then handle everything else on the tcl side. > > > > Does that make sense? If so, then once someone > gets it working (maybe me), you'd not only have tooltips, > but you'd have tooltip content for over 1000 object classes > (minus exceptions like "list split", and variable/rightmost > inlets which I'm not sure how to handle...) > > > > Also doesn't address tooltips for abstractions. > > > > -Jonathan > > I like this idea quite a bit. If the tooltip info is > stored in a help patch, then we have a single way of > specifying the tooltip info regardless if the object was > written in C, Pd, Lua, etc. The downside will be a lot > more file parsing on load. Perhaps we can do some kind > of low priority thread kind of thing in Tcl to do that > loading. > > One detail, instead of searching the path for the help > patch, really we should try to get the full path of the > object in question, then use that to get the help patch... Ok. Is c_helpname guaranteed to be inside c_externdir? > > .hc > > > ---------------------------------------------------------------------------- > > Computer science is no more related to the computer than > astronomy is related to the telescope. > -Edsger Dykstra > > > _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
