Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

DataViewIndexListModel demo double-clicking can not enter in edit mode in macOSX

Open wangduanduan opened this issue 1 year ago • 12 comments
trafficstars

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
image
Code Example (click to expand)
# Put code sample here

wangduanduan avatar Oct 01 '24 14:10 wangduanduan

on windows system, double click can enter input mode

image

wangduanduan avatar Oct 01 '24 14:10 wangduanduan

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.

ghost avatar Oct 02 '24 19:10 ghost

@reticulatus did this work in previous Python or wxPython versions on macOS?

swt2c avatar Oct 02 '24 20:10 swt2c

Sorry, I only tested the latest versions.

ghost avatar Oct 02 '24 20:10 ghost

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.

ghost avatar Oct 02 '24 20:10 ghost

@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?

wangduanduan avatar Oct 03 '24 05:10 wangduanduan

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).

ghost avatar Oct 04 '24 12:10 ghost

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.]

Screen Recording 2024-10-04 at 14 04 20

ghost avatar Oct 04 '24 14:10 ghost

@reticulatus

I have two questions

  1. Is it a bug that double-click not enter edit mode on macOS? (but windows is OK)
  2. what is the specific duration of ”a short pause”? (This will make it difficult for ordinary users to use)

wangduanduan avatar Oct 04 '24 15:10 wangduanduan

  1. 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.
  2. From experimenting I estimate the short pause is greater than 1.5 seconds on my MacBook.

ghost avatar Oct 04 '24 16:10 ghost

@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.

wangduanduan avatar Oct 06 '24 03:10 wangduanduan

how to make double-clicking enter edit mode?

wangduanduan avatar Oct 06 '24 03:10 wangduanduan