FastObjectListView flickers in Windows 7 but not Mac 10.9 when adding object to sorted location

I’m using ObjectListView 1.2 and the column at index 0 is set as the sort column. I’m using FastObjectListView.

When I add an object in Windows the ListView flickers, however it does not in Mac

self.fileOlv.AddObject(songObject)

I do not experience a flicker when the list is unsorted and the object is added to the end of the list

self.fileOlv.SetSortColumn(column=None)

self.fileOlv.AddObject(songObject)

Any ideas on how to prevent the flicker?

What about:

self.fileOlv.Freeze()
self.fileOlv.SetSortColumn(column=None)
self.fileOlv.AddObject(songObject)
self.fileOlv.Thaw()

Werner

···

On 27/02/2014 07:32, RedHotChiliPepper wrote:

I'm using ObjectListView 1.2 and the column at index 0 is set as the sort column. I'm using FastObjectListView.

When I add an object in Windows the ListView flickers, however it does not in Mac

                self.fileOlv.AddObject(songObject)

I do not experience a flicker when the list is unsorted and the object is added to the end of the list

                self.fileOlv.SetSortColumn(column=None)
                self.fileOlv.AddObject(songObject)

Any ideas on how to prevent the flicker?

Hi Werner -

This code actually causes a flicker

self.fileOlv.Freeze()
self.fileOlv.SetSortColumn(column=None)
self.fileOlv.AddObject(songObject)
self.fileOlv.Thaw()

but this code does not

self.fileOlv.SetSortColumn(column=None)
self.fileOlv.AddObject(songObject)

Regardless, I am trying to avoid using this

self.fileOlv.SetSortColumn(column=None)

because I would like newly added objects to appear in their sorted position. In my app entries are sorted by their first column.

···

On Thursday, February 27, 2014 3:03:33 AM UTC-5, werner wrote:

On 27/02/2014 07:32, RedHotChiliPepper wrote:

I’m using ObjectListView 1.2 and the column at index 0 is set as the
sort column. I’m using FastObjectListView.

When I add an object in Windows the ListView flickers, however it does
not in Mac

            self.fileOlv.AddObject(songObject)

I do not experience a flicker when the list is unsorted and the object
is added to the end of the list

            self.fileOlv.SetSortColumn(column=None)
            self.fileOlv.AddObject(songObject)

Any ideas on how to prevent the flicker?

What about:

self.fileOlv.Freeze()

self.fileOlv.SetSortColumn(column=None)

self.fileOlv.AddObject(songObject)

self.fileOlv.Thaw()

Werner

Is this code called many times to add different objects, if yes then
maybe add the Freeze/Thaw to the caller of the method, i.e.
Freeze
add all objects
Thaw
Werner

···

On 27/02/2014 09:19, RedHotChiliPepper
wrote:

Hi Werner -

This code actually causes a flicker

self.fileOlv.Freeze()

      self.fileOlv.SetSortColumn(column=None) 

      self.fileOlv.AddObject(songObject) 

      self.fileOlv.Thaw() 

Hi Werner -

I did as you said

Freeze

add all objects

Thaw

but I still see the flicker in Windows. I’m attaching a copy of my code just so you can see what I’ve done.

drag_n_drop_simple.py (3.16 KB)

···

On Thursday, February 27, 2014 3:29:51 AM UTC-5, werner wrote:

  On 27/02/2014 09:19, RedHotChiliPepper > wrote:

Hi Werner -

This code actually causes a flicker

self.fileOlv.Freeze()

      self.fileOlv.SetSortColumn(column=None) 

      self.fileOlv.AddObject(songObject) 

      self.fileOlv.Thaw() 
Is this code called many times to add different objects, if yes then

maybe add the Freeze/Thaw to the caller of the method, i.e.

Freeze

add all objects

Thaw



Werner

Hi,

···

On 27/02/2014 10:29, RedHotChiliPepper wrote:

Hi Werner -

I did as you said

Freeze
add all objects
Thaw

but I still see the flicker in Windows. I'm attaching a copy of my code just so you can see what I've done.

I played a bit with it and I see the flicker too, as it has to do with sorting I wonder if OLV is doing the sorting delayed from the actual adding, so I tried this.

         wx.CallLater(50, self.fileOlv.Thaw)

That was enough to remove the flicker when I add 40 to 50 files.

Werner

The flicker is removed for the first 50ms during which the GUI hangs and does not update as each object is being added.

I would like the ListView to update as each object is being added without the flicker.

In my app there’s some additional processing on each file, so it takes about 1/5 second between each object being added to the ListView.

Unfortunately using wx.CallLater does not resolve the issue but I appreciate the suggestion.

···

On Thursday, February 27, 2014 5:49:18 AM UTC-5, werner wrote:

Hi,

On 27/02/2014 10:29, RedHotChiliPepper wrote:

Hi Werner -

I did as you said

Freeze

add all objects

Thaw

but I still see the flicker in Windows. I’m attaching a copy of my
code just so you can see what I’ve done.

I played a bit with it and I see the flicker too, as it has to do with
sorting I wonder if OLV is doing the sorting delayed from the actual
adding, so I tried this.

     wx.CallLater(50, self.fileOlv.Thaw)

That was enough to remove the flicker when I add 40 to 50 files.

Werner

Hi,

···

On 28/02/2014 09:28, RedHotChiliPepper wrote:

The flicker is removed for the first 50ms during which the GUI hangs and does not update as each object is being added.

I would like the ListView to update as each object is being added without the flicker.

In my app there's some additional processing on each file, so it takes about 1/5 second between each object being added to the ListView.

Unfortunately using wx.CallLater does not resolve the issue but I appreciate the suggestion.

These things are only always a work around at best and I don't like them.

Maybe it is time to take a step back and try to isolate if the problem is OLV or the under lying listctrl and then try to solve it where it really happens.

Werner