TextGadget on PanelGadget with panels with background color
Posted: Wed Jun 07, 2023 12:14 pm
The code I put together below works fine with PB 6.01.
With PB 6.02 the TextGadget(10,50,60,100,20,"ddgdfswewe") has a black background color, and nothing can be read.
The solutions I found are using ImageGadget() or ContainerGadget() to get the background color of the PanelGadget, or activating the commented line in the code SetGadgetColor(10,#PB_Gadget_BackColor,$ABABAB).
Any of these solutions requires changing many points of the application.
Is there a simpler solution?
Or wait for this problem to be fixed in future versions?
(The problem was found on Win 10 and Win 11.)
Thanks in advance for any ideas.
With PB 6.02 the TextGadget(10,50,60,100,20,"ddgdfswewe") has a black background color, and nothing can be read.
The solutions I found are using ImageGadget() or ContainerGadget() to get the background color of the PanelGadget, or activating the commented line in the code SetGadgetColor(10,#PB_Gadget_BackColor,$ABABAB).
Any of these solutions requires changing many points of the application.
Is there a simpler solution?
Or wait for this problem to be fixed in future versions?
(The problem was found on Win 10 and Win 11.)
Thanks in advance for any ideas.
Code: Select all
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")
PanelGadget (1, 5, 5, 290, 166)
AddGadgetItem(1, -1, "Sub-Panel 1")
AddGadgetItem(1, -1, "Sub-Panel 2")
AddGadgetItem(1, -1, "Sub-Panel 3")
CloseGadgetList()
AddGadgetItem (0, -1,"Panel 2")
ButtonGadget(2, 10, 15, 80, 24,"Button 1")
ButtonGadget(3, 95, 15, 80, 24,"Button 2")
TextGadget(10,50,60,100,20,"ddgdfswewe")
; SetGadgetColor(10,#PB_Gadget_BackColor,$ABABAB)
CloseGadgetList()
SetGadgetState(0, 1)
brush = CreateSolidBrush_($ABABAB)
SetWindowTheme_(GadgetID(0), @null.w, @null.w)
SetClassLongPtr_(GadgetID(0), #GCL_HBRBACKGROUND, brush)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf