ListIconGadget on a PanelGadget flickers when resized

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

ListIconGadget on a PanelGadget flickers when resized

Post 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
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ListIconGadget on a PanelGadget flickers when resized

Post by Fred »

It's not really a bug, but it could be enhanced.
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: ListIconGadget on a PanelGadget flickers when resized

Post by User_Russian »

Add
SmartWindowRefresh(0, 1)
after OpenWindow.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: ListIconGadget on a PanelGadget flickers when resized

Post 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().
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: ListIconGadget on a PanelGadget flickers when resized

Post by Lebostein »

I have the same problem. With some more gadgets SmartWindowRefresh don't help... any other hints to fix this issue?
Post Reply