Hi,
is anyone able to point me how I change the Application name, and access the About and Settings menus on MacOS?
- The Application menu is called "PureBasic.0"
- "About PureBasic.0" is disabled, as is "Settings."
Can't find anything with an example, and the manual doesn't appear to reference this apart from the constants.
Thanks in advance!
MacOS Application Menu
Re: MacOS Application Menu
Use the constants as the MenuItemID:
PureBasic.0 will change when you build your program as an executable. It uses the name you use for the executable.
Code: Select all
Global quit
Procedure OnPreferencesClicked()
MessageRequester("Preferences", "Preferences...")
EndProcedure
Procedure OnAboutClicked()
MessageRequester("About", "My Application")
EndProcedure
Procedure OnQuitClicked()
If MessageRequester("Quit", "Do you want to quit?", #PB_MessageRequester_YesNo) = #PB_MessageRequester_Yes
quit = #True
EndIf
EndProcedure
Procedure OnWindowClosed()
quit = #True
EndProcedure
OpenWindow(0, 0, 0, 320, 240, "My Application", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CreateMenu(0, WindowID(0))
MenuItem(#PB_Menu_Preferences, "")
MenuItem(#PB_Menu_About, "")
MenuItem(#PB_Menu_Quit, "")
BindMenuEvent(0, #PB_Menu_Preferences, @OnPreferencesClicked())
BindMenuEvent(0, #PB_Menu_About, @OnAboutClicked())
BindMenuEvent(0, #PB_Menu_Quit, @OnQuitClicked())
BindEvent(#PB_Event_CloseWindow, @OnWindowClosed())
Repeat : WaitWindowEvent() : Until quitRe: MacOS Application Menu
Thank you so much! I only need to add the create menu part, thought this was odd as they ware already there.

