Hey,
I'm in the middle of making a program which uses the RichTextCtrl and
am wondering if there is any way to add widgets such as a RadioBox or
a Grid to the RichTextCtrl.
Thanks.
Hello,
I am writing an dialog that will allow a user to specify a list of strings, each item of which will be mapped to a distinct list of strings (a list of categorical variables and their lists of levels). So I have a a pair of editable list boxes, box 1 to contain the variable names and box 2 that will display the appropriate list of levels for the selected variable in box 1. At the moment I am using a dictionary to hold the data, which I am updating in response to list box events.
I am handling wx.EVT_LIST_ITEM_SELECTED and wx.EVT_LIST_ITEM_DESELECTED events to ensure that box2 displays the relevant list of categories when I select a different item in box 1. When an item is deselected in box 1 the dictionary is updated with the list of items from box 2. When an item is selected in box 1 the relevant items are pulled from the dictionary and used to populate box 2.
So far so good. But if I move an item in box 1 a deselection and selection are performed which results in two variables with identical levels. I can (probably) work round this by maintaining a reference to the current variable and not handling deselect events if event.GetText() is not equal to the current variable. But this doesn't seem very clean, as there will be a few places in my code where I'll have to deal with this reference (when populating the list boxes / clearing the list boxes etc.). I'd appreciate any ideas for a cleaner solution. TIA.
Duncan
[snip]
I should have included, wxPython 2.8, python 2.6, Ubuntu 10.04. It turns out my unclean solution is not quite a solution, as it doesn't handle the deletion of the last item in box 1 appropriately. Thanks.
Duncan
···
On 17/04/12 17:44, duncan smith wrote:
Hello,
I am struggling to find a way of creating a GridCellChoiceEditor without the need for a click in the relevant cell. I'd like the user to be able to see the editor without such a click. It would also allow me to generate a list to hold the underlying comboboxes via a handler bound to wx.grid.EVT_GRID_EDITOR_CREATED events on application start up. I've tried a number of things which haven't worked. I'm sure others have achieved what I want, but I haven't been able to track down any examples. Any ideas?
Another issue is the number of clicks required to change the selection. At the moment this requires 4 button clicks. Ideally I'd like to get this down to 2. I'd be grateful for any pointers. Cheers. TIA.
Duncan (Ubuntu 10.04, wxPython 2.8, Python 2.6)