Phoenix
Phoenix copied to clipboard
DataViewIndexListModel demo double-clicking can not enter in edit mode in macOSX
Operating system: MacOS 14.5 wxPython version & source: 4.2.2 Python version & source: 3.12.6
Description of the problem:
in the DataViewIndexListModel demo, double click the cell, nothing happen, not enter in edit mode。but in windows11, the same version wxpython, DataViewIndexListModel demo can enter in editor mode.
# This method is called when the user edits a data item in the view.
def SetValueByRow(self, value, row, col):
self.log.write("SetValue: (%d,%d) %s\n" % (row, col, value))
self.data[row][col] = value
return True
Code Example (click to expand)
# Put code sample here
on windows system, double click can enter input mode
I have just upgraded my MacBook Pro (macOS 15.0 Sequoia) to Python 3.12.6 and wxPython 4.2.2.
I then ran the wxPython demo and selected the DVC_IndexListModel demo.
I confirm that double-clicking on an entry doesn't enter edit mode.
However, if I single-click an entry and then press the Return key, it does enter edit mode.
@reticulatus did this work in previous Python or wxPython versions on macOS?
Sorry, I only tested the latest versions.
I was just experimenting with it on linux and I noticed that it's not strictly a double-click action that it's responding to. i.e the time between clicking a row to select it and clicking a cell to enter edit mode can be as long as you like!
So I went back to my MacBook and tried doing a click on a row, followed by a slight pause and then click on a cell in that row and it did then enter edit mode!
EDIT: another difference I noticed is that, on linux the second click can be anywhere in a cell in order to enter edit mode, but on the macbook it has to be on the text in the cell and not on any trailing blank space.
@reticulatus
tried doing a click on a row, followed by a slight pause and then click on a cell in that row
not works for my mac.
the only way to enter edit mode is single click and enter Return key, but it only enter the first column, if you want to select next colunm, you must press tab
so: So what is the right way to select a cell and enter edit mode?
In the wxPython documentation for DataViewCustomRenderer.CreateEditorCtrl() it says:
Editing is typically triggered by slowly double-clicking the cell or by a platform-dependent keyboard shortcut (F2 is typical on Windows, Space and/or Enter is common elsewhere and supported on Windows too).
Below is an animated GIF showing clicking opening edit mode on my MacBook. Press the 'play' button at the top right of the GIF to start the animation.
Click 1 gives the wxPython demo window the focus. Click 2 selects a row. After a short pause, Click 3 opens the editor. Pressing the 'Esc' key closes the editor. Click 4 selects a different row. After a short pause, Click 5 opens the editor. Pressing the 'Esc' key closes the editor.
[The GIF then loops until the 'pause' button is pressed.]
@reticulatus
I have two questions
- Is it a bug that double-click not enter edit mode on macOS? (but windows is OK)
- what is the specific duration of ”a short pause”? (This will make it difficult for ordinary users to use)
- I don't know if it's a bug. The fact that the documentation mentions "slowly double-clicking" suggests there might be a limitation in the native control that the wxWidgets developers couldn't work around.
- From experimenting I estimate the short pause is greater than 1.5 seconds on my MacBook.
@reticulatus thanks.
i test again that "slowly double-clicking" can enter edit mode.
but pausing greater than 1.5 seconds is too difficult to use.
how to make double-clicking enter edit mode?