Panel beaters

Windows specific forum
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.

Hi,

Silly question, how do I use RemoveGadgetItem() with Panel gadgets? It's supposed to remove a panel, right?

What's wrong with this code then - it crashes on the RemoveGadgetItem() call (also happens when there are gadgets inside the panel, or if I give the panels correct numbers [i.e. 0,1,2 instead of -1,-1,-1], or if I put the RemovegadgetItem call before the ClosePanelGadget):

Code: Select all

If OpenWindow(0, 100, 300, 500, 300, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget, "Layout Test")

    If CreateGadgetList(WindowID())
        PanelGadget(0, 0, 0, 150, 60)
        AddGadgetItem(0, -1, "A")
        AddGadgetItem(0, -1, "Bg")
        AddGadgetItem(0, -1, "")
        ClosePanelGadget()
        
        RemoveGadgetItem(0,1)
    EndIf

    ; Main window loop
    quit.w=0
    While quit=0
        ev.l=WaitWindowEvent()
        Select ev
            Case #PB_EventCloseWindow : quit=1
        EndSelect
    Wend
    CloseWindow(0)
EndIf
End
I'll bet this is something idiotic that I've missed - I've been having a bad day like that :)
Thanks.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.10)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Already fixed for v3.20 (see bug report). Thanks...

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Already fixed for v3.20 (see bug report). Thanks...
Doh, I even posted in that thread. Told you I was having a bad day :)

--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.10)
Post Reply