473,322 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

wxPython: combining wxListCtrl and wxCheckBox

I would like a wxListCtrl with 3 columns in it. The number of rows in
it will vary during run-time. In the first column of each row should
be a wxCheckBox, which the user can check or uncheck.

Is such an arrangement possible?
Any example source code?

wxCheckListBox comes close - but not close enough. Unfortunately, it
does not derive from wxListCtrl, which contains the function
InsertColumn() needed for multiple columns
Jul 18 '05 #1
1 4108
One way to do this is to use the capability of the ListCtrl to display
images in the first position in the row. You can create checked and
unchecked images and then insert whichever image is appropriate for a
given row in the List.

When the row is created,
LCtrl.InsertImageStringItem(...) can insert the appropriate image and
you can then add as many additional columns as you need with
LCtrl.SetStringItem(row, column, string)

If some event changes the checkbox status of a row:

LC_Item = LCtrl.GetItem(row)

if __some condition__:
LC_Item.SetImage(index_unchecked)
else:
LC_Item.SetImage(index_checked)

LCtrl.SetItem(LC_Item)
ca**********@ukmail.com (Mark Carter) wrote in message news:<d3*************************@posting.google.c om>...
I would like a wxListCtrl with 3 columns in it. The number of rows in
it will vary during run-time. In the first column of each row should
be a wxCheckBox, which the user can check or uncheck.

Is such an arrangement possible?
Any example source code?

wxCheckListBox comes close - but not close enough. Unfortunately, it
does not derive from wxListCtrl, which contains the function
InsertColumn() needed for multiple columns

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andrew | last post by:
Hi I just started learning wxPython I wanted to know how I could do this in wxPython self.listbox.delete(0, END) for item in self.results: self.listbox.insert(END, item)
1
by: Chad Haynes | last post by:
Is there a way to change the background color of a wxCheckBox in wxPython? Using the SetBackgroundColor function will change the background of any label attached to the checkbox, but I want to...
15
by: Grant Edwards | last post by:
Can anybody recommend a good book on wxPython? Are there any books on wxPython? I've been trying to learn wxPython and/or wax for a few weeks, and I'm just not getting it. wxWindows seems...
3
by: Piet | last post by:
Hi there. I am trying to display tabular data in a wxListCtrl. What I get from the script below are only the headers, not the items themselves. The documentation didn´t help me much; instead I was...
4
by: Piet | last post by:
Hello. I am working on an XML editor that will not display the xml file as plain text, but will rather work with a combination of a tree view for the main element nodes and some kind of tabular...
1
by: Fabio Pliger | last post by:
Hi all, i'm working on a very large project using wx 2.5... On one frame i have a wx.lib.mixins.listctrl widget, wich is a listctrl extended with the possibility to edit the columns text...
0
by: Sven Tissot | last post by:
Hello, I am trying to build an editable ListCtrl_edit via TextEditMixin. It displays o.k. and I can edit the first field with this is the code piece: class VokabelListCtrl(wxListCtrl,...
0
by: David Poundall | last post by:
In the following example the phone number does not apear in the phone column of the llistbox. Can anybody tell me what I am doing wrong here ? from wxPython.wx import * class MyApp (wxApp) :...
2
by: OpenPavilion | last post by:
Hello, did anyone succeed in combining wxpython and a 3d engine (pyogre, crystalblend, panda3d, soya etc.) ? I would like to create an application, which uses wxpython tree, menu and grid...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.