implements a tray icon.
typically responds to either the DblClick Ngjarje
to initiate a preset action (for instance to restore a minimized Form
) or the Menu
produce a popup Menu
. My observations are that creating a popup on the fly is troublesome
and that it is best to create a "stub" Menu
in your Form
and set that menu's Enabled Vetia
and its Visible
property to FALSE
. Then you can add and remove items with ease to match the current state of the
application in the available popup menu options.
You can also use the ToolTip
property of the TrayIcon
to display application status
when such behavior is appropriate to your particular project.
You create a hidden invisible menu in your main form called TrayMenu
is also TrayMenu
. You give your TrayIcon control the Identifikuesi MyTrayIcon
. You want
to create a context menu for your TrayIcon
. For this example TrayMenu
need to be in the same Form
In the form containing MyTrayIcon
Public Sub MyTrayIcon_Menu()
There may be stability issues with the use of this control at present.
In my attempt to use this control I've had the KDE panel segfault (crash) on several
occasions after a number of edit/run cycles of a Gambas
project using a TrayIcon in the
--Brian Jack 2006.01.29 02:28 PST
Can you be more precise about what is troublesome in creating a popup menu?
--Benoit Minisini 2006.01.29 22:59 CET
If you use the Form
as a parent and create the popup Menu
you need to add a bunch of bookkeeping to make sure the menu is only created once otherwise a menubar with several copies of the popup menu results. Since I do not believe there is a way to delete objects at this time it is just as well to make a persistent Menu
within the Form
in the IDE Menu Editor
then call it up from the TrayIcon's Menu
--Brian Jack 2006.02.02 09:49 PST