I'm trying to write an application that puts a control window on the first
screen, and a full-screen display on the second screen. I'm attempting to base
this from the fullscreen.cxx example in the test directory.
Below is what I've put into a .fl file. The numbers that get printed out
appear to be correct. What I would expect is for the first window to appear on
my first display, and a small window to appear on my second display. Instead
both windows appear on my first display.
The only thing I've found on the fltk forums appears to be a similar problem
from 2005. Is there something straightforward that I've overlooked? I'm
running my test on Mac OS X 10.6 with FLTK 1.3.
--
# data file for the Fltk User Interface Designer (fluid)
version 1.0300
do_not_include_H_from_C
header_name {.h}
code_name {.cxx}
decl {\#include <iostream>} {private local
}
decl {\#include <Fl/Fl.H>} {private local
}
decl {\#include <Fl/gl.H>} {private local
}
decl {\#include <Fl/Fl_Gl_Window.H>} {private local
}
decl {\#include <Fl/Fl_Double_Window.H>} {private local
}
decl {\#include "full_screen_test.h"} {private local
}
decl {using namespace std;} {private local
}
class Gl_Window {open : {public Fl_Gl_Window}
} {
Function {Gl_Window(int x, int y, int w, int h, const char* l =
NULL):Fl_Gl_Window(x,y,w,h,l)} {} {
code {} {}
}
Function {draw()} {open private
} {
code {cout << x() << '\\t' << y() << endl;} {}
}
}
decl {Fl_Double_Window* Controller;} {private local
}
decl {Gl_Window* SecondDisplay;} {private local
}
Function {close_all_cb(Fl_Widget *o, void *p)} {open return_type void
} {
code {Controller->hide();
SecondDisplay->hide();} {}
}
Function {} {open
} {
code {int n_screens = Fl::screen_count();
int x, y, w, h;
for( unsigned long i=0; i<n_screens; i++ )
{
Fl::screen_xywh( x, y, w, h, i );
cout << x << '\\t' << y << '\\t' << w << '\\t' << h << endl;
}
if ( n_screens > 1 )
{
// try to display a full-screen GL window to second display
// open a main display window
Fl::screen_xywh( x, y, w, h, 0 );
Controller = new Fl_Double_Window ( x + 30, y + 30, 640, 480 ); // w - 60,
h - 60 );
Controller->end();
Controller->set_modal();
Controller->callback( close_all_cb );
Controller->show();
Fl::screen_xywh( x, y, w, h, 1 );
SecondDisplay = new Gl_Window( x+w/2, y+h/2, 256, 256 );
SecondDisplay->mode ( FL_DOUBLE | FL_RGB );
SecondDisplay->resizable( SecondDisplay );
SecondDisplay->callback( close_all_cb );
SecondDisplay->show();
}
else
{
cout << "Single screen system" << endl;
}} {selected
}
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk