Scrolling through many panels

Hi,
being very new to GUI in general, I looked through the demo, but didn't find a container widget I liked. So I subclassed Panel, put a bunch of stuff in, and populated a ScrolledPanel (BoxSizer) with instances.

Works great. But with more than a hundred it gets slow and eats memory. I need up to 6000.

Cocoa has CollectionView, which is essentially ScrolledPanel and BoxSizer rolled into one plus a factory for your custom item class. It keps a few instances around, changes the data they display, and re-uses them on the other end to simulate scrolling through a huge list. I think wx calls this virtual.

I don't feel confident to clone this. Are there building blocks? Or an easy solution I overlooked?

Hello Tobias:

As a person who has been designing and implementing GUIs since Windows
3.0, it sounds like cruel and unusual punishment to me to force users
to scroll through 600 panels full of controls to find what they need.
Surely a splitter window with a 600 item tree or list on the left and
a single panel on the right would be a better design.

···

On Tue, May 19, 2009 at 7:56 PM, Tobias Weber <towb@gmx.net> wrote:

Hi,
being very new to GUI in general, I looked through the demo, but didn't find
a container widget I liked. So I subclassed Panel, put a bunch of stuff in,
and populated a ScrolledPanel (BoxSizer) with instances.

Works great. But with more than a hundred it gets slow and eats memory. I
need up to 6000.

Cocoa has CollectionView, which is essentially ScrolledPanel and BoxSizer
rolled into one plus a factory for your custom item class. It keps a few
instances around, changes the data they display, and re-uses them on the
other end to simulate scrolling through a huge list. I think wx calls this
virtual.

I don't feel confident to clone this. Are there building blocks? Or an easy
solution I overlooked?
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
Best Regards,
Michael Moriarity

Oops, I meant 6,000.

···

--
Best Regards,
Michael Moriarity

Unless there is something I really don't understand in terms of this GUI's
purpose, your point would have been just as good with 600, or 60, or maybe
even just 6, depending on the height and complexity of these panels. But
it's hard to imagine scrolling down through 6,000 of anything.

Has the OP seen this, CatalogCtrl?:

Not sure what the state of that is these days, or if it would be useful for
the OP's needs, but thought I'd mention it.

Che

···

On Tue, May 19, 2009 at 8:14 PM, Michael Moriarity <datasmith@gmail.com> wrote:

Oops, I meant 6,000.

Not quite full, but complex enough that I don't see how to get it into a Grid.

