[wxPython-users] wxGrid with custom editors, several question
Basil Shubin
bashu at yandex.ru
Tue Sep 5 05:16:04 PDT 2006
Robin Dunn wrote:
> Basil Shubin wrote:
>> Robin Dunn wrote:
>>> Basil Shubin wrote:
>>>> Hi friends!
>>>>
>>>> Lets suppose I have wxGrid with table in it. This table have some
>>>> kind of custom editors (choices).
>>>>
>>>> self.dataTypes = [gridlib.GRID_VALUE_CHOICE + titleChoices,
>>>> gridlib.GRID_VALUE_CHOICE + setChoices,
>>>> gridlib.GRID_VALUE_NUMBER + ':1,8',
>>>> gridlib.GRID_VALUE_NUMBER + ':1,30',
>>>> gridlib.GRID_VALUE_FLOAT + ':3,2',
>>>> ]
>>>>
>>>> The 'titleChoices' compiled with data collected somewere else, point
>>>> is that this data is not static, it's update through time. So the
>>>> first question is: how can I update the 'titleChoice' dynamically
>>>> when achieve some condition?
>>>
>>> You can catch the EVT_GRID_EDITOR_SHOWN event, get the combobox with
>>> event.GetControl and modify the contents of the list at that point in
>>> time.
>>
>> I got following error:
>>
>> AttributeError: 'GridEvent' object has no attribute 'GetControl'
>>
>> So how I can take the appropriate combo box control. And when I able
>> to get it, how can I determine that it is a right control?
>
> Sorry, I should have written EVT_GRID_EDITOR_CREATED.
How sad! :-( Currently I develope my own free software project 'The
Diary of Hercules' (http://sourceforge.net/projects/hercules).
In my application I have wxNotebook widget with two tabs. On the one tab
I can add new entry or edit exists one, on the other tab I have a grid
widget with custom grid editors in this grid. I need somehow solve the
following task: if I add or edit the entry at one time than this entries
should be available at once in the in-grob combo box so I can select it.
For this moment I can create choices list for combo box only at startup
and than unable to update it.
So I understand there NO way to accomplish this task? Or maybe there is
some workaround way to solve my problem? Any suggestion?
Thanks!
More information about the wxpython-users
mailing list