bugGNU Octave - Bugs: bug #59620, Matlab script error in Octave

 
 

bug #59620: Matlab script error in Octave

Submitter:  Arve F <arve_f>
Submitted:  Fri 04 Dec 2020 02:23:14 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Missed Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Arve F Open/Closed:  * Closed
Release:  * 6.1.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 12 Dec 2020 11:05:06 AM UTC, comment #12: 

After Pantxo's change, I see the following:

>> hf = figure();
>> huic = uicontrol(hf, "style", "edit", "string", 1);
error: __go_uicontrol__: set: invalid string property value for "string", unable to create graphics handle
error: called from
    uicontrol at line 132 column 8


This looks more useful than the previous, more generic error message.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Fri 11 Dec 2020 09:17:14 AM UTC, comment #11: 

Thanks for your advice Markus, I will try to reach out on more appropriate channels like the ones you mention for further help.
 
comment #10:

> @arve_f: The value of the "string" property must be a string.
> IIUC, you are trying to set it to a double.
>
> This is a bug tracker, not a help forum.
> If you need help with coding with Octave, please try to reach out on the help mailing list [1], on the discourse forum [2] or other channels more appropriate for this [3].
>
> [1]: -email is unavailable-
> [2]: https://octave.discourse.group/
> [3]: https://www.gnu.org/software/octave/support

Arve F <arve_f>
Fri 11 Dec 2020 09:00:50 AM UTC, comment #10: 

@arve_f: The value of the "string" property must be a string.
IIUC, you are trying to set it to a double.

This is a bug tracker, not a help forum.
If you need help with coding with Octave, please try to reach out on the help mailing list [1], on the discourse forum [2] or other channels more appropriate for this [3].

[1]: -email is unavailable-
[2]: https://octave.discourse.group/
[3]: https://www.gnu.org/software/octave/support

Markus Mützel <mmuetzel>
Group administrator
Fri 11 Dec 2020 08:54:13 AM UTC, comment #9: 

Thanks, Pantxo. I found the run.m and uicontrol.m function files and am trying to separate the creation and property modification. When I do that I receive the following error message:

'error: set: invalid string property value for "string"
error: called from
    OpenPropSingle at line 701 column 8
    run at line 93 column 5
    openprop at line 59 column 1'

The property value for "string" is set to 'Js_def'.
Js_def = Vs_def/(n_def*D_def);

Here all input parameters are numeric. Is this perhaps causing the problem?

comment #6:

> @arve_v: You should separate the creation and property modification in your script so that you can see which one is causing problems. Something like:
>


> Values(1)   = uicontrol (Calculator, 'style', 'edit');
>
> set (Values(1), 'units', 'characters','string', Js_def,...
>      'position',[cavtextbox-4, Valuesboxht-4, editbox, editboxht], ...
>      'backgroundcolor',[1 1 1], 'enable','off');


>
> BTW, if you want to locate a function file, like run.m or uicontrol.m, just type "which uicontrol" at the prompt. This won't help here since the error happens in a buit-in compiled function, not in uicontrol.m.
>
> @Markus: I'll push a change along those lines, to obtain a more informative error message:
>


> diff -r fbfa420380e3 libinterp/corefcn/graphics.cc
> --- a/libinterp/corefcn/graphics.cc     Sun Dec 06 20:34:37 2020 +0100
> +++ b/libinterp/corefcn/graphics.cc     Thu Dec 10 11:29:35 2020 +0100
> @@ -13228,8 +13228,8 @@
>      }
>    catch (octave::execution_exception& e)
>      {
> -      error (e, "__go_%s__: unable to create graphics handle",
> -             go_name.c_str ());
> +      error (e, "__go_%s__: unable to create graphics handle, %s",
> +             go_name.c_str (), e.message ().c_str ());
>      }
>
>    try
> @@ -13239,8 +13239,8 @@
>    catch (octave::execution_exception& e)
>      {
>        delete_graphics_object (h);
> -      error (e, "__go_%s__: unable to create graphics handle",
> -             go_name.c_str ());
> +      error (e, "__go_%s__: unable to create graphics handle, %s",
> +             go_name.c_str (), e.message ().c_str ());
>      }
>
>    adopt (parent, h);


>  some property/value pairs in your script to wee which one is the offending one

Arve F <arve_f>
Thu 10 Dec 2020 10:37:51 PM UTC, comment #8: 
Pantxo Diribarne <pantxo>
Group Member
Thu 10 Dec 2020 05:14:49 PM UTC, comment #7: 

@Pantxo: Looks like a helpful addition to me.

Markus Mützel <mmuetzel>
Group administrator
Thu 10 Dec 2020 10:50:12 AM UTC, comment #6: 

@arve_v: You should separate the creation and property modification in your script so that you can see which one is causing problems. Something like:


Values(1)   = uicontrol (Calculator, 'style', 'edit');

