Self-contained About window

BlitzMax Forums/MaxGUI Module/Self-contained About window

JoshK(Posted 2007) [#1]
The main program just needs to call CreateAboutWindow() and ShowAboutWindow(), and this routine will take care of the rest, including deactivating the parent and all siblings.

I find this sort of thing very interesting, because it is no longer linear programming. You can mix and match all kinds of gadgets and windows to make modular applications.

Menu action events now contain the menu as the event source. You can use that instead of the event id. That means you can created sub-windows with menus and their own menu actions in the hook. The main program doesn't need to care or know what the subwindow is doing.




JoshK(Posted 2007) [#2]
Here's an updated version. All you do is:

Import "About.bmx"
CreateAboutWindow(MainWindow:TGadget)
Create a menu like this:

GADGET_MENU_ABOUT=CreateMenu("About",0,menu)

The code will automate everything else for you, including activating the last active window and hiding/showing the about window.




rs22(Posted 2008) [#3]
Sorry to bring up an old post, but I just wanted to thank you for this. I've been trying to work out a good way to implement dialog boxes in my application, and this seems like it'll work perfectly. Thanks!