On 3/25/07, Jack Unrue jdunrue@gmail.com wrote:
On 3/25/07, Edgar Gonçalves edgar.goncalves@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!
On 3/25/07, Edgar Gonçalves edgar.goncalves@gmail.com wrote:
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!
It's mainly a question of time and effort; there are quite a few areas in the library that need more work, with controls being just one of those areas :-) I'd be happy to review and integrate contributions, but also, I'm open to suggestions as to what you'd like to see done next -- if you wanted to comment on some of the existing bug tracker items or add to the wishlist tracker (at the SourceForge project page), that would be great.
graphic-forms-devel@common-lisp.net