octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FLTK refresh required


From: Ben Abbott
Subject: Re: FLTK refresh required
Date: Sun, 28 Jul 2013 18:57:19 -0400

On Jul 28, 2013, at 3:16 PM, Rik wrote:

> 7/28/13
> 
> Ben,
> 
> With Michael's, yours, and my latest changeset (hg id =
> 17099::a033fd3669c0) I now get the following.
> 
> hf = figure ();
> get (hf, 'position')
> ans =
> 
>   304   215   560   380
> 
> Is this the right answer?  I measured the Y-height of the canvas and it is
> indeed 380 pixels between the bottom of the menubar and the top of the 
> toolbar.

Its better than the result on MacOSX.  At least for Linux the plot canvas size 
matches the figure's position property.

However, the height should be 420 pixels.  There's a bug report on this at the 
link below.

        https://savannah.gnu.org/bugs/index.php?39577

And a different one for MacOSX at the link below.

        https://savannah.gnu.org/bugs/?39555

I'm able to fix the MacOSX problem using pre-processor stuff, but don't plan on 
pushing that since I expect both problems have the same root cause.  I've been 
fiddling with the code, but haven't found a proper solution.

> Also, do we have hidden assumptions about the presence of the menubar and
> the toolbar in these calculations?  A figure object has two properties,
> "menubar" and "toolbar", which are supposed to control whether these
> objects are visible.  I don't like the menubar so I tried to use
> 
> set (0, "DefaultFigureMenubar", "none")
> 
> but apparently we aren't respecting this property yet.

My impression is that both the menubar and the toolbar should be constructed on 
the m-file side of things.  For that to be possible a uicontrol foundation 
needs to be added to the fltk toolkit.

        http://www.mathworks.com/help/matlab/ref/uicontrol.html

> Instead, I hacked figure.m and just commented out the creation of the menubar.
> 
> if (strcmp (get (f, "__graphics_toolkit__"), "fltk"))
> #__add_default_menu__ (f);
> endif
> 
> Now if I run the same test I get a window without a menubar, but the
> position returned is the same.
> 
> hf = figure ();
> get (hf, 'position')
> ans =
> 
>   304   215   560   380

If you leave the menubar hidden, the fltk toolkit should render the figure 
correctly.  I haven't tried it, but I'd just modify show_menubar () so that it 
doesn't actually do anything.

  void show_menubar (void)
  {
    if (!uimenu->is_visible ())
      {
        canvas->resize (canvas->x (),
-                       canvas->y () + menu_h,
                        canvas->y (),
                        canvas->w (),
                        canvas->h ());
-       uimenu->show ();
-       mark_modified ();
      }
  }

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]