set (Values(1), 'units', 'characters','string', Js_def,...
     'position',[cavtextbox-4, Valuesboxht-4, editbox, editboxht], ...
     'backgroundcolor',[1 1 1], 'enable','off');


BTW, if you want to locate a function file, like run.m or uicontrol.m, just type "which uicontrol" at the prompt. This won't help here since the error happens in a buit-in compiled function, not in uicontrol.m.

@Markus: I'll push a change along those lines, to obtain a more informative error message:


diff -r fbfa420380e3 libinterp/corefcn/graphics.cc
--- a/libinterp/corefcn/graphics.cc     Sun Dec 06 20:34:37 2020 +0100
+++ b/libinterp/corefcn/graphics.cc     Thu Dec 10 11:29:35 2020 +0100
@@ -13228,8 +13228,8 @@
     }
   catch (octave::execution_exception& e)
     {
-      error (e, "__go_%s__: unable to create graphics handle",
-             go_name.c_str ());
+      error (e, "__go_%s__: unable to create graphics handle, %s",
+             go_name.c_str (), e.message ().c_str ());
     }

   try
@@ -13239,8 +13239,8 @@
   catch (octave::execution_exception& e)
     {
       delete_graphics_object (h);
-      error (e, "__go_%s__: unable to create graphics handle",
-             go_name.c_str ());
+      error (e, "__go_%s__: unable to create graphics handle, %s",
+             go_name.c_str (), e.message ().c_str ());
     }

   adopt (parent, h);

 some property/value pairs in your script to wee which one is the offending one

Pantxo Diribarne <pantxo>
Group Member
Thu 10 Dec 2020 09:35:24 AM UTC, comment #5: 

comment #2:

> No response, closing report.


comment #4:

> There is no property "SelectionChangeFcn" for uibuttongroup. Did you mean "selectionchangedfcn" (not the additional "d")?


Thanks, Markus, changing it to "SelectionChangedFcn" helped.

But now a new error message appears:

error: _go_uicontrol_: unable to create graphics handle
error: called from
    uicontrol at line 122 column 8
    OpenPropSingle at line 695 column 17
    run at line 93 column 5
    openprop at line 59 column 1"
----------

Here is the code for line 695 in file "OpenPropSingle":
  Values(1)   = uicontrol(Calculator,'units','characters','style',...
                               'edit','string',Js_def,...
                               'position',[cavtextbox-4, Valuesboxht-4, editbox, editboxht],'backgroundcolor',[1 1 1],...
                               'enable','off');
-------------

I do not find any files (?) called "uicontrol" or "run" referred to in the error message.

Do you see what might be the problem?

Arve F <arve_f>
Wed 09 Dec 2020 01:31:27 PM UTC, comment #4: 

There is no property "SelectionChangeFcn" for uibuttongroup. Did you mean "selectionchangedfcn" (not the additional "d")?

Markus Mützel <mmuetzel>
Group administrator
Wed 09 Dec 2020 12:30:15 PM UTC, comment #3: 

Here is a script section the error message refers to:
--------------
Flags           = uibuttongroup('parent',Fig_Main,'title','Options','fontsize',...
                          panelfontsize,'fontweight','bold','units','characters',...
                          'position',[1+Specificationsbox+BladeDesignbox+Inflowbox...
                          1+Ductboxht+Foilboxht Flagbox Flagboxht],'clipping','on',...
                          'SelectionChangeFcn',@checkTurbine);
-------------------------

Does this help, Pantxo?

Arve F <arve_f>
Tue 08 Dec 2020 07:20:18 PM UTC, comment #2: 

No response, closing report.

Rik <rik5>
Group administrator
Fri 04 Dec 2020 03:40:53 PM UTC, comment #1: 

Can you please provide a minimal script to reproduce the error you encounter? The most probable cause for the issue is that, while creating an uibuttongroup, you specify unimplemented properties or invlid values.

Pantxo Diribarne <pantxo>
Group Member
Fri 04 Dec 2020 02:23:14 PM UTC, original submission:  

Does anyone know how to avoid the following error message when trying to run Matlab script in Octave:
 
error: _go_uibuttongroup_: unable to create graphics handle

Arve F <arve_f>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by arve_f (Submitted the item)
  • -email is unavailable- added by arve_f
  •  

    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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-12 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2020-12-11 mmuetzel StatusNeed Info Ready For Test
    2020-12-10 mmuetzel CategoryPlotting with OpenGL Plotting
        Item GroupMatlab Compatibility Missed Error or Warning
        Open/ClosedClosed Open
        Operating SystemMicrosoft Windows Any
    2020-12-08 rik5 Open/ClosedOpen Closed
    2020-12-04 pantxo CategoryGUI Plotting with OpenGL
        StatusNone Need Info
    2020-12-04 arve_f Carbon-Copy- Added arve_f

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code