bugGNU Octave - Bugs: bug #56646, SelectionType in a listbox's...


bug #56646: SelectionType in a listbox's callback

Submitted by:  Guillaume <gyom>
Submitted on:  Fri 19 Jul 2019 10:17:42 AM UTC  
Category:  Plotting Severity:  3 - Normal
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 29 Jul 2019 10:35:20 AM UTC, comment #2: 

I agree with your comments. My main concern here is the double-click that has to return "normal", "open". Current behavior of middle-click and right-click can be left as it currently is. Keyboard input is something that can be dealt with through the "buttondownfcn" callback property so this might not be an issue either.

Guillaume <gyom>
Mon 22 Jul 2019 05:09:06 PM UTC, comment #1: 

Do we even want to follow Matlab behavior here?  It doesn't seem correct given their documentation.

uicontrol doesn't have a "SelectionType" property, only the figure object has such a property.  The documentation for figure properties at https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html says "Mouse selection type, returned as 'normal', 'extend', 'alt', or 'open'. This property provides information about the last mouse button press that occurred in the figure."

Even though a middle-click occurs over a uicontrol object, it is still the last mouse button press that occurs in the figure.  Therefore, I think it should return "extend".  In the same vein, right click should return 'alt'.

Also, since it is undocumented that keyboard input should set a mouse click property, I don't think <space> or <return> should return "open".  Octave usually doesn't bother to follow undocumented Matlab behavior since it can change between versions without warning.

This still does leave three issues with uicontrol objects (and possibly other graphic objects on a figure?).

1) Double-click should return "normal", "open"
2) Middle-click should return "extended"
3) Right-click should return "alt"

I also notice a slight delay in when the callback is activated.  I'll file a different report about that.

Rik <rik5>
Project Administrator
Fri 19 Jul 2019 10:17:42 AM UTC, original submission:  

In bug #44669, a bug was fixed for having "SelectionType" to return "open" for a double-click in a figure's callback.

It seems that there are similar issues in a listbox's callback where "open" is not returned for a double-click and middle/right click return "extend"/"alt":

uicontrol ('style','listbox', 'string','octave', 'callback',"get(gcbf,'SelectionType')")

In Matlab, the behavior is:

  • left single click: "normal"
  • left double click: "normal", "open"
  • middle click:
  • right click:
  • space: "open"
  • "return: "open"
Guillaume <gyom>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by gyom (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-07-22 rik5 Priority5 - Normal => 3 - Low
        StatusNone => Confirmed
        Carbon-Copy- => Added lostbard

    Back to the top

    Powered by Savane 3.7