It is currently Tue Sep 25, 2018 12:19 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [Done] Qt-PanelGadget OpenGadgetList() must be called before
PostPosted: Sun Jun 10, 2018 10:42 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 257
Location: Germany
Here is a fix for the Qt-PanelGadget:
Code:
; Fixes the error "OpenGadgetList() must be called before"
CompilerIf Subsystem("Qt")
 
  Procedure AddGadgetItem2(Gadget, Position, Text$, ImageID, Flags)
    If GadgetType(Gadget) = #PB_GadgetType_Panel
      OpenGadgetList(Gadget)
    EndIf
    ProcedureReturn AddGadgetItem(Gadget, Position, Text$, ImageID, Flags)
  EndProcedure
 
  Macro AddGadgetItem(_Gadget_, _Position_, _Text_, _ImageID_=0, _Flags_=0)
    AddGadgetItem2(_Gadget_, _Position_, _Text_, _ImageID_, _Flags_)
  EndMacro
 
CompilerEndIf

If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  PanelGadget(0, 8, 8, 306, 203)
  AddGadgetItem(0, -1, "Panel 1")
  AddGadgetItem(0, -1, "Panel 2") ; <<<< Crash without the fix
  AddGadgetItem(0, -1, "Panel 3")
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
Image
Why OpenSource should have a license
PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!
Manjaro Xfce x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
 Post subject: Re: Fix Qt-PanelGadget: OpenGadgetList() must be called befo
PostPosted: Mon Jun 11, 2018 4:45 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jul 19, 2013 7:36 am
Posts: 160
Location: Novosibirsk
confirmed. !!!
analogue Lubuntu 18.04(x32) Runtu Lite 18.04(x32) https://distrowatch.com/table.php?distribution=runtu

_________________
Dawn will come inevitably.
His (http://translate.yandex.ru/) English is not as good as we would like
If the English text is not correct, please correct me in private message


Top
 Profile  
Reply with quote  
 Post subject: Re: Fix Qt-PanelGadget: OpenGadgetList() must be called befo
PostPosted: Tue Jun 19, 2018 6:59 pm 
Offline
User
User
User avatar

Joined: Mon Mar 08, 2010 9:14 pm
Posts: 91
Location: "Mens sana in corpore sano"
Confirmed in Ubuntu 18.04 LTS

_________________
Greetings and thanks!

Romerio Medeiros
romerio@gmail.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Fix Qt-PanelGadget: OpenGadgetList() must be called befo
PostPosted: Wed Jul 04, 2018 7:56 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13371
Location: France
Fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye