bugGNU Octave - Bugs: bug #55368, warning: popupmenu value not...

 
 

bug #55368: warning: popupmenu value not within valid display range

Submitter:  Guillaume <gyom>
Submitted:  Thu 03 Jan 2019 01:09:43 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 08 Jan 2019 10:38:35 AM UTC, comment #11: 

Thank you, it all works back to normal.

Guillaume <gyom>
Mon 07 Jan 2019 07:59:28 PM UTC, comment #10: 

Thanks. I pushed a fix for the cascaded regression:

http://hg.savannah.gnu.org/hgweb/octave/rev/4eb1f6e41361

Pantxo Diribarne <pantxo>
Group Member
Mon 07 Jan 2019 05:03:07 PM UTC, comment #9: 

Thanks Pantxo, I confirm the warning has now disappeared.

I now notice an issue with 'text':


h = figure ();
u = uicontrol ("parent", h);
set (u, "style", "text", "string", "A")


get(u,"style") returns "text" but the widget still look and behave like a pushbutton.

Guillaume <gyom>
Mon 07 Jan 2019 04:46:26 PM UTC, comment #8: 

I pushed the patch to stable (https://hg.savannah.gnu.org/hgweb/octave/rev/9f9aa7e92826).  It works with the original example code and with the specific test code from comment #5.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Sun 06 Jan 2019 09:15:40 PM UTC, comment #7: 

I attached a new patch that makes style changes work as they did before cset 5535267e88ba, this is like Matlab: we store wrong values and warn about it.

(file #45884)

Pantxo Diribarne <pantxo>
Group Member
Fri 04 Jan 2019 11:39:53 AM UTC, comment #6: 

In each of your cases, the following warning is displayed:


>> Warning: 'popupmenu' control requires that 'Value' be an integer within Character vector range
Control will not be rendered until all of its parameter values are valid


and the stored value is the one you specified (even if invalid).

Guillaume <gyom>
Fri 04 Jan 2019 11:22:13 AM UTC, comment #5: 

Actually the patch is not the right thing to do. The default "value" property should be handled by the graphics_object. What does Matlab do in those cases?


h = uicontrol ('style', 'popupmenu', 'string', 'A|B', 'value', 0)
% Is the object created? If so what does the following return?
get (h, 'value')

h = uicontrol ('style', 'popupmenu', 'string', 'A|B', 'value', 5)
% Is the object created? If so what does the following return?
get (h, 'value')

h = uicontrol ('style', 'popupmenu', 'string', 'A|B')
get (h, 'value')
set (h, 'value', 5)
get (h, 'value')


Pantxo Diribarne <pantxo>
Group Member
Fri 04 Jan 2019 09:46:37 AM UTC, comment #4: 

Thanks Pantxo, it works for me too!

Guillaume <gyom>
Fri 04 Jan 2019 08:19:01 AM UTC, comment #3: 

Now attached ...

(file #45864)

Pantxo Diribarne <pantxo>
Group Member
Fri 04 Jan 2019 08:18:34 AM UTC, comment #2: 

I attached a patch that fixes this issue for me.

Pantxo Diribarne <pantxo>
Group Member
Thu 03 Jan 2019 04:34:57 PM UTC, comment #1: 

Adding Pantxo to the CC list.

The trouble seems to be that the default call to uicontrol creates a pushbutton object for which the "Value" property is 0 or 1 (and it is 0 in this case).

When the style of the uicontrol is changed to popupmenu the "Value" field is initially zero while the popumenu expects numbering to begin at 1.

Matlab handles this case without problem so we should too.

Rik <rik5>
Group administrator
Thu 03 Jan 2019 01:09:43 PM UTC, original submission:  

Changeset 26276:5535267e88ba introduced a warning when running the following:

https://hg.savannah.gnu.org/hgweb/octave/rev/5535267e88ba


h = figure ();
u = uicontrol ("parent", h);
set (u, "style", "popupmenu", "string", "A")



warning: popupmenu value not within valid display range


The code above is a recurrent construct in struct2hdl.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45884:  popup_value6.patch added by pantxo (2KiB - text/x-patch)
file #45864:  popup_value.patch added by pantxo (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by rik5
  • -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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-07 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2019-01-06 pantxo Attached File- Added popup_value6.patch, #45884
    2019-01-04 pantxo Attached File- Added popup_value.patch, #45864
    2019-01-04 pantxo StatusConfirmed Patch Submitted
    2019-01-03 rik5 StatusNone Confirmed
        Carbon-Copy- Added pantxo

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code