[MAXGUI] Window & Menu questions
BlitzMax Forums/BlitzMax Beginners Area/[MAXGUI] Window & Menu questions
| ||
My app is a tilemap editor, I intend it to have multiple windows. One of these is the tile palette, which I want to be able to show and hide via a menu command. Problem is, for some reason, when I hide it, it greys out the menu command to bring it back! Here is what I think is the applicable code:
style = WINDOW_TITLEBAR | WINDOW_CLIENTCOORDS | WINDOW_MENU
window:TGadget = CreateWindow("Tile Pallate", 20, 20, 32*6, 32*12, Null, style)
masterWindow:TGadget = CreateWindow("",0,0,0,0, Null, WINDOW_HIDDEN)
Menu:TGadget = CreateMenu("Tile Pallate",menuID, WindowMenu(masterWindow))
showHideMenu:TGadget = CreateMenu("Show Tile Pallate", showHideID, menu)
CheckMenu(showHideMenu)
UpdateWindowMenu(menu)
UpdateWindowMenu(showHideMenu)
'later on, when the menu item is selected:
If visible = 1 Then
visible = 0
UncheckMenu(showHideMenu)
HideGadget(window)
Else
visible = 1
CheckMenu(showHideMenu)
ShowGadget(window)
End If
UpdateWindowMenu(showHideMenu)
Also, I noticed the SetMenuText(menu:TGadget, text$) doesnt work or doesn't set the menu text that is visible! Anyway, please help, thanks, Will H. |
| ||
| UpdateWindowMenu(menu) UpdateWindowMenu(showHideMenu) menu & showHideMenu are NOT window...I'm at work but I think you need to use the window_handler to update the menu... byez |