bugGNU Octave - Bugs: bug #56401, uicontrol "pushbutton"...

 
 

bug #56401: uicontrol "pushbutton" property "Value" is 1 in Matlab and 0 in Octave

Submitter:  Gazi Aliev <gazi>
Submitted:  Mon 27 May 2019 08:31:28 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  gazi Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 31 Jan 2020 09:51:27 PM UTC, comment #5: 

This appears to be an incompatibility, but an inconsequential one, right? Closing as won't fix.

Mike Miller <mtmiller>
Group Member
Tue 28 May 2019 03:49:38 AM UTC, comment #4: 

According to Matlab documentation, the "Value" field is not used for pushbuttons.  See https://www.mathworks.com/help/matlab/ref/uicontrol.html.


Current value, specified as a number. Use to query or modify the status of certain user interface controls.

The table describes the Value property in relation to specific UIControl styles.

Style Property        Description of Value Property
'togglebutton'

    Selected: Value of the Max property.

    Cleared: Value of the Min property.

'checkbox'

    Selected: Value of the Max property.

    Cleared: Value of the Min property.

'radiobutton'

    Selected: Value of the Max property.

    Cleared: Value of the Min property.

'slider'        Value associated with the thumb location along the slider bar.

'listbox'        Array index corresponding to the selected item in the list box. A value of 1 (default) corresponds to the first item in the list. When multiple items are selected, the Value property stores the row indexes as a vector.

'popupmenu'        Array index corresponding to the selected item in the pop-up menu. A value of 1 (default) corresponds to the first item in the pop-up menu.


It seems like Matlab has chosen a value of '1' to return, and Octave '0', but neither is significant.


Rik <rik5>
Group administrator
Mon 27 May 2019 11:18:52 PM UTC, comment #3: 


handles.figure1 = figure(...
'Units','characters',...
'Position',[103.8 24.2307692307693 236.4 50.3846153846154],...
'Tag','figure1');

handles.Run_pushbutton = uicontrol(...
'Parent',handles.figure1,...
'Units','characters',...
'String','Run',...
'Position',[49.4 48.6153846153846 13.8 1.69230769230769],...
'Children',[],...
'Tag','Run_pushbutton',...
'Callback', {@Run_pushbutton_Callback,handles};

function Run_pushbutton_Callback(hObject, ~, handles)
get(hObject,'Value')
guidata(hObject, handles);

After pressing pushbutton uicontrol
in Matlab:
ans =

     1
in Octave:

>> ans = 0


Gazi Aliev <gazi>
Mon 27 May 2019 10:50:13 PM UTC, comment #2: 

Do you have some sample code that reproduces the issue?

Rik <rik5>
Group administrator
Mon 27 May 2019 08:44:59 PM UTC, comment #1: 

the word 'logical' is not needed

Gazi Aliev <gazi>
Mon 27 May 2019 08:31:28 PM UTC, original submission:  

+verbatim+ get(hObject,'Value') -verbatim-
within pushbutton callback function
returns logical 1 in Matlab, while 
in Octave it returns logical 0.

Gazi Aliev <gazi>

 

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

Attach Files:
   
   
Comment:
   

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 gazi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-31 mtmiller StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2019-05-28 rik5 Priority5 - Normal 3 - Low
        Summaryget(hObject,'Value') in pushbutton callback returns logical 0 uicontrol "pushbutton" property "Value" is 1 in Matlab and 0 in Octave
    2019-05-27 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code