setting position of fltk figure windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

setting position of fltk figure windows

John W. Eaton
Administrator
Using the current development sources, neither of the following
functions are setting the position of the figure window.  Can anyone
else duplicate this behavior?

  function f ()
    figure ("position", [200, 400, 400, 50]);
    drawnow ();
  endfunction

  function g ()
    h = figure ();
    set (h, "position", [200, 400, 400, 50]);
    drawnow ();
  endfunction

  graphics_toolkit fltk
  f ()
  g ()

However, executing the following at the command line does work:

  h = figure ();
  set (h, "position", [200, 400, 400, 50]);

provided that the figure is drawn before the set command is executed.
So neither of the following are working for me either:

  h = figure (); set (h, "position", [200, 400, 400, 50]);

  figure ("position", [200, 400, 400, 50]);

Ah, OK, the following does work (well, apparently only sometimes; or
maybe only for the first plot window after setting the graphics
toolkit to fltk):

  function g ()
    h = figure ();
    drawnow ();
    set (h, "position", [200, 400, 400, 50]);
  endfunction

But even if this way did work reliably, it makes a larger window flash
on the screen before it is resized and moved.  And in any case,
shouldn't any of these work?  And shouldn't I be able to set the size
of the window before it is drawn?

To confuse things even more, gnuplot behaves differently, of course.

jwe
Reply | Threaded
Open this post in threaded view
|

setting position of fltk figure windows

John W. Eaton
Administrator
On  2-Nov-2011, John W. Eaton wrote:

| Using the current development sources, neither of the following
| functions are setting the position of the figure window.  Can anyone
| else duplicate this behavior?
|
|   function f ()
|     figure ("position", [200, 400, 400, 50]);
|     drawnow ();
|   endfunction
|
|   function g ()
|     h = figure ();
|     set (h, "position", [200, 400, 400, 50]);
|     drawnow ();
|   endfunction
|
|   graphics_toolkit fltk
|   f ()
|   g ()
|
| However, executing the following at the command line does work:
|
|   h = figure ();
|   set (h, "position", [200, 400, 400, 50]);
|
| provided that the figure is drawn before the set command is executed.
| So neither of the following are working for me either:
|
|   h = figure (); set (h, "position", [200, 400, 400, 50]);
|
|   figure ("position", [200, 400, 400, 50]);
|
| Ah, OK, the following does work (well, apparently only sometimes; or
| maybe only for the first plot window after setting the graphics
| toolkit to fltk):
|
|   function g ()
|     h = figure ();
|     drawnow ();
|     set (h, "position", [200, 400, 400, 50]);
|   endfunction
|
| But even if this way did work reliably, it makes a larger window flash
| on the screen before it is resized and moved.  And in any case,
| shouldn't any of these work?  And shouldn't I be able to set the size
| of the window before it is drawn?
|
| To confuse things even more, gnuplot behaves differently, of course.

Never mind.  I checked in the following change to fix it for fltk:

  http://hg.savannah.gnu.org/hgweb/octave/rev/718f78b01de1

I think there is still a problem with the way gnuplot is working
though.

jwe
Reply | Threaded
Open this post in threaded view
|

Re: setting position of fltk figure windows

bpabbott
Administrator
On Nov 3, 2011, at 1:36 AM, John W. Eaton wrote:

> On  2-Nov-2011, John W. Eaton wrote:
>
> | Using the current development sources, neither of the following
> | functions are setting the position of the figure window.  Can anyone
> | else duplicate this behavior?
> |
> |   function f ()
> |     figure ("position", [200, 400, 400, 50]);
> |     drawnow ();
> |   endfunction
> |
> |   function g ()
> |     h = figure ();
> |     set (h, "position", [200, 400, 400, 50]);
> |     drawnow ();
> |   endfunction
> |
> |   graphics_toolkit fltk
> |   f ()
> |   g ()
> |
> | However, executing the following at the command line does work:
> |
> |   h = figure ();
> |   set (h, "position", [200, 400, 400, 50]);
> |
> | provided that the figure is drawn before the set command is executed.
> | So neither of the following are working for me either:
> |
> |   h = figure (); set (h, "position", [200, 400, 400, 50]);
> |
> |   figure ("position", [200, 400, 400, 50]);
> |
> | Ah, OK, the following does work (well, apparently only sometimes; or
> | maybe only for the first plot window after setting the graphics
> | toolkit to fltk):
> |
> |   function g ()
> |     h = figure ();
> |     drawnow ();
> |     set (h, "position", [200, 400, 400, 50]);
> |   endfunction
> |
> | But even if this way did work reliably, it makes a larger window flash
> | on the screen before it is resized and moved.  And in any case,
> | shouldn't any of these work?  And shouldn't I be able to set the size
> | of the window before it is drawn?
> |
> | To confuse things even more, gnuplot behaves differently, of course.
>
> Never mind.  I checked in the following change to fix it for fltk:
>
>  http://hg.savannah.gnu.org/hgweb/octave/rev/718f78b01de1
>
> I think there is still a problem with the way gnuplot is working
> though.
>
> jwe

Should this fix the bug reported below?

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

Ben

Reply | Threaded
Open this post in threaded view
|

Re: setting position of fltk figure windows

bpabbott
Administrator
In reply to this post by John W. Eaton

On Nov 3, 2011, at 1:36 AM, John W. Eaton wrote:

> On  2-Nov-2011, John W. Eaton wrote:
>
> | Using the current development sources, neither of the following
> | functions are setting the position of the figure window.  Can anyone
> | else duplicate this behavior?
> |
> |   function f ()
> |     figure ("position", [200, 400, 400, 50]);
> |     drawnow ();
> |   endfunction
> |
> |   function g ()
> |     h = figure ();
> |     set (h, "position", [200, 400, 400, 50]);
> |     drawnow ();
> |   endfunction
> |
> |   graphics_toolkit fltk
> |   f ()
> |   g ()
> |
> | However, executing the following at the command line does work:
> |
> |   h = figure ();
> |   set (h, "position", [200, 400, 400, 50]);
> |
> | provided that the figure is drawn before the set command is executed.
> | So neither of the following are working for me either:
> |
> |   h = figure (); set (h, "position", [200, 400, 400, 50]);
> |
> |   figure ("position", [200, 400, 400, 50]);
> |
> | Ah, OK, the following does work (well, apparently only sometimes; or
> | maybe only for the first plot window after setting the graphics
> | toolkit to fltk):
> |
> |   function g ()
> |     h = figure ();
> |     drawnow ();
> |     set (h, "position", [200, 400, 400, 50]);
> |   endfunction
> |
> | But even if this way did work reliably, it makes a larger window flash
> | on the screen before it is resized and moved.  And in any case,
> | shouldn't any of these work?  And shouldn't I be able to set the size
> | of the window before it is drawn?
> |
> | To confuse things even more, gnuplot behaves differently, of course.
>
> Never mind.  I checked in the following change to fix it for fltk:
>
>  http://hg.savannah.gnu.org/hgweb/octave/rev/718f78b01de1
>
> I think there is still a problem with the way gnuplot is working
> though.
>
> jwe

I just compared MacOS 10.7 with Apple's OpenGL and FLTK 1.3 to Ubuntu 10.04 with Mesa 7.7.1 and FLTK 1.1.10.

I'm not entirely sure if this change is responsible, but I'm now getting consistent results (MacOS was always buggy for me).

When I have time I'll go through the bug list and try to find the reports I filed and retest them.

Ben