I came up with this, and it's a mess, but will help me to understand some things.
The program doesn't allow the Comboboxgadget to be used as it is, I can uncomment the line mentioned and that allows it to work, but either way it disappears after minimize and restore, until it is hovered over.
Why does setgadgetstate not allow this to work correctly? I need to use imagegadget, which creates an image gadget that is already created.
And why does the Comboboxgadget disappear, and how can I make it reappear after window restore?
Code: Select all
Enumeration
#Menu_Escape
#Menu_Space
#Menu_Enter
#Menu_W
#Menu_C
#Menu_E
#Menu_P
#Menu_O
#Menu_A
EndEnumeration
entry.s =""
OpenWindow(0, 0, 0, 800, 800, "Combo After Minimize Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
image=CreateImage(0, 800, 800)
ImageGadget(0, 0, 0, 800,800, ImageID(0))
AddKeyboardShortcut(main, #PB_Shortcut_Escape, #Menu_Escape)
AddKeyboardShortcut(main, #PB_Shortcut_Space, #Menu_Space)
AddKeyboardShortcut(main, #PB_Shortcut_Return, #Menu_Enter)
AddKeyboardShortcut(main, #PB_Shortcut_C, #Menu_C)
AddKeyboardShortcut(main, #PB_Shortcut_P, #Menu_P)
AddKeyboardShortcut(main, #PB_Shortcut_O, #Menu_O)
AddKeyboardShortcut(main, #PB_Shortcut_A, #Menu_A)
ComboBoxGadget(7, 20, 600, 150, 19, #PB_ComboBox_Editable)
StartDrawing(ImageOutput(0))
Box(0, 0, 800, 800, #White)
SetGadgetText(7,"Initial State")
Entry = GetGadgetText(7)
AddGadgetItem(7, 0, Entry)
SetGadgetState(7, 0)
DrawText(301+x*14,400,"Some Text",0,#White)
StopDrawing()
SetGadgetState(0, ImageID(0))
;ImageGadget(0, 0, 0, 800, 800, ImageID(0)) ; If I uncomment the code on this line it works
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu()
Case #Menu_C
Case #Menu_O
Case #Menu_P
Case #Menu_Escape
quit=#True
Case #Menu_Space
Case #Menu_Enter
Entry = GetGadgetText(7)
EndSelect
Case #PB_Event_Gadget
EventGadget = EventGadget()
Select EventGadget
EndSelect
Case #PB_Event_CloseWindow
Quit=#True
EndSelect
Until quit=#True Or Event = #PB_Event_CloseWindow