changeset 13798:718f78b01de1

allow initial position to be set for fltk windows * __init_fltk__.cc (figure_manager::default_size): Delete. (figure_manager::do_new_window): Get figure position from properties.
author John W. Eaton <jwe@octave.org>
date Thu, 03 Nov 2011 01:30:54 -0400
parents 53674ceb9133
children 760e4e88dba3
files src/DLD-FUNCTIONS/__init_fltk__.cc
diffstat 1 files changed, 9 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc
+++ b/src/DLD-FUNCTIONS/__init_fltk__.cc
@@ -1568,13 +1568,19 @@
 
   void do_new_window (figure::properties& fp)
   {
-    int x, y, w, h;
+    int idx = figprops2idx (fp);
 
-    int idx = figprops2idx (fp);
     if (idx >= 0 && windows.find (idx) == windows.end ())
       {
-        default_size (x, y, w, h);
+        Matrix pos = fp.get_position ().matrix_value ();
+
+        int x = pos(0);
+        int y = pos(1);
+        int w = pos(2);
+        int h = pos(3);
+
         idx2figprops (curr_index , fp);
+
         windows[curr_index++] = new plot_window (x, y, w, h, fp);
       }
   }
@@ -1679,16 +1685,6 @@
       }
   }
 
-
-  // FIXME -- default size should be configurable.
-  void default_size (int& x, int& y, int& w, int& h)
-  {
-    x = 0;
-    y = 0;
-    w = 640;
-    h = 480;
-  }
-
   static int str2idx (const caseless_str clstr)
   {
     int ind;