ListIconGadget- slow and lazy horizontal scrolling (Win)

Just starting out? Need help? Post your questions and find answers here.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Lebostein »

Why the horizontal scrolling of the ListIconGadget is so slow and lazy with Windows? It seems the header line moves even slower than the rest. Feels very unsatisfactory... the list is not huge. Twenty colums and 80 rows... It feels slower than Excel 5 für Windows 3.1 on my 486...
I have compiled the same code for Mac OS: Very fast ans smooth scrolling - very fast with 10000 lines too. What is wrong here?
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Lebostein »

Here a simple code to test:

Code: Select all

OpenWindow(0, 0, 0, 1200, 700, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0,  0, 0, 1200, 700, "Column 0", 120, #PB_ListIcon_FullRowSelect | #PB_ListIcon_GridLines)
For col = 1 To 30
  AddGadgetColumn(0, col, "Column " + Str(col), 120)
Next col
For row = 0 To 120
  AddGadgetItem(0, row, "")
  For col = 0 To 30
    SetGadgetItemText(0, row, "text entry (" + Str(col) + "," + Str(row) + ")", col)
  Next col
Next row
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
If I scroll horizontaly I get massive scrolling lags. It seems the table header moves slower then the values. Can anyone confirm that?
I use Windows 10 here. With Mac OS scrolling in booth directions is extremely smooth and fast.
ebs
Enthusiast
Enthusiast
Posts: 530
Joined: Fri Apr 25, 2003 11:08 pm

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by ebs »

On my ancient Windows XP laptop, the headers and grid seem to scroll at the same rate.
I can't see any noticeable lag.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by srod »

Huge lag here on Win 7. Probably due to the custom draw techniques applied by Purebasic whilst the colors of each cell are looked up individually as they are painted etc.

Mind you, I just tried it with my EsGRID control which is based on a ListIcon and that uses similar custom draw and there is not as much lag. There was some however.
I may look like a mule, but I'm not a complete ass.
User avatar
Kiffi
Addict
Addict
Posts: 1357
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Kiffi »

Lebostein wrote:If I scroll horizontaly I get massive scrolling lags. It seems the table header moves slower then the values. Can anyone confirm that?
yes, confirmed,
Lebostein wrote:I use Windows 10 here.
same here.

Greetings ... Peter
Hygge
BarryG
Addict
Addict
Posts: 3324
Joined: Thu Apr 18, 2019 8:17 am

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by BarryG »

Very laggy on horizontal (but vertical) scrolling here, Win 10. I tried various API tricks but nothing fixed it.
neuronic
User
User
Posts: 98
Joined: Sat Apr 26, 2003 11:38 pm
Contact:

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by neuronic »

I have just checked the above code on Win 7 64bit PB 5.70.

If I turn on Enable modern theme support in Compiler Options, there is a huge lag.

If Enable modern theme support is disabled, there is no lag.
Bitblazer
Enthusiast
Enthusiast
Posts: 736
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Bitblazer »

win 7 x64 pb 5.71 - same effect - with modern theme support it lags, without theme support its fluid. The task manager shows one core close to 100% if theme support is enabled.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Lebostein »

Is this a problem of Windows or a glitch in PB?
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Shardik »

I have tested Lebostein's code example on Windows 10 x64 v1809 with PB 5.71 x86 and x64. I can confirm the lagged horizontal scrolling of the header cells when modern theme support is enabled.
Lebostein wrote:Is this a problem of Windows or a glitch in PB?
I have converted Lebostein's code example to C and compiled it with Pelles C 9.00.9 for Windows to x86 and x64 executables. Without modern theme support the horizontal scrolling is smooth (like in PureBasic). With modern theme support enabled no lagged scrolling of the header cells occurs. But in contrast to the PureBasic version the C version shows a marked lag in displaying the rightmost colums when moving the scrollbar to the right and the same lag in displaying the leftmost colums when moving the scrollbar to the left.

So in summary it's both a Windows problem (only caused in modern theme support) and a PureBasic problem. PureBasic doesn't exhibit the lagged display of the leftmost or rightmost columns of the C program but therefore introduces the lagged header cell scrolling...
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4663
Joined: Sun Apr 12, 2009 6:27 am

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by RASHAD »

The lag & the slowness depends heavily on the View Port
Purebasic take small percentage and the rest by Windows
Disable XP Theme and check the API version
It looks much better

Code: Select all

colinfo.LV_COLUMN 
colinfo\mask = #LVCF_TEXT|#LVCF_WIDTH|#LVCF_FMT 
colinfo\fmt = #LVCFMT_LEFT 
colinfo\cx = 160

hwnd = OpenWindow(0,0,0,800,600, "API Listview",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
lv = CreateWindowEx_(#WS_EX_STATICEDGE, "SysListView32", "MyListView", #LVS_REPORT | #WS_CHILD | #WS_VISIBLE | #WS_HSCROLL | #WS_VSCROLL , 10,10,780,580,hwnd,0,0,0) 
;SetWindowTheme_(lv, @"", @"")
For x = 0 To 30
  header$= "Column Header "+Str(x)
  colinfo\pszText = @header$
  SendMessage_(lv, #LVM_INSERTCOLUMN, x, @colinfo) 
Next

line.LV_ITEM 
line\Mask     = #LVIF_TEXT 
For i=0 To 120
  linetxt.s = "text entry "
  line\iitem = i
  line\pszText  = @linetxt
  SendMessage_(lv, #LVM_INSERTITEM, 0, @line)
  For c = 1 To 30
    col.LV_ITEM 
    coltext.s = "text entry " + Str(i) + " " +Str(c)
    col\Mask     = #LVIF_TEXT 
    col\iitem = i
    col\iSubItem = c
    col\pszText  = @coltext
    SendMessage_(lv, #LVM_SETITEM, 0, @col)
  Next
Next
Egypt my love
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by Lebostein »

With Mac OS it is sooo smoooth. No matter how many rows and columns.
that Windows scrolling lag gives me no peace...
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4663
Joined: Sun Apr 12, 2009 6:27 am

Re: ListIconGadget- slow and lazy horizontal scrolling (Win)

Post by RASHAD »

Minimize lagging

Code: Select all

OpenWindow(0, 0, 0, 1200, 700, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0,  0, 0, 1200, 700, "Column 0", 120, #PB_ListIcon_GridLines)
SendMessage_(GadgetID(0), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_DOUBLEBUFFER, 0)
For col = 1 To 30
  AddGadgetColumn(0, col, "Column " + Str(col), 120)
Next col
For row = 0 To 120
  AddGadgetItem(0, row, "")
  For col = 0 To 30
    SetGadgetItemText(0, row, "text entry (" + Str(col) + "," + Str(row) + ")", col)
  Next col
Next row

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Egypt my love
Post Reply