Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wangduanduan opened this issue Oct 1, 2024 · 12 comments

Comments

@wangduanduan
Copy link

wangduanduan commented Oct 1, 2024

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
Copy link
Author

wangduanduan commented Oct 1, 2024

on windows system, double click can enter input mode

image

@reticulatus
Copy link
Contributor

reticulatus commented Oct 2, 2024

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.

@swt2c
Copy link
Collaborator

swt2c commented Oct 2, 2024

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

@reticulatus
Copy link
Contributor

Sorry, I only tested the latest versions.

@reticulatus
Copy link
Contributor

reticulatus commented Oct 2, 2024

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.

@wangduanduan
Copy link
Author

@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 wangduanduan changed the title DataViewIndexListModel demo can not enter in edit mode in macOSX DataViewIndexListModel demo double-clicking can not enter in edit mode in macOSX Oct 4, 2024
@reticulatus
Copy link
Contributor

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

@reticulatus
Copy link
Contributor

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

@wangduanduan
Copy link
Author

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

@reticulatus
Copy link
Contributor

  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.

@wangduanduan
Copy link
Author

@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
Copy link
Author

how to make double-clicking enter edit mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants