Page 1 of 1

HyperLink in menu item

Posted: Thu May 31, 2012 11:38 am
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.

Re: HyperLink in menu item

Posted: Thu May 31, 2012 12:52 pm
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

Re: HyperLink in menu item

Posted: Thu May 31, 2012 1:14 pm
by +18
yes , thanks IdeasVacuum