bugGNU Octave - Bugs: bug #44775, CreateMode argument for...

 
 

bug #44775: CreateMode argument for msgbox/errordlg/warndlg

Submitter:  Guillaume <gyom>
Submitted:  Wed 08 Apr 2015 03:14:18 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
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
   

Sat 11 Apr 2015 03:19:49 PM UTC, comment #4: 

I added some more documentation to each of the help strings of the affected dialog functions and pushed the change here (http://hg.savannah.gnu.org/hgweb/octave/rev/98d10871018a).  Closing report.

Rik <rik5>
Group administrator
Sat 11 Apr 2015 01:00:55 PM UTC, comment #3: 

Thanks for noticing this.

This is fixed in the new patch attached.

(file #33638)

Guillaume <gyom>
Sat 11 Apr 2015 04:23:18 AM UTC, comment #2: 

I see a difference in behavior pre/post-patch with the following command.


msgbox ('msg', 'title', 'error', 'modal')


According to the documentation, I should be able to specify both the icon and the window type.  But now if I do both the icon is no longer set correctly.


Rik <rik5>
Group administrator
Wed 08 Apr 2015 05:58:38 PM UTC, comment #1: 

The addition looks fine to me.  It's just a message.

The reason that program execution is blocked is that there is no existing mechanism to communicate results back to the Octave core.  The layout framework layout is as follows: Qt GUI is the main thread and the Octave core is in a secondary thread--a "worker thread" of sorts.  (Only the main thread can do graphics in Qt, with rare exception.)  That's a perfectly fine setup.  It would be straightforward to make the dialogs non-modal and let the worker thread continue on its way, but there is no way right now to communicate the result back to Octave core.  The way to do this in the asynchronous, cross-thread environment is with signals and slots.  The dialog box can send out a signal when it is done, but there needs to be a slot on the worker thread side of things to accept the signal.  That means whatever slot is on the work thread side needs to remember information about the dialog that was issued, probably with some identification in the case of multiple dialogs/figures, etc.  Worker thread also needs to accept signals "asynchronously", be that between script commands or whatever the case.

If by implement in Octave you mean that there are some primitives for drawing plot elements, that seems like too much work at the moment--to define and maintain.  Custom icons should be possible within the existing framework.  If one attempts the custom layout that this changeset hints at, it may well end up that it would work better with some more primitive OOP classes.  In that case things could be restructured, but the advantage of going with the more high level dialogs directly is the small amount of code it requires to implement given the large amount of Qt objects.

Dan Sebald <sebald>
Wed 08 Apr 2015 03:14:18 PM UTC, original submission:  

The attached patch modifies msgbox/errordlg/warndlg/message_dialog to recognize the CreateMode argument and display a warning (and ignore it, instead of returning an error).

http://www.mathworks.com/help/matlab/ref/msgbox.html
http://www.mathworks.com/help/matlab/ref/errordlg.html
http://www.mathworks.com/help/matlab/ref/warndlg.html

Another difference with MATLAB is that the returned value is not a figure handle. It also blocks the programme execution while this is done separately with MATLAB using uiwait().

Is there a specific reason, apart from historical, that these functions are not implemented as pure Octave code? It would make it easier to implement, eg, custom icons.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33638:  msg_modal2.diff added by gyom (5KiB - text/x-patch)
file #33595:  msg_modal.diff added by gyom (5KiB - 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 rik5 (Posted a comment)
  • -email is unavailable- added by sebald (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-11 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2015-04-11 gyom Attached File- Added msg_modal2.diff, #33638
    2015-04-08 gyom Attached File- Added msg_modal.diff, #33595

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code