Thanks for the answers Kryzysztof,
What is the difference between what you suggest and what Guenter had in button.c originally:
x->x_glist = (t_glist*)NULL;
I accidentally commented both yours and his out and it still works?
The issue was (simple) and I would not have noticed it if Mathieu had not brought my attension to it, but the existance of a "text" class already! After renaming the external to "entry" it all works fine. I really have no idea why OSX swallowed my mistake.
I completely agree that a better way of dealing with tk widgets (and perhaps any other toolkit for that matter) in PD is the best solution. This is certainly in no dispute, and I would be happy to help with the tk portions of this project. These externals are a short term solution that I can justify spending a few days on (two for popup and two for text). I do think these externals will be useful in a number of situations now, but hope they will be replaced by toxy in the future. (native widget listbox w/ scrollbar!)
In terms of focus, I was expecting the pd canvas to automatically take the focus back when clicked, but this does not happen. Sounds like this binding should be in PD to avoid issues with any focus grabbing widgets in the future. I'm not going to mess with the bindings of the parent canvas in this external though and suppose I'll leave it this way for now. Seems to work fine in GOPs as well.
Any suggestions on the CVS structuring issue? Or should I not put entry into it quite yet?
B.
Krzysztof Czaja wrote:
hi Ben,
B. Bogart wrote: ...
I can tell the glist stuct member is containing something completely different on OSX than in linux (but popup works on linux, and I changed
do not blame linux for that. What you need is
x->x_glist = canvas_getcurrent();
in the _new routine. Assigning it in a draw routine does not make sense, because the value never changes during the object's lifetime. If you do so, you are going to rely on the draw routine being called prior to any usage of x->x_glist.
...
and chaos and put popup and text in a "gui-externs" directory? The code is almost identical to popup, all I changed was the tcl stuff and changed the object methods, which all just do sys_vgui things.
exacly the reason, why the efforts would be better channeled, if they went into creating the generic Pd framework for Tk widgets...
...
fixed this by binding the <Leave> event on the text widget with a focus command on the widget's parent (focus [winfo parent]) I'm not sure if
more natural, perhaps, seems keeping the focus in the widget, even if mouse is outside of it (keep it until clicked outside) -- that is how text editors usually behave. What I do is just
bind Canvas <1> {+focus %W}
in the setup.wid. Actually, I would like to have it in pd.tk, instead...
Krzysztof
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev