bugGNU Octave - Bugs: bug #38046, struct2hdl error when struct has...


bug #38046: struct2hdl error when struct has 'uicontrol' object

Submitter:  Muhali <muhali>
Submitted:  Wed 09 Jan 2013 01:54:48 PM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  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

Sun 04 Nov 2018 05:21:56 PM UTC, comment #6: 

Closing as a duplicat of bug #44670.

Rik <rik5>
Group administrator
Sat 03 Nov 2018 09:03:48 AM UTC, comment #5: 

This is also being discussed in bug #44670, with a suggested implementation so we could close this report as duplicate.

Guillaume <gyom>
Fri 02 Nov 2018 07:52:23 PM UTC, comment #4: 

This bug is super old.  Is there any reason why we shouldn't implement 'uicontrol' objects in struct2hdl so they could be loaded and saved?

We could always check that the graphics toolkit is qt before restoring the uicontrol object.

Rik <rik5>
Group administrator
Mon 14 Jan 2013 04:38:11 PM UTC, comment #3: 

Generating an error seems like a good intermediate step until we have full support so I pushed the changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/8135bce0812a).

Rik <rik5>
Group administrator
Sun 13 Jan 2013 09:08:48 PM UTC, comment #2: 

Indeed uicontrols are not supported and I had not noticed those objects where implemented.

For ui related objects my approach has been to not store theim in the structure (see "uimenu" in hdl2struct), until QtHandle or any "ui"aware backend is added to the hg source tree, as I don't have any mean to actually test the code. 

On the other hand implementing (fake) support for objects that are already implemented would not be a huge work has Rik stated.
What do you think?

I have attached a minimal patch: struct2hdl sends an error if the requested object is not implemented.

(file #27255)

Pantxo Diribarne <pantxo>
Group Member
Wed 09 Jan 2013 06:03:43 PM UTC, comment #1: 

The issue is that your figure had an object of type "uicontrol" which currently isn't supported by struct2hdl.

The code to modify begins at line 114 of struct2hdl where there is a large if/elsif/elsif/endif tree for each type of object.  It seems like a branch needs to be added for "uicontrol" and then a new subfunction createuicontrol() added.  There are examples of other createXXXX functions in struct2hdl so it shouldn't be too difficult.

Rik <rik5>
Group administrator
Wed 09 Jan 2013 01:54:48 PM UTC, original submission:  

Using hdl2struct I have created a structure s so that the following produces an eror:

load foo.ot

error: 'h' undefined near line 143 column 20
error: called from:
error:   /usr/local/octave-dev/share/octave/3.7.0+/m/plot/struct2hdl.m at line 143, column 3
error:   /usr/local/octave-dev/share/octave/3.7.0+/m/plot/struct2hdl.m at line 150, column 16

foo.ot is attached.

I use a fairly recent dev version of octave (Dec. 12, 2c6b00c03329)

Muhali <muhali>


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

Attach Files:

Attached Files
file #27255:  struct2hdl_diff.patch added by pantxo (706B - text/x-patch)
file #27228:  foo.ot added by muhali (39KiB - application/octet-stream)


   bug dependencies.

Items that depend on this one: None found


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

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-04 mtmiller Carbon-CopyRemoved 80942 -
    2018-11-04 rik5 StatusConfirmed Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #44670
    2018-11-02 rik5 Carbon-Copy- Added gyom
    2014-01-19 mtmiller CategoryNone Octave Function
        Item GroupNone Incorrect Result
        Operating SystemGNU/Linux Any
    2013-01-13 pantxo Attached File- Added struct2hdl_diff.patch, #27255
    2013-01-09 rik5 Summarystruct2hdl error struct2hdl error when struct has 'uicontrol' object
    2013-01-09 rik5 StatusNone Confirmed
    2013-01-09 muhali Attached File- Added foo.ot, #27228

    Back to the top

    Powered by Savane 3.13-4e86.
    Corresponding source code