wx.gizmos.TreeListCtrl context menu and Ctrl key behaviour on EditLabel in Ubuntu

Using wx.gizmos.TreeListCtrl. When editing a label in a TreeListCtrl on Ubuntu 10.04 & 10.10 the default context menu (Cut, Copy, Paste, etc…) is displayed only very briefly (just a flicker really) on right-clicking in the edit control and then the edit is ended (edit control disappears, and label reappears). This doesn’t occur when tested on MS Windows (XP & 7).

On Ubuntu 10.04, trying to use Ctrl-C/X/V to cut/copy/paste in a label being edited shows similar behaviour, the edit is ended (edit control disappears, and label reappears) when the Ctrl key is pressed. This doesn’t occur when tested on MS Windows (XP & 7) or Ubuntu 10.10.

Small runnable test script attached. This is based on the standard demo script in which the issue also occurs. The script was tested using python 2.6 and the following wxPython versions:

  • Ubuntu 10.04 - 2.8.10.1 (gtk2-unicode)

  • Ubuntu 10.04 - 2.8.11.0 (gtk2-unicode)

  • Win 7 & XP - 2.8.11.0 (msw-unicode)

Are there any workarounds so I can use TreeListCtrl on Ubuntu, or should I investigate another control? I’ve played with HyperTreeList , but I’m having different issues with that.

Regards
Luke

test.py (1006 Bytes)

Hi,

Using wx.gizmos.TreeListCtrl. When editing a label in a TreeListCtrl on
Ubuntu 10.04 & 10.10 the default context menu (Cut, Copy, Paste, etc...) is
displayed only very briefly (just a flicker really) on right-clicking in the
edit control and then the edit is ended (edit control disappears, and label
reappears). This doesn't occur when tested on MS Windows (XP & 7).

On Ubuntu 10.04, trying to use Ctrl-C/X/V to cut/copy/paste in a label being
edited shows similar behaviour, the edit is ended (edit control disappears,
and label reappears) when the Ctrl key is pressed. This doesn't occur when
tested on MS Windows (XP & 7) or Ubuntu 10.10.

Small runnable test script attached. This is based on the standard demo
script in which the issue also occurs. The script was tested using python
2.6 and the following wxPython versions:

- Ubuntu 10.04 - 2.8.10.1 (gtk2-unicode)
- Ubuntu 10.04 - 2.8.11.0 (gtk2-unicode)
- Win 7 & XP - 2.8.11.0 (msw-unicode)

Are there any workarounds so I can use TreeListCtrl on Ubuntu, or should I
investigate another control? I've played with HyperTreeList , but I'm
having different issues with that.

I don't have any suggestion about TreeListCtrl as I don't use it
myself anymore, but could you elaborate on the issues you are having
with HyperTreeList?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 11 April 2011 07:26, Luke Pinner wrote:

If I can't get TreeListCtrl working properly, I will start another
thread about my HyperTreeList problems and provide a runnable sample.
But my major issue is that when editing a label, the edittextctrl does
not have the same width as the column so the user sees both the the
text in the editctrl and the text in the label. You can see this if
you replace the TreeListCtrl with a HyperTreeList in the sample from
my previous post.

Note: I haven't really delved into HyperTreeList much at all as I've
been trying to get TreeListCtrl working so I may be missing obvious...

Probably. It looks like wx.TreeCtrl has the same problem, but since the demo is (re)activating the edit in a right-up handler it is not as obvious. My guess is that showing the context menu is causing the native gtk text widget to get a lost-focus event and that event is what wx is using to dismiss the edit control.

···

On 4/10/11 7:26 PM, Luke Pinner wrote:

Using wx.gizmos.TreeListCtrl. When editing a label in a TreeListCtrl on
Ubuntu 10.04 & 10.10 the default context menu (Cut, Copy, Paste, etc...)
is displayed only very briefly (just a flicker really) on right-clicking
in the edit control and then the edit is ended (edit control disappears,
and label reappears). This doesn't occur when tested on MS Windows (XP & 7).

On Ubuntu 10.04, trying to use Ctrl-C/X/V to cut/copy/paste in a label
being edited shows similar behaviour, the edit is ended (edit control
disappears, and label reappears) when the Ctrl key is pressed. This
doesn't occur when tested on MS Windows (XP & 7) or Ubuntu 10.10.

Small runnable test script attached. This is based on the standard demo
script in which the issue also occurs. The script was tested using
python 2.6 and the following wxPython versions:

- Ubuntu 10.04 - 2.8.10.1 (gtk2-unicode)
- Ubuntu 10.04 - 2.8.11.0 (gtk2-unicode)
- Win 7 & XP - 2.8.11.0 (msw-unicode)

Are there any workarounds so I can use TreeListCtrl on Ubuntu, or should
I investigate another control?

--
Robin Dunn
Software Craftsman

After a little more playing with the examples, I get similar
behaviour, the edit control is dismissed, with the Ctrl key and
Context Menu (but the context menu remains visible) when editing in
the ListCtrl, ListCtrl_edit and Grid demos. I want to use an editable
ListCtrl so I can workaround it in a ListCtrl subclass if I include
the TextEditMixin and catch EVT_KILL_FOCUS in the TextEditMixin.editor
control.

Luke

···

On Apr 12, 6:06 am, Robin Dunn <ro...@alldunn.com> wrote:

Probably. It looks like wx.TreeCtrl has the same problem, but since the
demo is (re)activating the edit in a right-up handler it is not as
obvious. My guess is that showing the context menu is causing the
native gtk text widget to get a lost-focus event and that event is what
wx is using to dismiss the edit control.