开发者

Creating a Legend Using ObjectListView

I am trying to create a legend of sorts using ObjectListView in Python.

I am able to accomplish this, using wx.PaintDC, DrawText, and DrawRectangle in wxPython, but it doesn't look very good because it is all free hand.

Is it 开发者_高级运维possible to create a square image, say a 10x10 pixel square, using wxPython or another package and then insert that image into a column on ObjectListView while changing the fill of that square for each row.

For example:

CheckBox||State||Population||Legend Color

Yes||Massachusetts||6.5million||Red Filled Square Image

No||Illinois||12.9million||Blue Filled Square Image

Thanks in advance.

Chris


You should be able to add different images to different rows with the ObjectListView widget, if I understand the question correctly. Alternatively, you might want to take a look at the UltimateListCtrl, which was written in pure Python and can have any widget put into it. I think there's a new list control widget in 2.9 too, but I don't remember what new features it added.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