bugGNU Octave - Bugs: bug #44687, Properties of a popupmenu uicontrol

 
 

bug #44687: Properties of a popupmenu uicontrol

Submitter:  Guillaume <gyom>
Submitted:  Wed 01 Apr 2015 02:29:08 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  lostbard
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 03 Apr 2015 07:20:02 PM UTC, comment #10: 

Closing report

John Donoghue <lostbard>
Group Member
Thu 02 Apr 2015 08:52:51 PM UTC, comment #9: 
John Donoghue <lostbard>
Group Member
Thu 02 Apr 2015 07:20:56 PM UTC, comment #8: 

Thanks again!

Last thing I notice is that MATLAB returns a warning/error as soon as 'Value' is above numel(String):


F=figure;
H=uicontrol(F,'style','popupmenu','String',{'A','B','C'});
set(H,'Value',3.1)


while Octave only complains from numel(String)+1.

Guillaume <gyom>
Thu 02 Apr 2015 06:51:01 PM UTC, comment #7: 

Happens whenever setting the value it already is.

Fixed: http://hg.savannah.gnu.org/hgweb/octave/rev/e70df1ff58b7

John Donoghue <lostbard>
Group Member
Thu 02 Apr 2015 06:30:10 PM UTC, comment #6: 

Thanks. A wanning now also appears with a 'Value' of 1, while it should not happen.


F=figure;
uicontrol(F,'style','popupmenu','String',{'A','B','C'},'Value',1)


Guillaume <gyom>
Thu 02 Apr 2015 05:10:45 PM UTC, comment #5: 

Pushed http://hg.savannah.gnu.org/hgweb/octave/rev/519eb032ac35

which warns about invalid value set.

John Donoghue <lostbard>
Group Member
Thu 02 Apr 2015 04:32:42 PM UTC, comment #4: 

Same issue with checkbox set(H, 'Value', 10) provides  warning in matlab.

John Donoghue <lostbard>
Group Member
Thu 02 Apr 2015 11:22:02 AM UTC, comment #3: 

Works great, many thanks! You can close the report now.

Testing your change, I noticed that MATLAB displays a warning if one attempts to set 'Value' out of bound, while Octave silently ignores it.


set(H,'Value',4)
Warning: 'popupmenu' control requires that 'Value' be an integer within String range
Control will not be rendered until all of its parameter values are valid


Guillaume <gyom>
Wed 01 Apr 2015 07:18:15 PM UTC, comment #2: 
John Donoghue <lostbard>
Group Member
Wed 01 Apr 2015 07:10:50 PM UTC, comment #1: 

Confirmed in both Linux and Windows

John Donoghue <lostbard>
Group Member
Wed 01 Apr 2015 02:29:08 PM UTC, original submission:  

Run the following:


F = figure;
H = uicontrol(F,'Style','popupmenu','String',...
      {'A','B','C'},'Value',2,'Callback','disp(''cb'');');
get(H,'Value')


It should display 'B' (as 'Value' is 2) but instead displays 'A'.

Furthermore, if you now manually switch it to 'C' (which will display 'cb') and type this:


set(H,'Value',1)


it will execute the callback as well (and display 'cb') while MATLAB does not execute a callback when using 'set' programmatically.

Guillaume <gyom>

 

(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 lostbard (Posted a comment)
  • -email is unavailable- added by gyom (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-03 lostbard StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2015-04-01 lostbard StatusNone Ready For Test
    2015-04-01 lostbard Item GroupNone Incorrect Result
        Assigned toNone lostbard
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code