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

 
 

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

Submitted by:  Gazi Aliev <gazi>
Submitted on:  Mon 27 May 2019 08:31:28 PM UTC  
 
Category:  GUI Severity:  3 - Normal
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Need Info Assigned to:  None
Originator Name:  gazi Open/Closed:  Open
Release:  5.1.0 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

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>
Project 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>
Project 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:
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)
  •  

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