This creates a panel (DC-East) that has three buttons (DC-East-Next, DC-East-View and DC-East-Kill). They're all set up and ready to go.
However, I can't figure out how to pass in an optional event handler for each button and have the macro assemble it correctly for the gs:button call. I want to do something like this
;; The "View" button doesn't have a handler yet, should default to gs:no-action.
(button3 'DC 'East '((Next "-->" 'next-card) (View "<o>") (Kill "X" 'kill-card)))
I am just getting invalid function or macro expansion problems when I try to do this. Any suggestions?
Thanks!
Testing can show the presence of bugs, but not their absence.
This will set 'card-new and 'card-back as event handlers, but the clone button will use the default gs:no-action.
It would be nice to know how to do this with proper symbols in the macro, but this is working for now and the macro simplifies my GUI setup code quite a lot.
If anyone has any improvements to suggest, I'm all ears!
Testing can show the presence of bugs, but not their absence.
Also, I don't know anything about gs, so I can't comment on the rest. (I tried to get gs running on my obsd box but it seems to hang on gs:init call -- doesn't come back from the call.)
Macros are supposed to be useful for "writing the code that you would have written if you had the patience". Since guiserver uses symbols, I figured that they would be perfect for button assembly boilerplate. However, I had to cheat with sending strings to guiserver because the symbols weren't getting quoted in the correct namespace. So here I admit there's no real advantage to the macro.
It seems there's also the (macro) function, which may do more what I want. So I'll probably try it later.
Testing can show the presence of bugs, but not their absence.