Page 1 of 1

Purebasic 6.10 - #PB_Event_SysTray

Posted: Sat Apr 06, 2024 11:19 pm
by Ausprobieren
Hello friends,
i try following coding:

Code: Select all

; Unsichtbares Fenster, um nur den Systray anzuzeigen
  OpenWindow(0, 0, 0, 10, 10, "", #PB_Window_Invisible)
  UsePNGImageDecoder()
  AddSysTrayIcon(0, WindowID(0), LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/world.png"))
  ; Erstellt ein Popup-Menü, das im Systray im Systray-Look angezeigt wird
  CreatePopupImageMenu(0, #PB_Menu_SysTrayLook)
    MenuItem(0, "About PureBasic...")
    MenuBar()
    MenuItem(1, "Exit")
  ; Verknüpft das Menü mit dem Systray
;   SysTrayIconMenu(0, MenuID(0))
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_SysTray
        Debug "#PB_Event_SysTray"   
        
      Case #PB_Event_Menu
        Select EventMenu()
          Case 1 ; Exit 
            RemoveSysTrayIcon(0)
            End
        EndSelect
    EndSelect
  ForEver
The result is:
[00:02:58] Warte auf den Start des Executable...
[00:02:58] Executable-Typ: Linux - x64 (64bit, Unicode, Purifier)
[00:02:58] Executable gestartet.
[00:02:58] [WARNING] Test610.pb (Zeile: 17)
[00:02:58] [WARNING] Gdk (CRITICAL): gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
[00:03:04] Das Programm wurde beendet.
I cannot understand it. The first is: no reaction on the var <#PB_Event_SysTray> and then the message
Gdk (CRITICAL): gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
What means the compiler with this messages????

Can anybody explain me this message?! And the net is: I cannot use the version 6.10, because i query this interrupt "#PB_Event_SysTray" in a lot of progams. An this does not exist for Purebasic 6.10

Thanks for any help.

Ingo

Re: Purebasic 6.10 - #PB_Event_SysTray

Posted: Sat Apr 06, 2024 11:43 pm
by mk-soft

Code: Select all

Gdk (CRITICAL): gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
You can ignore this message. Only occurs sometimes and depending on the linux distribution.

The second point is more difficult:
With the last GTK3 version, the old GTK internal Systray was finally removed from the GTK3 system.
So a replacement had to be found. This is the much used libappindicator3-1. This is now also used by PureBasic v6.10.
However, this does not provide a mouse click event and only the possibility to connect a menu. The 'scroll-event' is supported, but I don't know what this is good for.

How the libappindicator works and what is possible, you can see with my example.
Link: Linux AppIndicator

Re: Purebasic 6.10 - #PB_Event_SysTray

Posted: Fri Aug 09, 2024 5:52 pm
by Fred
To move to doc. The Systray event is no more supported on Linux, a menu is needed to interact with it.+

Re: Purebasic 6.10 - #PB_Event_SysTray

Posted: Tue Aug 13, 2024 10:48 pm
by Andre
Related to this already open bug-report: https://www.purebasic.fr/english/viewtopic.php?p=621241

@Fred should take a look, which notes should be added to the docs...