(bit like http://www.transmissionbt.com/images/screenshots/mac-large.png but nothing to do with torrents :wink:

Few users have more than a hundred, and most will enter a filter query first. But I need to think of the worst case.

···

On 20.05.2009, at 02:13, Michael Moriarity wrote:

force users to scroll through 600 panels full of controls to find what they need.

Looks nice, except "there is no way to add inline editing capabilities to the CatalogCtrl at this time".

I'll check out the links in that thread. Thank you!

BTW archive doesn't store their attached screenshots :frowning:

···

On 20.05.2009, at 02:34, C M wrote:

ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Hi,

ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Looks nice, except "there is no way to add inline editing capabilities to
the CatalogCtrl at this time".

I'll check out the links in that thread. Thank you!

BTW archive doesn't store their attached screenshots :frowning:

You can try and hack my UltimateListCtrl:

http://xoomer.alice.it/infinity77/main/UltimateListCtrl.html

and, in this particular case, you can use custom renderers for your
"cells" in UltimateListCtrl. Something like this:

index = self.list.InsertImageStringItem(sys.maxint, first_column_text,
first_column_image)
self.list.SetStringItem(index, 1, second_column_text) # text can be empty too

self.list.SetItemCustomRenderer(index, 1, TheRenderer)

where "TheRenderer" is your custom renderer, which draw the text and
bitmaps and gauges and whatever you wish in the second column. There
are 3 examples or custom renderers in the demo on my website.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Wed, May 20, 2009 at 9:31 AM, Tobias Weber wrote:

On 20.05.2009, at 02:34, C M wrote:

Hi,

···

On Wed, May 20, 2009 at 9:52 AM, Andrea Gavana wrote:

Hi,

On Wed, May 20, 2009 at 9:31 AM, Tobias Weber wrote:

On 20.05.2009, at 02:34, C M wrote:

ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Looks nice, except "there is no way to add inline editing capabilities to
the CatalogCtrl at this time".

I'll check out the links in that thread. Thank you!

BTW archive doesn't store their attached screenshots :frowning:

You can try and hack my UltimateListCtrl:

http://xoomer.alice.it/infinity77/main/UltimateListCtrl.html

and, in this particular case, you can use custom renderers for your
"cells" in UltimateListCtrl. Something like this:

index = self.list.InsertImageStringItem(sys.maxint, first_column_text,
first_column_image)
self.list.SetStringItem(index, 1, second_column_text) # text can be empty too

self.list.SetItemCustomRenderer(index, 1, TheRenderer)

where "TheRenderer" is your custom renderer, which draw the text and
bitmaps and gauges and whatever you wish in the second column. There
are 3 examples or custom renderers in the demo on my website.

Just for fun, this is what I came up using UltimateListCtrl on Windows
(no Mac here). Screenshot attached.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Tobias Weber wrote:

Hi,
being very new to GUI in general, I looked through the demo, but didn't find a container widget I liked. So I subclassed Panel, put a bunch of stuff in, and populated a ScrolledPanel (BoxSizer) with instances.

Works great. But with more than a hundred it gets slow and eats memory. I need up to 6000.

Cocoa has CollectionView, which is essentially ScrolledPanel and BoxSizer rolled into one plus a factory for your custom item class. It keps a few instances around, changes the data they display, and re-uses them on the other end to simulate scrolling through a huge list. I think wx calls this virtual.

I don't feel confident to clone this. Are there building blocks? Or an easy solution I overlooked?

One way to approach it is to do something like this:

  * Use a plain panel instead of a scrolled panel

  Create enough of the subpanels to fill the panel, and add a wx.ScrollBar on the side.

  * if not already then disconnect the data to be displayed from your subpanels such that they do not depend on each other. In other words, the widgets should not be the in-memory storage place for the data, there should be just a loose coupling between them.

  * When you get events from the scrollbar just adjust which of the data items each of the subpanels is displaying by changing the reference from the subpanel to the data item and refreshing.

In other words, instead of scrolling the widgets, you are "scrolling" which of the data items that the widgets are displaying.

···

--
Robin Dunn
Software Craftsman

Michael Moriarity wrote:

Oops, I meant 6,000.

600 might also be too much.

···

--
Robin Dunn
Software Craftsman

Yes, I thought about such a simplified CollectionView. But I don't think that would feel like scrolling at all.

The reason I present information in this way is that it doesn't lend itself well to search. Users need to scan. And (without having tried it) I fear that if things don't visibly move you don't notice changes as quickly.

···

On 21.05.2009, at 05:05, Robin Dunn wrote:

In other words, instead of scrolling the widgets, you are "scrolling" which of the data items that the widgets are displaying.

Turns out that none of the mentioned UltimateListCtrl, ObjectListView and CatalogCtrl work with the wxPython 2.8.4.0 that Apple currently ships.

I could run the demos on a 2.8.9.1 I installed, but OLV was slow and crash-prone, ULC virtual rendered artifacts after scrolling, and ULC report didn't launch because PyCairo (as I was able to build it) is broken for native Quartz (as opposed to X11).

All not impossible problems, but enough to make deployment to end-users more work than I can handle. I'll have to think of another way.

···

On 20.05.2009, at 10:52, Andrea Gavana wrote:

You can try and hack my UltimateListCtrl:

Nice! Where does the indicator bar come from? I had to roll my own using GradientFillLinear because wx.Gauge is always animated on Mac.

···

On 20.05.2009, at 13:24, Andrea Gavana wrote:

Just for fun, this is what I came up using UltimateListCtrl on Windows

Tobias Weber wrote:

You can try and hack my UltimateListCtrl:

Turns out that none of the mentioned UltimateListCtrl, ObjectListView and CatalogCtrl work with the wxPython 2.8.4.0 that Apple currently ships.

I could run the demos on a 2.8.9.1 I installed, but OLV was slow and crash-prone, ULC virtual rendered artifacts after scrolling, and ULC report didn't launch because PyCairo (as I was able to build it) is broken for native Quartz (as opposed to X11).

My experience with cairo on the mac was pretty painless. I just installed cairo using macports, and then did a standard "python setup.py install" of PyCairo. (If I also had the macports version of Python installed then I wouldn't have had to do any building at all as it has a py-cairo package too. But I prefer to stick with the Python.org build of Python.)

All not impossible problems, but enough to make deployment to end-users more work than I can handle. I'll have to think of another way.

If you use a Python.org install of Python instead of Apple's, and use py2app to make an application bundle, then everything will be self-contained and there should be no problem deploying to end-users even if you do use newer versions of the libraries.

···

On 20.05.2009, at 10:52, Andrea Gavana wrote:

--
Robin Dunn
Software Craftsman

Unless you choose a variant this will install it for X11. That and Quartz are mutually exclusive.

I couldn't get pyGTK running without X11, either, because of PyCairo.

I also tried a setup.py (not macports) PyCairo, but maybe I should do that again.

···

On 22.05.2009, at 01:31, Robin Dunn wrote:

My experience with cairo on the mac was pretty painless. I just installed cairo using macports, and then did a standard "python setup.py install" of PyCairo.

Hi,

You can try and hack my UltimateListCtrl:

Turns out that none of the mentioned UltimateListCtrl, ObjectListView and
CatalogCtrl work with the wxPython 2.8.4.0 that Apple currently ships.

2.8.4.0 is more than 2 years old. No wonder that the newest widgets
have problems with it.

I could run the demos on a 2.8.9.1 I installed, but OLV was slow and
crash-prone, ULC virtual rendered artifacts after scrolling, and ULC report
didn't launch because PyCairo (as I was able to build it) is broken for
native Quartz (as opposed to X11).

It looks like it wasn't a great idea to use PyCairo for the ULC report
demo... anyway, it is not used anywhere so I just removed it and
uploaded a new version on my website, just in case you wish to give it
another try.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Thu, May 21, 2009 at 11:43 PM, Tobias Weber wrote:

On 20.05.2009, at 10:52, Andrea Gavana wrote:

Tobias Weber wrote:

···

On 22.05.2009, at 01:31, Robin Dunn wrote:

My experience with cairo on the mac was pretty painless. I just installed cairo using macports, and then did a standard "python setup.py install" of PyCairo.

Unless you choose a variant this will install it for X11. That and Quartz are mutually exclusive.

Yeah, the variants mine were built with are macosx+quartz.

--
Robin Dunn
Software Craftsman