[MAXGUI] Extreme flickering in Listboxes (Win32)

BlitzMax Forums/BlitzMax Programming/[MAXGUI] Extreme flickering in Listboxes (Win32)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi!

I have the problem that the listboxes flicker extremely on the screen. This goes for Listboxes with text only, only icons and
text + icons.

You can see this best when you resize a window.
The Listbox is cleared and redrawn frequently, so you see a "white" Listbox inbetween, which is very annoying.

I made up an example code with a larger icon listbox. It needs an image called "0.jpg". (any size will do)



Try to reisize the window sidways. And you see it at its best.

' Listbox extreme (tm) flickering bug example by Grisu

Const MAXFOLGEN=131 ' Icons
Const ICONSIZE=96 'Pixels

Local style:Int = WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_CLIENTCOORDS | WINDOW_MENU '| WINDOW_HIDDEN'|WINDOW_STATUS 
Global MyWindow:TGadget=CreateWindow("Resizing right <> left   or scrolling", (GadgetWidth(Desktop ())-792)/2,(GadgetHeight(Desktop ())-400)/2,792,400,Null,style)

Global ClientW:Int=ClientWidth(MyWindow)  
Global ClientH:Int=ClientHeight(MyWindow)
Global CanH:Int = (ClientH-401)/2
Global CanW:Int = (ClientW-792)/2

' Create the large iconstripfile if not present already
If FileType("iconstrip.png")=0 Then   
 Global Fullpixmap:TPixmap=CreatePixmap(((MAXFOLGEN)*ICONSIZE),ICONSIZE,PF_BGR888,1) 
 Local tmppixmap:TPixmap 

 For Local i:Int=0 To MAXFOLGEN-1  
    tmppixmap=LoadPixmap("0.jpg")  '96x96 Pixel icon!
    fullpixmap.paste(ResizePixmap(tmppixmap,ICONSIZE-2,ICONSIZE-2),1+i*ICONSIZE,1)
 Next 
 SavePixmapPNG(fullpixmap, "iconstrip.png",9 )
EndIf 

Local IconStrip:TIconStrip=LoadIconStrip(MaskPixmap(LoadPixmap("iconstrip.png"),-1,-1,-1))

' Create Listbox
Global ListBox:TGadget=CreateListBox(3,5,ICONSIZE+28,ClientH-10,MyWindow,0)
SetGadgetIconStrip(ListBox, IconStrip)

SetGadgetLayout (ListBox:TGadget, EDGE_ALIGNED,0,EDGE_ALIGNED,EDGE_ALIGNED)
SetGadgetIconStrip(ListBox, IconStrip)

' Adding some test icons
For Local j=0 To MAXFOLGEN-1
  AddGadgetItem ListBox, "", GADGETITEM_NORMAL, j, "this is icon no. "+ j
Next

While True
	WaitEvent 
	'Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend


Is there a workaround for this?
I know Mark's team has a lot to fix, but please fix this as well. Will you?

Grisu