[PD] how to capture window-related mouse-events when toxy isdiscontinued?
Mathieu Bouchard
matju at artengine.ca
Sat Nov 5 16:00:42 CET 2011
Le 2011-11-04 à 23:36:00, Ivica Ico Bukvic a écrit :
> Because after studying the code it looked like a difficult thing to pull
> off. This is because the regular displacefn is used for initial posting
> of objects which is absolute in nature while displacewithtag is
> relative, so the two don’t play very nice.
My experience with t_widgetbehavior and reading IEMGUI code is that the
API is not designed to match what implementors really need to say about
their own GUI objects.
E.g. if each object uses two tags per canvas item, one of which is common
to every item in the object, then Pd can tell Tk to delete all items of
that object, and then t_deletefn needs not be implemented at all.
(Desiredata works like that)
There are other things like that, so that in the end, the number of
methods to be implemented is more like 2, rather than 7 or 8.
BTW, IEMGUI code is not a good example, but it's nearly the only one we
have (most other GUI externals imitate them in some way). IEMGUI defines
its own t_widgetbehavior-like thing using an enum IEM_GUI_DRAW_MODE_stuff
and a single function-pointer. It didn't need to work like that. So, when
reading that code, you have to imagine what it would have looked like if
it had been using t_widgetbehavior in a straightforward way, before you
can analyse it as an example of use of t_widgetbehavior.
______________________________________________________________________
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
More information about the Pd-list
mailing list