HyperLink in menu item

Just starting out? Need help? Post your questions and find answers here.
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

HyperLink in menu item

Post by +18 »

is there a tip for use HyperLink into a pop-up menu or menu or sub-menu items?
i search in forums and don't find a thing.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: HyperLink in menu item

Post by IdeasVacuum »

Like this:

Code: Select all

Procedure Win()
;--------------

       If OpenWindow(0, 0, 0, 200, 140, "Links Menu",#PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)

                  If CreateMenu(0, WindowID(0))

                         MenuTitle("Hyperlinks")
                          MenuItem(1, "PB Website")
                          MenuItem(2, "PB Blog")
                          MenuItem(3, "PB Forum")
                  EndIf
       EndIf

EndProcedure

Procedure WaitForUser()
;---------------------

     Repeat
                   iEvent.i = WaitWindowEvent(1)
            Select iEvent

                         Case #PB_Event_Menu

                               Select EventMenu()
                           
                                             Case 1 : RunProgram("http://www.purebasic.com")
                                             Case 2 : RunProgram("http://www.purebasic.fr/blog")
                                             Case 3 : RunProgram("http://www.purebasic.fr/english/index.php")
                               EndSelect
            EndSelect

     Until iEvent = #PB_Event_CloseWindow

EndProcedure

;###Main Entry Point
Win()
WaitForUser()
End
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Re: HyperLink in menu item

Post by +18 »

yes , thanks IdeasVacuum
Post Reply