bugGNU Octave - Bugs: bug #49529, set(gcf, "menubar",...

 
 

bug #49529: set(gcf, "menubar", "figure") does not restore figure menu bar

Submitted by:  jsh <jsh>
Submitted on:  Thu 03 Nov 2016 06:27:23 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.0-rc3Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 10 Nov 2016 05:32:56 AM UTC, comment #14:

I pushed your patch here http://hg.savannah.gnu.org/hgweb/octave/rev/2df51376f587.

Rik <rik5>
Project Administrator
Wed 09 Nov 2016 12:42:33 PM UTC, comment #13:

I attached the new patch.

I used both the scripts from comment #10 and comment #9 for testing but feel free to play again with the order in which custom menus are added/set visible/... This resizing mechanism is surprisingly complicated: sort of a state machine which can't really track its state.

(file #38913)

Pantxo Diribarne <pantxo>
Project Member
Wed 09 Nov 2016 07:01:24 AM UTC, comment #12:

I think I have a working solution but didn't write the log yet.

Pantxo Diribarne <pantxo>
Project Member
Tue 08 Nov 2016 11:28:49 PM UTC, comment #11:

@Pantxo: Do you want me to go ahead and apply the patch, even though there is the outstanding issue in comment #10? Or do you see a solution and I should wait until a full changeset is available?

Rik <rik5>
Project Administrator
Fri 04 Nov 2016 05:51:44 PM UTC, comment #10:

The patch works much better, but I found another obscure case where the window size shrinks.

The commands need to be run one by one, so that Octave returns to the prompt after each command and updates the window. The "keyboard" call is there just because I put this in a file tst_mbar2.m.

(file #38888)

Rik <rik5>
Project Administrator
Fri 04 Nov 2016 03:45:43 PM UTC, comment #9:

I attached an updated patch please. I used the following sequence for tests:

(file #38886)

Pantxo Diribarne <pantxo>
Project Member
Fri 04 Nov 2016 03:27:25 PM UTC, comment #8:

Here's a tiny script that I used to test.

It is attached to this bug report as tst_mbar.m

The window definitely grows each time a hide/show cycle is done.

(file #38885)

Rik <rik5>
Project Administrator
Fri 04 Nov 2016 09:30:43 AM UTC, comment #7:

I spoke too soon. With the patch applied, adding custom menus to the main menubar now makes the figure larger than it should ... looks like this was the intent of the if block. I'll have a look (seriously this time) ASAP. Reopening the report.

Pantxo Diribarne <pantxo>
Project Member
Thu 03 Nov 2016 11:58:38 PM UTC, comment #6:

I pushed your cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/0cd8a1c22f23). Thanks for that quick response. Closing report.

Rik <rik5>
Project Administrator
Thu 03 Nov 2016 10:52:41 PM UTC, comment #5:

There is an if block that prevents hidden menubar from being restored. I really don't know what was the intent but the attached patch fixes the issue.

(file #38878)

Pantxo Diribarne <pantxo>
Project Member
Thu 03 Nov 2016 09:43:14 PM UTC, comment #4:

Okay, I'm seeing it now.

For reference, this is with the qt toolkit.

With FLTK, the menubar can be hidden and restored, but nothing affects the toolbar. That's a separate issue.

Rik <rik5>
Project Administrator
Thu 03 Nov 2016 09:35:55 PM UTC, comment #3:

I can confirm comment #2 here.

Mike Miller <mtmiller>
Project Administrator
Thu 03 Nov 2016 09:24:02 PM UTC, comment #2:

set (gcf, 'menubar', 'none') hides both the menu and toolbar in matlab so that part works the same in octave as for matlab.

In matlab (and octave 4.0.3) set (gcf, 'menubar', 'figure') reshows the default figure menu and toolbar.

In the 4.2.0rc3, it only adds back the toolbar.

John Donoghue <lostbard>
Project Member
Thu 03 Nov 2016 09:00:53 PM UTC, comment #1:

Do you have code that reproduces the problem? This works for me

Note also that user-created uimenus are not affected by the 'menubar' property.

Rik <rik5>
Project Administrator
Thu 03 Nov 2016 06:27:23 PM UTC, original submission:

It seems switching uimenu on/off is broken in the 4.2-rc (which was working before).

The command:

turns off both the menubar and toolbar (should only affect the menubar). Even worse

does not return the menubar at all.

jsh <jsh>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #38913:  menubar4.patch added by pantxo (6KiB - text/x-diff)
file #38888:  tst_mbar2.m added by rik5 (242B - d2l/unknowntype)
file #38886:  menubar2.patch added by pantxo (3KiB - text/x-diff)
file #38885:  tst_mbar.m added by rik5 (274B - d2l/unknowntype)
file #38878:  menubar.patch added by pantxo (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by lostbard (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jsh (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 21 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 10 Nov 2016 05:32:56 AM UTCrik5StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Wed 09 Nov 2016 12:42:33 PM UTCpantxoAttached File-=>Added menubar4.patch, #38913
    Fri 04 Nov 2016 05:51:44 PM UTCrik5Attached File-=>Added tst_mbar2.m, #38888
    Fri 04 Nov 2016 03:45:43 PM UTCpantxoAttached File-=>Added menubar2.patch, #38886
    Fri 04 Nov 2016 03:27:25 PM UTCrik5Attached File-=>Added tst_mbar.m, #38885
    Fri 04 Nov 2016 09:30:43 AM UTCpantxoStatusFixed=>In Progress
      Open/ClosedClosed=>Open
    Thu 03 Nov 2016 11:58:38 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Thu 03 Nov 2016 10:52:41 PM UTCpantxoAttached File-=>Added menubar.patch, #38878
      StatusConfirmed=>Patch Submitted
    Thu 03 Nov 2016 09:44:28 PM UTCrik5Item GroupNone=>Regression
      Summarytoggling menubar on/off is broken=>set(gcf, "menubar", "figure") does not restore figure menu bar
    Thu 03 Nov 2016 09:43:30 PM UTCrik5Summarytoggling uimenu on/off is broken=>toggling menubar on/off is broken
    Thu 03 Nov 2016 09:43:14 PM UTCrik5Item GroupRegression=>None
      Summaryset(gcf, "menubar", "figure") does not restore figure menu bar=>toggling uimenu on/off is broken
    Thu 03 Nov 2016 09:35:55 PM UTCmtmillerItem GroupNone=>Regression
      StatusWorks For Me=>Confirmed
      Summarytoggling uimenu on/off is broken=>set(gcf, "menubar", "figure") does not restore figure menu bar
    Thu 03 Nov 2016 09:00:53 PM UTCrik5StatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1