I would be absoluty happy to do everything in toxy, but there are unexpected issues that came out of the toxy development I was unable to solve (for popup box):
* The objects's bounding box changing side willy-nilly and being altogether wrong on load. (I suppose this is a bug, but I can imagine the code to draw the box around an arbitrary widget could be a little complicated.) Actually I would prefer the non-selected bounding box just not be there, the widgets's themselves have sufficient borders. Only the blue on select box should remain, and its size does not need to be perfect.
* The inability to change the width of the "menubutton" widget. I tried with messages inside the patch, and in the .wid file, but the menubutton always apears a fixed size. On OSX it is big enough for maybe 4 chars.
* I could not figure out a good way to set the menu options using a toxy widget. The first solution was to use $ arguments in the abstraction, problem being I had to refer to all of them in the toxy code [list $1 $2 $3 $4 $5 ...]. Also this lead to object boxes many times wider than the widget itself, making it awkward in a gui. I decided to try an external when I was implimenting a message to set the menu options, but how to store these menu items when the patch is saved?
If I saw solutions to these two problems I would be continuing to use toxy. I have a vested interest in toxy being able to do what I am aiming for, and so I think it would be great if (visually) my current popup external could serve as an example.
Guenter, on what user-centered level were you unhappy with your externals? I've been able to use button.c to do what I want withpopup in about 30 or so lines of additions (and two days of effort). Do the iemguis have any changes that make them more acceptable since your initial writing?
After this growing discussion, to bring things back to the thread subject, how can I get my tk widget -command to send data back over to the PD side? (see the original post for code reference) I'd really like to get it to work! pd_bind??
Personally I think the bottom line is that there is interest in more intuitive (and at least for me) more well-integrated looking GUIs. I think standard tk widgets is a great way to do this, along side of a little extra GOP effort. I can post a grab the patch for which this popup menu is for if anyone is interested.
Thanks Ben
guenter geiger wrote:
On Thu, 19 Feb 2004, Krzysztof Czaja wrote:
hi Ben (and Guenter?),
in a short-term project you will probably find yourself on a safer side, since toxy is still very immature.
Taking a longer-term view, however, I do not understand, why should anybody prefer writing and maintaining (esp. through Pd api changes) a few-hundred-or-more-line external, to a few lines of a simple Tcl code, which has to be embedded in that external, anyway.
Well, I can only reiterate that I am not really happy with the approach that I have taken in these externals.
I didn't know about toxy at that time, if I had known, or if toxy already existed, probably I would not have changed them to use native tcl/tk widgets.
Remember, most of the sliders, bangs, toggles etc that are in the iemgui came from my external collection, so the only options I had was making mine different or removing them completely. I made them different in order to test the embedding of standard widgets.
At least, there are no fundamental stability, nor performance gains I can think of...
Absolutely right.
Guenter
Krzysztof
B. Bogart wrote: ...
I'm almost finished [popup], with a couple bugs and the biggest issue being that I can't figure out how to pass data from the tk widget back to pd.. (telling it what menu item was selected!) in GGEE button.c seems to do the magic here, could someone explain whats really going on?
sprintf(buf,"button%p",x); x->x_sym = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_sym);
sys_vgui("proc button_cb%x {} {\n pd [concat button%p b \;]\n }\n",x,x);
defines a procedure to be configured into a button's -command. The proc, when invoked, sends a 'b' message to the object.
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev