[Gambas-user] Balloon.Info on TrayIcon

Michael A. Capone mcapone at ...3429...
Thu Feb 12 01:23:21 CET 2015


Hi folks,

First of all, a big THANK YOU for the creation of Gambas!  It has 
allowed us to port legacy VB code to linux and get several of our users 
off the Windows platform.

I've searched everywhere for this, and seen several requests, but no 
satisfactory answer.

Is there any way to implement a Balloon message that can be attached to 
a tray icon?  This is common functionality that is seen in many 
applications.  Unfortunately, TrayIcons are "Classes", not "Controls", 
so when you call

    Balloon.Info("Hello World", myTrayIcon)

... you get the error "Expected 'Control', got 'TrayIcon'".

I've found this question in mailing lists going back to 2008, but no 
answer.

My workaround is to render a small form in the lower right hand corner 
of the screen, put a tiny label on the tiny form, and have that label be 
the Control that the balloon attaches to.  A timer then closes the form 
after a few seconds.

The problem with that solution is that the newly rendered form steals 
focus from whatever application is currently running.  So if I'm typing 
away in an e-mail, and my miniature balloon form loads, my e-mail client 
loses focus.

I'm using gb.qt on Gambas 3.5.0; QT certainly has support for this 
(http://qt-project.org/doc/qt-4.8/desktop-systray.html), although I'll 
admit I know next to nothing about QT programming.  But is this a 
feature that can be built into the TrayIcon class, perhaps in the form 
of TrayIcon.Balloon.Info?  Or, is there a way to do that that I'm not 
familiar with yet?

Thanks so much!
Michael




More information about the User mailing list