Disappearing caret in Py Shell

After right-clicking the Help menu from the menu bar in the Py Shell, the caret disappears from the Py Shell command line. The caret returns after clicking the Help menu again.

The problem does not occur with any of the other menus on the menu bar, just with Help.

Which method can be called to keep the caret visible in the Py Shell window (which is a StyledTextCtrl)?

/Jean Brouwers
ProphICy Semiconductor, Inc.

PS) This is wxPython 2.4.1.4 and Python 2.3 on RedHat Linux 8.0. Run 'pyshell ...' to reproduce the problem.

Jean Brouwers wrote:

After right-clicking the Help menu from the menu bar in the Py Shell, the caret disappears from the Py Shell command line. The caret returns after clicking the Help menu again.

The problem does not occur with any of the other menus on the menu bar, just with Help.

This has to do with the how the focus is returned (or not) to the STC window. When it has the focus then it will display the focus, and when it doesn't have it then doesn't flash the caret. IIRC, the problem was that sometimes wxGTK would not send the focus event so STC didn't know that it was supposed to start flashing the caret again.

Which method can be called to keep the caret visible in the Py Shell window (which is a StyledTextCtrl)?

/Jean Brouwers
ProphICy Semiconductor, Inc.

PS) This is wxPython 2.4.1.4 and Python 2.3 on RedHat Linux 8.0. Run 'pyshell ...' to reproduce the problem.

It has been fixed in later versions, although I don't remember if it was done for 2.4.2.4 or not.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin,

The caret does not flash again after setting the focus explicitly to the STC class with SetFocus(self).

But, I just noticed an STC method called SetSTCFocus() and the caret *does* come back after calling SetSTCFocus(True).

/Jean Brouwers
ProphICy Semiconductor, Inc.

Robin Dunn wrote:

···

Jean Brouwers wrote:

After right-clicking the Help menu from the menu bar in the Py Shell, the caret disappears from the Py Shell command line. The caret returns after clicking the Help menu again.

The problem does not occur with any of the other menus on the menu bar, just with Help.

This has to do with the how the focus is returned (or not) to the STC window. When it has the focus then it will display the focus, and when it doesn't have it then doesn't flash the caret. IIRC, the problem was that sometimes wxGTK would not send the focus event so STC didn't know that it was supposed to start flashing the caret again.

Which method can be called to keep the caret visible in the Py Shell window (which is a StyledTextCtrl)?

/Jean Brouwers
ProphICy Semiconductor, Inc.

PS) This is wxPython 2.4.1.4 and Python 2.3 on RedHat Linux 8.0. Run 'pyshell ...' to reproduce the problem.

It has been fixed in later versions, although I don't remember if it was done for 2.4.2.4 or not.