Most test demos converted to use Fl_Double_Window

to prevent flicker when new users run test/demo programs.

For details, see fltk.development thread started 04/16/09,
"Subject: browser demo flicker".




git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6772 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Greg Ercolano 2009-04-21 09:09:37 +00:00
parent 03ec459eb0
commit b475babf17
28 changed files with 72 additions and 72 deletions

View File

@ -27,7 +27,7 @@
#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Adjuster.H>
#include <FL/Fl_Box.H>
@ -39,7 +39,7 @@ void adjcb(Fl_Widget *o, void *v) {
}
int main(int argc, char ** argv) {
Fl_Window window(320,100,argv[0]);
Fl_Double_Window window(320,100,argv[0]);
char buf1[100];
Fl_Box b1(FL_DOWN_BOX,20,30,80,25,buf1);

View File

@ -35,7 +35,7 @@
#include <stdio.h>
#include <string.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Return_Button.H>
@ -77,7 +77,7 @@ int main(int argc, char **argv) {
// the question dialog several times and make sure it doesn't crash.
// fc: added more fl_ask common dialogs for test cases purposes.
Fl_Window window(200, 105);
Fl_Double_Window window(200, 105);
Fl_Return_Button b(20, 10, 160, 35, buffer); b.callback(rename_me);
Fl_Button b2(20, 50, 160, 35, buffer2); b2.callback(rename_me_pwd);
window.end();

View File

@ -26,7 +26,7 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Bitmap.H>
#include <stdio.h>
@ -102,7 +102,7 @@ static uchar sorceress_bits[] = {
Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
Fl_Button *b;
Fl_Window *w;
Fl_Double_Window *w;
void button_cb(Fl_Widget *,void *) {
int i = 0;
@ -119,7 +119,7 @@ void button_cb(Fl_Widget *,void *) {
}
int main(int argc, char **argv) {
w = new Fl_Window(400,400);
w = new Fl_Double_Window(400,400);
b = new Fl_Button(140,160,120,120,"Bitmap");
b->image(new Fl_Bitmap(sorceress_bits,sorceress_width,sorceress_height));
leftb = new Fl_Toggle_Button(25,50,50,25,"left");

View File

@ -36,7 +36,7 @@ int N = 0;
#define H 50
#define ROWS 14
Fl_Window *window;
Fl_Double_Window *window;
void bt(const char *name, Fl_Boxtype type, int square=0) {
int x = N%4;

View File

@ -126,7 +126,7 @@ int main(int argc, char **argv) {
int i;
if (!Fl::args(argc,argv,i)) Fl::fatal(Fl::help);
const char* fname = (i < argc) ? argv[i] : "browser.cxx";
Fl_Window window(480,400,fname);
Fl_Double_Window window(480,400,fname);
browser = new Fl_Select_Browser(0,0,480,350,0);
browser->type(FL_MULTI_BROWSER);
//browser->type(FL_HOLD_BROWSER);

View File

@ -26,16 +26,16 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Clock.H>
#include <FL/Fl_Round_Clock.H>
int main(int argc, char **argv) {
Fl_Window window(220,220,"Fl_Clock");
Fl_Double_Window window(220,220,"Fl_Clock");
Fl_Clock c1(0,0,220,220); // c1.color(2,1);
window.resizable(c1);
window.end();
Fl_Window window2(220,220,"Fl_Round_Clock");
Fl_Double_Window window2(220,220,"Fl_Round_Clock");
Fl_Round_Clock c2(0,0,220,220); // c2.color(3,4);
window2.resizable(c2);
window2.end();

View File

@ -26,7 +26,7 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Hor_Value_Slider.H>
#include <FL/Fl_Choice.H>
#include <FL/fl_draw.H>
@ -100,7 +100,7 @@ public:
};
int main(int argc, char **argv) {
Fl_Window window(400,300);
Fl_Double_Window window(400,300);
Fl_Choice choice(80,100,200,25,"Cursor:");
choice.menu(choices);

View File

@ -40,7 +40,7 @@
# include <unistd.h>
#endif
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Choice.H>
@ -56,12 +56,12 @@ void doscheme(Fl_Choice *c, void *) {
Fl::scheme(c->text(c->value()));
}
Fl_Window *form;
Fl_Double_Window *form;
Fl_Button *but[9];
void create_the_forms() {
Fl_Widget *obj;
form = new Fl_Window(350, 440);
form = new Fl_Double_Window(350, 440);
obj = new Fl_Box(FL_FRAME_BOX,10,15,330,40,"FLTK Demonstration");
obj->color(FL_GRAY-4);
obj->labelsize(24);

View File

@ -48,6 +48,7 @@
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_PNM_Image.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Double_Window.H>
#include <string.h>
@ -91,9 +92,9 @@ int // O - Exit status
main(int argc, // I - Number of command-line arguments
char *argv[]) // I - Command-line arguments
{
Fl_Window *window;// Main window
Fl_Button *button;// Buttons
Fl_File_Icon *icon; // New file icon
Fl_Double_Window *window;// Main window
Fl_Button *button;// Buttons
Fl_File_Icon *icon; // New file icon
// Make the file chooser...
@ -108,7 +109,7 @@ main(int argc, // I - Number of command-line arguments
Fl_Shared_Image::add_handler(ps_check);
// Make the main window...
window = new Fl_Window(400, 215, "File Chooser Test");
window = new Fl_Double_Window(400, 215, "File Chooser Test");
filter = new Fl_Input(50, 10, 315, 25, "Filter:");
if (argc > 1)

View File

@ -30,7 +30,7 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Image.H>
#include <stdio.h>
@ -65,7 +65,7 @@ void make_image() {
Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
Fl_Button *b;
Fl_Window *w;
Fl_Double_Window *w;
void button_cb(Fl_Widget *,void *) {
int i = 0;
@ -121,7 +121,7 @@ int main(int argc, char **argv) {
}
#endif
Fl_Window window(400,400); ::w = &window;
Fl_Double_Window window(400,400); ::w = &window;
window.color(FL_WHITE);
Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b;

View File

@ -23,7 +23,7 @@
#include <stdio.h>
#include <FL/Fl_Button.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input_Choice.H>
void buttcb(Fl_Widget*,void*data) {
@ -44,7 +44,7 @@ void input_choice_cb(Fl_Widget*,void*data) {
}
int main(int argc, char **argv) {
Fl_Window win(300, 200);
Fl_Double_Window win(300, 200);
Fl_Input_Choice in(40,40,100,28,"Test");
in.callback(input_choice_cb, (void*)&in);

View File

@ -100,7 +100,7 @@ struct keycode_table{int n; const char* text;} table[] = {
int main(int argc, char** argv) {
Fl::add_handler(handle);
Fl_Window *window = make_window();
MyWindow *window = make_window();
window->show(argc,argv);
while (Fl::wait()) {
const char *str;

View File

@ -26,27 +26,27 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Box.H>
Fl_Window *form;
Fl_Double_Window *form;
Fl_Slider *sliders[8];
Fl_Choice *choice[3];
Fl_Check_Button *draw_line;
class test_box: public Fl_Window {
class test_box: public Fl_Double_Window {
void draw();
public:
test_box(int x,int y,int w,int h,const char *l=0)
: Fl_Window(x,y,w,h,l) {}
: Fl_Double_Window(x,y,w,h,l) {}
}*test;
void test_box::draw() {
Fl_Window::draw();
Fl_Double_Window::draw();
fl_color((uchar)(sliders[0]->value()),
(uchar)(sliders[1]->value()),
(uchar)(sliders[2]->value()));
@ -111,7 +111,7 @@ void do_redraw(Fl_Widget*,void*)
}
void makeform(const char *) {
form = new Fl_Window(500,230,"fl_line_style() test");
form = new Fl_Double_Window(500,230,"fl_line_style() test");
sliders[0]= new Fl_Value_Slider(280,10,180,20,"R");
sliders[0]->bounds(0,255);
sliders[1]= new Fl_Value_Slider(280,30,180,20,"G");

View File

@ -28,7 +28,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Slider.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input.H>
class Drawing_Area : public Fl_Box {

View File

@ -1,5 +1,5 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0108
version 1.0300
header_name {.h}
code_name {.cxx}
decl {\#include "mandelbrot.h"} {public
@ -12,7 +12,7 @@ class Drawing_Window {open
Function {make_window()} {open return_type void
} {
Fl_Window window {open selected
xywh {178 479 450 520} type Single resizable
xywh {178 479 450 520} type Double resizable
code0 {o->size_range(220,220);} visible
} {
Fl_Box d {

View File

@ -27,7 +27,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Toggle_Button.H>
#include <FL/Fl_Menu_Button.H>
@ -39,7 +39,7 @@
void window_cb(Fl_Widget* w, void*) {
puts("window callback called");
((Fl_Window *)w)->hide();
((Fl_Double_Window *)w)->hide();
}
void test_cb(Fl_Widget* w, void*) {
@ -178,7 +178,7 @@ int main(int argc, char **argv) {
sprintf(buf,"item %d",i);
hugemenu[i].text = strdup(buf);
}
Fl_Window window(WIDTH,400);
Fl_Double_Window window(WIDTH,400);
window.callback(window_cb);
Fl_Menu_Bar menubar(0,0,WIDTH,30); menubar.menu(menutable);
menubar.callback(test_cb);

View File

@ -44,13 +44,13 @@
#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Slider.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Return_Button.H>
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(400,320,argv[0]);
Fl_Double_Window *window = new Fl_Double_Window(400,320,argv[0]);
window->resizable(*(new Fl_Box(FL_ENGRAVED_FRAME,10,10,300,300,
"MINIMUM UPDATE TEST\n"
"\n"

View File

@ -27,7 +27,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Value_Input.H> // necessary for bug in mingw32?
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Hor_Value_Slider.H>
#include <FL/Fl_Toggle_Button.H>
@ -41,7 +41,7 @@ Fl_Multiline_Output *text2;
Fl_Input *input;
Fl_Value_Slider *fonts;
Fl_Value_Slider *sizes;
Fl_Window *window;
Fl_Double_Window *window;
void font_cb(Fl_Widget *,void *) {
text->textfont(int(fonts->value()));
@ -63,7 +63,7 @@ void input_cb(Fl_Widget *,void *) {
}
int main(int argc, char **argv) {
window = new Fl_Window(400,400);
window = new Fl_Double_Window(400,400);
input = new Fl_Input(50,375,350,25);
input->static_value("The quick brown fox\njumped over\nthe lazy dog.");

View File

@ -32,7 +32,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Pack.H>
@ -57,8 +57,8 @@ void spacing_cb(Fl_Value_Slider*o, long) {
}
int main(int argc, char **argv) {
Fl_Window *w;
{Fl_Window* o = new Fl_Window(360, 370);
Fl_Double_Window *w;
{Fl_Double_Window* o = new Fl_Double_Window(360, 370);
w = o;
scroll = new Fl_Scroll(10,10,340,285);
{Fl_Pack* o = new Fl_Pack(10, 10, 340, 285);

View File

@ -26,7 +26,7 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Pixmap.H>
#include <stdio.h>
@ -37,7 +37,7 @@
Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
Fl_Button *b;
Fl_Window *w;
Fl_Double_Window *w;
void button_cb(Fl_Widget *,void *) {
int i = 0;
@ -66,7 +66,7 @@ int main(int argc, char **argv) {
if (Fl::args(argc,argv,i,arg) < argc)
Fl::fatal(" -8 # : use default visual\n%s\n",Fl::help);
Fl_Window window(400,400); ::w = &window;
Fl_Double_Window window(400,400); ::w = &window;
Fl_Button b(140,160,120,120,"Pixmap"); ::b = &b;
Fl_Pixmap *pixmap = new Fl_Pixmap(porsche_xpm);
Fl_Pixmap *depixmap;

View File

@ -27,7 +27,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Shared_Image.H>
#include <string.h>
@ -36,7 +36,7 @@
#include <FL/fl_message.H>
Fl_Box *b;
Fl_Window *w;
Fl_Double_Window *w;
Fl_Shared_Image *img;
@ -105,7 +105,7 @@ int main(int argc, char **argv) {
Fl::args(argc,argv,i,arg);
Fl_Window window(400,435); ::w = &window;
Fl_Double_Window window(400,435); ::w = &window;
Fl_Box b(10,45,380,380); ::b = &b;
b.box(FL_THIN_DOWN_BOX);
b.align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);

View File

@ -30,13 +30,13 @@
#define W3 (5*W1+6*B)
#include <FL/Fl.H>
#include <FL/Fl_Single_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Radio_Button.H>
#include <FL/fl_draw.H>
#include <FL/fl_message.H>
Fl_Single_Window *window;
Fl_Double_Window *window;
Fl_Box *box;
int big = 0;
@ -64,7 +64,7 @@ void b_cb(Fl_Widget *,long w) {
}
int main(int argc, char **argv) {
window = new Fl_Single_Window(W3,W3);
window = new Fl_Double_Window(W3,W3);
window->box(FL_NO_BOX);
Fl_Box *n;
for (int x = 0; x<4; x++) for (int y = 0; y<4; y++) {

View File

@ -27,7 +27,7 @@
#include <FL/Fl.H>
#include <FL/Enumerations.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Group.H>
#include <FL/fl_ask.H>
@ -162,7 +162,7 @@ class SudokuCell : public Fl_Widget {
// Sudoku window class...
class Sudoku : public Fl_Window {
class Sudoku : public Fl_Double_Window {
Fl_Sys_Menu_Bar *menubar_;
Fl_Group *grid_;
time_t seed_;
@ -627,7 +627,7 @@ Fl_Preferences Sudoku::prefs_(Fl_Preferences::USER, "fltk.org", "sudoku");
// Create a Sudoku game window...
Sudoku::Sudoku()
: Fl_Window(GROUP_SIZE * 3, GROUP_SIZE * 3 + MENU_OFFSET, "Sudoku")
: Fl_Double_Window(GROUP_SIZE * 3, GROUP_SIZE * 3 + MENU_OFFSET, "Sudoku")
{
int j, k;
Fl_Group *g;
@ -1215,7 +1215,7 @@ Sudoku::reset_cb(Fl_Widget *widget, void *) {
void
Sudoku::resize(int X, int Y, int W, int H) {
// Resize the window...
Fl_Window::resize(X, Y, W, H);
Fl_Double_Window::resize(X, Y, W, H);
// Save the new window geometry...
prefs_.set("x", X);

View File

@ -30,7 +30,7 @@
#include <string.h>
#include <ctype.h>
#include <FL/Fl.H>
#include <FL/Fl_Single_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/fl_draw.H>
@ -41,7 +41,7 @@ int N = 0;
#define ROWS 6
#define COLS 6
Fl_Window *window;
Fl_Double_Window *window;
Fl_Value_Slider *orientation;
Fl_Value_Slider *size;
@ -93,7 +93,7 @@ void bt(const char *name) {
}
int main(int argc, char ** argv) {
window = new Fl_Single_Window(COLS*W,ROWS*H+60);
window = new Fl_Double_Window(COLS*W,ROWS*H+60);
bt("@->");
bt("@>");
bt("@>>");

View File

@ -29,7 +29,7 @@
#if HAVE_PTHREAD || defined(WIN32)
# include <FL/Fl.H>
# include <FL/Fl_Window.H>
# include <FL/Fl_Double_Window.H>
# include <FL/Fl_Browser.H>
# include <FL/Fl_Value_Output.H>
# include <FL/fl_ask.H>
@ -120,13 +120,13 @@ void* prime_func(void* p)
int main(int argc, char **argv)
{
Fl_Window* w = new Fl_Window(200, 200, "Single Thread");
Fl_Double_Window* w = new Fl_Double_Window(200, 200, "Single Thread");
browser1 = new Fl_Browser(0, 0, 200, 175);
w->resizable(browser1);
value1 = new Fl_Value_Output(100, 175, 200, 25, "Max Prime:");
w->end();
w->show(argc, argv);
w = new Fl_Window(200, 200, "Six Threads");
w = new Fl_Double_Window(200, 200, "Six Threads");
browser2 = new Fl_Browser(0, 0, 200, 175);
w->resizable(browser2);
value2 = new Fl_Value_Output(100, 175, 200, 25, "Max Prime:");

View File

@ -33,7 +33,7 @@
//#define TEST_INACTIVE
int main(int argc, char** argv) {
Fl_Window window(300,300);
Fl_Double_Window window(300,300);
window.box(FL_NO_BOX);
window.resizable(window);
Fl_Tile tile(0,0,300,300);
@ -42,7 +42,7 @@ int main(int argc, char** argv) {
box0.color(9);
box0.labelsize(36);
box0.align(FL_ALIGN_CLIP);
Fl_Window w1(150,0,150,150,"1");
Fl_Double_Window w1(150,0,150,150,"1");
w1.box(FL_NO_BOX);
Fl_Box box1(0,0,150,150,"1\nThis is a\nchild\nwindow");
box1.box(FL_DOWN_BOX);

View File

@ -26,7 +26,7 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_Tiled_Image.H>
@ -37,7 +37,7 @@
#include "pixmaps/tile.xpm"
Fl_Button *b;
Fl_Window *w;
Fl_Double_Window *w;
void button_cb(Fl_Widget *,void *) {
w->hide();
@ -83,7 +83,7 @@ int main(int argc, char **argv) {
}
#endif
Fl_Window window(400,400); ::w = &window;
Fl_Double_Window window(400,400); ::w = &window;
Fl_Group group(0,0,400,400);
group.image(new Fl_Tiled_Image(new Fl_Pixmap((const char * const *)tile_xpm)));
group.align(FL_ALIGN_INSIDE);

View File

@ -23,7 +23,6 @@
//
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Choice.H>