Available widgets (was: Re: [graphic-forms-devel] Dialogs return values)
Edgar Gonçalves
edgar.goncalves at gmail.com
Sun Mar 25 19:22:54 UTC 2007
On 3/25/07, Jack Unrue <jdunrue at gmail.com> wrote:
> On 3/25/07, Edgar Gonçalves <edgar.goncalves at gmail.com> wrote:
> >
> > Hi! I've just started playing with graphic-forms, and I wanted to
> > build some macros to generate message-boxes (which I did based on your
> > demo about-dialog), and some input-prompts, like Yes/No questions, or
> > a simple OK/Cancel. But I'm not figuring how I can set a return value
> > for such functions (they seem to return the value 4 once (gfw:show dlg
> > t) is called). Right now I managed a dirty hack by placing a global
> > variable and making the dialog change it. but this is not as
> > functional as I would want... Any suggestions?
> >
>
> Hi Edgar. Your macros could be written to establish a lexical binding
> and then use a closure as a callback for each widget in the dialolg.
> Or you could define a new dispatcher class and specify that for each
> widget, with one or more slots carrying important return info. You
> might consider constructing your macros such that the user of the
> macro provides one or more symbols to identify bindings whose values
> are to carry whatever result info your dialogs will provide, which can
> then be accessed within the body of the macro. The WITH-* macros
> for the color, file, and font dialogs work this way.
>
> The exact return value of GFW:SHOW is whatever the underlying
> window system returns -- I might change the function to return (values)
> just to emphasize that it's not a value that the application can use.
> But you could obviously implement a wrapper around GFW:SHOW if
> you wanted a function-based API.
>
That's what I was getting at. I'll make some wrappers to do it.
On another subject, the list of controls you make available in
graphic-forms is still limited. Is that because you haven't needed
more, yet, or are there technical impediments? I would like to use
most of the controls in MFC -
http://msdn2.microsoft.com/en-us/library/47xcww9x(VS.80).aspx -, do
you have some quick recipe ready for this? It'd be great to share
user's widgets!
Thanks again for the help!
--
Edgar Gonçalves
Instituto Superior Técnico,
INESC-ID - Software Engineering Group,
Portugal
More information about the Graphic-forms-devel
mailing list