I am having a problem with editing the labels of a new CustomTreeControl.
Attached is a runnable example that demonstrates the problem on my machine.
To reproduce the behavoir do the following;
1) Right click on a tree item labelled "Parent: n"
- this should append a new item and the TextCtrl set to edit mode.
The description should default to "MyNewItem"
- On my system is I simply press "return" to accept this label, the
tree is refreshed, but the value is displayed as simply empty or '??'
- If I type multiple words where the total length is greater that 15
characters, the first two characters are replaced with '??' followed
by the rest of the string.
- note that the textctrl is positioned in the expected location
2) If you right click on the an item labelled "Parent: x Child:x", the
text box opens in the top left hand corner - an unexpected location
Am I missing something ?
On tracing this thru the system, the problem seems to be "hidden" in
the 'C++' code. The value is passed to the TextCtrl's "SetValue"
method, but an immediate call to .GetValue or .Value after this shows
the erroreous result (ie, '??')
Is this somehow related to unicode ?
System specs are;
Python 2.5.2
wxPython 2.8.9.1 ansi
Tested running Win2k3 and WinXp
I’m afraid to be of little help as I have so little experience. Nevertheless I tried out your code and here are my findings (see the attached picture for a screen shot and see my own configuration below):
I can’t reproduce the ??
The labels can be very long without problem
Indeed, you get this “top left corner” label positioning where the “MyNewItem” label gets squeezed. But it also appears in the attached example with parent 2. So my deduction is that this case appears whenever you try to add an item to an existing item that has not yet an expansion (i.e. trying to add an item to a leaf item).
Strangely enough, as you may see in the StdOut/StdErr window, you have - in this case - many “ending label edit” in a row instead of start/stop successions.
Maybe your remark on unicode is a valid one. My configuration is:
Dell Inspiron 5100, Pentium 4, 2.4 GHz, 512MB RAM
Windows XP Home Edition Version 2002 Service Pack 3