[plt-scheme] using macros to create new widgets in MrEd

From: Stephen De Gabrielle (spdegabrielle at gmail.com)
Date: Wed Jul 16 10:02:29 EDT 2008

Hi, I've been fiddling with composing widgets, and I thought I'd have
a try at making a macro to make the code a little easier to read;

I've come up with a solution that allows me to specify a container and
two child widgets in the form
;; make-widget : classname container-class function function -> class

I'd prefer to have something like;
;; define-widget new-widget-classname container-class container-args
sub-widget1% args1 subwidget2% args2)
(define-widget double-button% horizontal-panel% '() button% '([label
label1])  button% '([label label1] [stretchable-width #t]))

My problem is I can't work out how to use the args1 list.
As you can see below I have tried apply as in
(apply new sub-widget% (parent this) sub-widget-args)
but 'new' isn't a function.

Any suggestions?


Posted on the users mailing list.