Page 1 of 1

ListIconGadget on a PanelGadget flickers when resized

Posted: Mon Sep 04, 2017 9:09 am
by Dude
When two ListIconGadgets are placed on a PanelGadget and the window is resized vertically, the second ListIconGadget() flickers badly. :(

It's so bad that an entire DeFlicker module was written by PureLust to fix it (see http://www.purebasic.fr/english/viewtop ... 60#p511260).

If you set #EnablePanel=0 in this example and then resize the window vertically, there is NO flickering at all.

So, I'd like to see this problem fixed so that the large dedicated deflicker module isn't needed at all.

Code: Select all

#EnablePanel=1 ; If set to 1, it makes ListIconGadget #2 flicker badly when window is resized vertically!

OpenWindow(0, 200, 200, 230, 180, "SplitterGadget", #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)

CreateStatusBar(0,WindowID(0))

CompilerIf #EnablePanel=1
  PanelGadget(0, 10, 10, 210, 160)
  AddGadgetItem(0,-1,"Tab 1")
CompilerEndIf

ListIconGadget(1, 10, 10, 200, 150, "1", 200)
For i=1 To 100
  AddGadgetItem(1, -1, Str(i))
Next

ListIconGadget(2, 10, 10, 200, 150, "2", 200)
For i=1 To 100
  AddGadgetItem(2, -1, Str(i))
Next

SplitterGadget(3, 10, 10, 180, 110, 1, 2, #PB_Splitter_Vertical | #PB_Splitter_Separator | #PB_Splitter_FirstFixed)

CompilerIf #EnablePanel=1
  AddGadgetItem(0,-1,"Tab 2")
  CloseGadgetList()
CompilerEndIf

Procedure ResizeApp()
  appw=WindowWidth(0)
  apph=WindowHeight(0)
  CompilerIf #EnablePanel=1
    ResizeGadget(0,#PB_Ignore,#PB_Ignore,appw-20,apph-40)
  CompilerEndIf
  ResizeGadget(3,#PB_Ignore,#PB_Ignore,appw-45,apph-90)
EndProcedure

Procedure Callback(hWnd,Message,wParam,lParam)
  result=#PB_ProcessPureBasicEvents
  If Message=#WM_WINDOWPOSCHANGED
    ResizeApp()
  EndIf
  ProcedureReturn result
EndProcedure

SetWindowCallback(@Callback())

ResizeApp() ; Set initial size.

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: ListIconGadget on a PanelGadget flickers when resized

Posted: Mon Sep 04, 2017 9:35 am
by Fred
It's not really a bug, but it could be enhanced.

Re: ListIconGadget on a PanelGadget flickers when resized

Posted: Mon Sep 04, 2017 1:09 pm
by User_Russian
Add
SmartWindowRefresh(0, 1)
after OpenWindow.

Re: ListIconGadget on a PanelGadget flickers when resized

Posted: Mon Sep 04, 2017 1:16 pm
by Dude
SmartWindowRefresh(0,1) certainly helps in this example, but it doesn't help at all in a bigger source that I had. I ended up having to use PureLust's excellent "DeFlicker" module (http://www.purebasic.fr/english/viewtop ... 12&t=65364) to fix the problem.

So the purpose of this post was to try to get an official flicker-fix done to fix the short-coming of SmartWindowRefresh().

Re: ListIconGadget on a PanelGadget flickers when resized

Posted: Thu May 24, 2018 12:02 pm
by Lebostein
I have the same problem. With some more gadgets SmartWindowRefresh don't help... any other hints to fix this issue?