bugGNU Octave - Bugs: bug #51161, Issues with GUI object callback...

 
 

bug #51161: Issues with GUI object callback functions

Submitted by:  None
Submitted on:  Fri 02 Jun 2017 12:46:57 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unexpected Error
Status: Need InfoAssigned to: None
Originator Name: David FoxallOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.3
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.

 

Mon 12 Jun 2017 06:42:08 AM UTC, comment #2:

Closing report since not futher information was provided.

Pantxo Diribarne <pantxo>
Project Member
Sun 04 Jun 2017 12:57:07 PM UTC, comment #1:

Hi,

Graphics callbacks support any kind of data, just don't forget that the two first arguments to a callback are provided by the graphics system: arg 1 is the handle to the object that triggered the callback execution, arg 2 contains event data that depend on the situation (empty most of the time); see https://www.gnu.org/software/octave/doc/interpreter/Callbacks.html#Callbacks and the following example:

Your xv_roi_update misses the event argument.

Now about the crash you report when using a script as a callback function (which is an error but should not crash Octave), can you give simple example that triggers the crash for you.

Pantxo Diribarne <pantxo>
Project Member
Fri 02 Jun 2017 12:46:57 PM UTC, original submission:

I have been trying to implement a GUI for image analysis. My program has a uicontrol listbox object and I originally wrote a callback to accept three structures: one with object handles, one with the image data and one with ROI data.

Manipulating the GUI to execute the callback caused OCTAVE to report an error about attempting to dereference a scalar with a period.

OK it didn't support structures ... so I tried to pass an array and dereference an element inside the callback. To get the following message.

error: xv_roi_update: A(I): index out of bounds; value 1 out of bound 0
error: called from
xv_roi_update at line 16 column 10

It seems that OCTAVE only supports passing scalar variables to callbacks.

So I tried a simple script as the callback, and on triggering it, crashed the whole program.

The attached files should reproduce the problem if you alter test.m to supply some of your own image data.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #40840:  xv.m added by None (10KiB - application/octet-stream - You will have to supply an image to run these scripts )
file #40841:  xv_display.m added by None (279B - application/octet-stream - You will have to supply an image to run these scripts )
file #40842:  xv_roi_update.m added by None (500B - application/octet-stream - You will have to supply an image to run these scripts )
file #40843:  test.m added by None (174B - application/octet-stream - You will have to supply an image to run these scripts )

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 12 Jun 2017 06:42:08 AM UTCpantxoOpen/ClosedOpen=>Closed
    Sun 04 Jun 2017 12:57:07 PM UTCpantxoCategoryGUI=>Plotting
      StatusNone=>Need Info
    Fri 02 Jun 2017 12:46:57 PM UTCNoneAttached File-=>Added xv.m, #40840
      Attached File-=>Added xv_display.m, #40841
      Attached File-=>Added xv_roi_update.m, #40842
      Attached File-=>Added test.m, #40843

    Back to the top


    Powered by Savane 3.1-cleanup1