Attach "File Menu" to "Main window" ?
BlitzPlus Forums/BlitzPlus Beginners Area/Attach "File Menu" to "Main window" ?
| ||
Hi all. As the title says, how do I grab the window handle of the main window created by Graphics(800, 600, 0, 2) and attach a file menu to it? I need it for a program I'm making. :) Thank You! |
| ||
Hi I have no BlitzPlus... but I suspect that if you open a Graphics screen you can't have a 'window with menu bar' on it (or you need to create your own GUI). I think you need to use CreateWindow and then CreateMenu (this is what we do in BlitzMax+MaxGUI) |
| ||
... Well there IS a way, but I need to know how to make the "CreateWindow()" move with the Graphics() window when dragging the Graphics() window. |
| ||
I remember that for a screen to have a menu you must use the gui commands. Use a canvas to draw the game graphics on. I think you then need to work with the interuptions codes. I never had the graphics command work with the gui menu commands. |
| ||
There actually IS a way using the win32 api. But I'm not sure exactly which command grabs the main window handle. I use api_GetActiveWindow() which is close, but that only grabs the currently active window. It doesn't grab the actual main window handle. |
| ||
Why not use a canvas? |
| ||
Because unfortunately a canvas won't work for blitz+ hardwired. What I'm essentially trying to do is get the main window's handle so I can use WinBlitz3D to create the file menu, and the original gadgets in Blitzplus to create the GUI basically. If you need me to, I can try to explain a bit more in-depth. Thanks ALOT for the help as usual! :) Sincerely, ~GF |
| ||
There is a "game menu" in the Code Archives section. I can't remember the exact name. I tried the demo, and it works good, and will work in graphics mode and it will have the games menu feel to it. I Will probably use it in my game. Looks like it's very well written code too. IT doesn't have the File menu built in, but I plan on adding that to his code. |
| ||
Great! Can you show me an example when you finish it? Thanks alot! :) |
| ||
You can find an example if you click help>samples>windowedgame It uses createwindow() and createcanvas() |
| ||
Hey, thanks alot Dan! :) |