[Gambas-user] New Systray

herberth guzman herberthguzman at gmail.com
Sun Apr 26 19:32:59 CEST 2020


Hi

I cannot solve the problem of the system tray with gambas3-gb-qt5
but my temporary solution to my project is to work my OS in debian
and not in ubuntu to continue with gambas3-gb-qt4 and in the future see if
I work with gambas3- gb-gtk3
but at the moment it gives me errors with this component, my project
doesn't work.

Regards


El jue., 23 abr. 2020 a las 10:59, herberth guzman (<
herberthguzman at gmail.com>) escribió:

> The code is:
>
> ' Gambas class file
>
> Private $hTrayIcons As New TrayIcon[]
> Public Sub Form_Open()
> Dim hTray As TrayIcon
>
>   Dim i As Integer
>   Dim hDBusApplication As DBusApplication
>   Dim hConnection As DBusConnection
>   Dim hDBusProxy As DBusProxy
>   Dim sDBusName, sDBusObjectPath, sDBusInterface As String
>   Dim aChildren As New String[]
>   Dim aVal As Variant[]
>   Dim s As String
>
>
>   sDBusName = "org.freedesktop.NetworkManager"
>   hConnection = DBus.System
>   hDBusApplication = New DBusApplication(hConnection, sDBusName)
>
>   sDBusObjectPath = "/org/freedesktop/NetworkManager"
>   sDBusInterface = "org.freedesktop.NetworkManager"
>   hDBusProxy = New DBusProxy(hDBusApplication, sDBusObjectPath,
> sDBusInterface)
>
>   aChildren = hDBusProxy.Children
>
>   txaReport.Insert(gb.NewLine)
>   For i = 0 To aChildren.Max
>     txaReport.Insert(sDBusObjectPath &/ aChildren[i] & gb.NewLine)
>   Next
>
>   s =
> DBus["system://org.freedesktop.NetworkManager"]["/org/freedesktop/NetworkManager",
> "org.freedesktop.NetworkManager"].GetAllDevices().Join("\n")
>  Print s
>
>  If s Then
>     hTray = New TrayIcon
>     hTray.Name = s
>     $hTrayIcons.Add(hTray)
>     hTray.Icon = Picture["icon:/32/connect"]
>     Endif
>   'Next
>
>    dwgSystemTray.Refresh
>
> End
>
> El mié., 22 abr. 2020 a las 21:44, herberth guzman (<
> herberthguzman at gmail.com>) escribió:
>
>> Hi Benoit
>>
>> I don't have the necessary knowledge for everything I want to do, but I
>> try.
>>
>> I want to make a system tray, could you check my code please.
>>
>> Could you help me as I managed to get the popup menu of networkmanager
>> (example list of wifi networks) by clicking on the icon of the network menu
>> and at the same time if you think I am on the right path to continue or
>> could you advise me please.
>>
>> i need my new system tray
>>
>> at the moment i need networkmanager
>> but in the future I need to show any app in the systray (example vlc,
>> audio, others)
>>
>> thank you very much
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200426/e4648a3d/attachment-0001.html>


More information about the User mailing list