Try this code (creating the menu with the IDE gambas): ' Gambas class file
Public $hTray As TrayIcon Public Sub _new() $hTray = New TrayIcon As "tyIcon" '$hTray.Icon = Picture["griG.png"] $hTray.PopupMenu = "myMenu" $hTray.Show myMenu.Hide End Public Sub Form_Open() Me.Close End Public Sub Menu2_Click() Message("The Menu2 was clicked") End Public Sub Menu3_Click() Message("The Menu3 was clicked") End Public Sub Menu4_Click() $hTray.Hide End 2016-10-03 21:34 GMT+02:00 Demosthenes Koptsis <demosthen...@gmail.com>: > If i create the Menu with IDE Gambas it will be a menu on top of the form. > > Creating the menu by code it is ok now. > The only change to work was to add at the end of New() the event name > > hMenu = New Menu(Me, True) As "RootMenu" > hMenu2 = New Menu(hMenu) As "Menu2" > hMenu3 = New Menu(hMenu) As "Menu3" > > On 3/10/2016 22:25 μμ, Gianluigi wrote: > > I think it's better to create the menu with the IDE gambas. > > Create the TrayIcon as in this thread [0] and close the window into > > Form_Open. > > > > [0] http://gambas.8142.n7.nabble.com/TrayIcon-question-td55955.html > > > > 2016-10-03 21:16 GMT+02:00 Demosthenes Koptsis <demosthen...@gmail.com>: > > > >> Hi, > >> > >> i try to Run the systray project in Linux Mint 18 Mate x64, edition > >> > >> and i get > >> > >> "sni-qt/3330" WARN 22:10:44.398 void > >> StatusNotifierItemFactory::connectToSnw() Invalid interface to > SNW_SERVICE > >> > >> finally the project cannot run > >> > >> > >> > >> ------------------------------------------------------------ > >> ------------------ > >> Check out the vibrant tech community on one of the world's most > >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot > >> _______________________________________________ > >> Gambas-user mailing list > >> Gambas-user@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/gambas-user > >> > > ------------------------------------------------------------ > ------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user