Your techniques for MaxGUI

BlitzMax Forums/BlitzMax GUI Programming/Your techniques for MaxGUI

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Both things you posted make alot of sense.

I agree that separating GUI from implementation is pretty vital.

What is the advantage of item #4 (sending an event) over item #3? Flexibility? Could you somehow embed the new parameters in the event?


These are very good answers. I am looking for one missing link, and that is a way for GUI elements to 'read' global values once they change and adjust their displayed setting to match those values. This is easy if you have each gadget redraw every cycle, but of course that is wasteful of cpu resources. I suppose an event hook could call the appropriate gadget redraws, and the gadgets would read global values. This is still not a 'universal' technique, because I would still need to link the appropriate GUI elements together in the source code.


A better solution might be to have some means of "watching" a variable. Whenever that variable changed, it would notify all gui elements which are connected to that variable. Of course, you'd have to build a list of which elements are associated with which variable, but that would be easy to perform just once during the initial gadget creation.


Hmm, I think I could do this in a custom type.. The idea stream is flowing!