|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dynamically updating GridCellChoiceEditor combo-box contents?
Hi,
I have a grid containing some data. In one of the columns, the data is selected from a predefined list using a GridCellChoiceEditor. However, I want to be able to dynamically add items to, and remove items from, this choice-list, and I'm not finding a reliable way to do so. The GridCellChoiceEditor has a Control, wich is a wx.Choice control. I can manipulate the contents of that control to my hearts content and the list with choices is updated. Great. However, there are a couple of caveats: 1. The Control is not created before the user first invokes the cell-editor. So before the user does that, I can not add or remove items. 2. Sometimes, the GridCellChoiceEditor itself is already deleted while I'm trying to add/remove items! I don't know how/when that can happen. (Should I manually increase/decrease the ref-count to it in my program, to let WX know that I'm keeping a reference to it?) 3. There's a method SetControl() on the GridCellChoiceEditor, but invoking the editor after using this method with a manually-created wx.Choice control just crashes the program, hard. 4. There's a method Create() on the GridCellChoiceEditor which creates the Control, but it needs an EvtHandler instance, and I don't know where to get the proper one. I've tried a couple of things more-or-less at random, but it just leads to crashes. 5. I could perhaps create a new GridCellChoiceEditor and call grid.SetCellEditor() again for the cells involved, but I tried that, it crashed too. Does anyone have any helpful clues for me? Regards, |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Python > Dynamically updating GridCellChoiceEditor combo-box contents? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|