PB 6.30 b4 - specified #SysTray is not initialised

Post bugreports for the Linux version here
User_Russian
Addict
Addict
Posts: 1590
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

PB 6.30 b4 - specified #SysTray is not initialised

Post by User_Russian »

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - SysTray example file
;
;    (c) Fantaisie Software
;
; ------------------------------------------------------------
;
; Note: on some Linux distributions (like Ubuntu), the systray icons can be hidden by default. For more information
; see this link: http://ubuntugenius.wordpress.com/2011/06/25/ubuntu-11-04-fix-show-all-iconsindicators-in-unity-panels-notification-area/
;


If OpenWindow(0, 100, 150, 300, 100, "PureBasic - SysTray Example", #PB_Window_SystemMenu)

  CompilerIf #PB_Compiler_OS = #PB_OS_Windows
    ; .ico format is available only on Windows
    IconName$ = #PB_Compiler_Home + "examples/sources/Data/CdPlayer.ico"
  CompilerElse
    UsePNGImageDecoder()
    IconName$ = #PB_Compiler_Home + "examples/sources/Data/world.png"
  CompilerEndIf
  
  AddSysTrayIcon(1, WindowID(0), LoadImage(0, IconName$))
  AddSysTrayIcon(2, WindowID(0), LoadImage(1, IconName$))
  SysTrayIconToolTip(1, "Icon 1")
  SysTrayIconToolTip(2, "Icon 2")
  
  Repeat
    Event = WaitWindowEvent()
    
    If Event = #PB_Event_SysTray
      If EventType() = #PB_EventType_LeftDoubleClick
        MessageRequester("SysTray", "Left DoubleClick on SysTrayIcon "+Str(EventGadget()),0)
        
        ChangeSysTrayIcon (EventGadget(), LoadImage(0, IconName$))
        SysTrayIconToolTip(EventGadget(), "Changed !")
      EndIf
      
    EndIf
  Until Event = #PB_Event_CloseWindow
  
EndIf
In Raspberry Pi OS (Kernel 6.12, Debian 12) when using gtk2 and gtk3 subsystems an error message appears
[ERROR] The specified #SysTray is not initialised.
at the line

Code: Select all

SysTrayIconToolTip(1, "Icon 1")
There is no such error with the qt subsystem.
User avatar
mk-soft
Always Here
Always Here
Posts: 6320
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB 6.30 b4 - specified #SysTray is not initialised

Post by mk-soft »

PB v6.xx:
OS Mint Linux LMDE 6:

Not any systray visible :(

This work for me:
viewtopic.php?t=82948
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply