FLTK 1.3.0
Fl_Double_Window Class Reference

The Fl_Double_Window provides a double-buffered window. More...

#include <Fl_Double_Window.H>

Inheritance diagram for Fl_Double_Window:
Fl_Window Fl_Group Fl_Widget Fl_Cairo_Window Fl_Overlay_Window

List of all members.

Public Member Functions

 Fl_Double_Window (int W, int H, const char *l=0)
 Creates a new Fl_Double_Window widget using the given position, size, and label (title) string.
 Fl_Double_Window (int X, int Y, int W, int H, const char *l=0)
 See Fl_Double_Window::Fl_Double_Window(int w, int h, const char *label = 0)
void flush ()
 Forces the window to be redrawn.
void hide ()
 Removes the window from the screen.
void resize (int, int, int, int)
 Changes the size and position of the window.
void show ()
 Puts the window on the screen.
void show (int a, char **b)
 Puts the window on the screen and parses command-line arguments.
 ~Fl_Double_Window ()
 The destructor also deletes all the children.

Protected Member Functions

void flush (int eraseoverlay)
 Forces the window to be redrawn.

Protected Attributes

char force_doublebuffering_
 Force double buffering, even if the OS already buffers windows (overlays need that on MacOS and Windows2000)

Detailed Description

The Fl_Double_Window provides a double-buffered window.

If possible this will use the X double buffering extension (Xdbe). If not, it will draw the window data into an off-screen pixmap, and then copy it to the on-screen window.

It is highly recommended that you put the following code before the first show() of any window in your program:

  Fl::visual(FL_DOUBLE|FL_INDEX)

This makes sure you can use Xdbe on servers where double buffering does not exist for every visual.


Constructor & Destructor Documentation

Fl_Double_Window::~Fl_Double_Window ( )

The destructor also deletes all the children.

This allows a whole tree to be deleted at once, without having to keep a pointer to all the children in the user code.


Member Function Documentation

void Fl_Double_Window::flush ( int  eraseoverlay) [protected]

Forces the window to be redrawn.

Parameters:
[in]eraseoverlaynon-zero to erase overlay, zero to ignore

Fl_Overlay_Window relies on flush(1) copying the back buffer to the front everywhere, even if damage() == 0, thus erasing the overlay, and leaving the clip region set to the entire window.

void Fl_Double_Window::hide ( ) [virtual]

Removes the window from the screen.

If the window is already hidden or has not been shown then this does nothing and is harmless.

Reimplemented from Fl_Window.

Reimplemented in Fl_Overlay_Window.

void Fl_Double_Window::resize ( int  ,
int  ,
int  ,
int   
) [virtual]

Changes the size and position of the window.

If shown() is true, these changes are communicated to the window server (which may refuse that size and cause a further resize). If shown() is false, the size and position are used when show() is called. See Fl_Group for the effect of resizing on the child widgets.

You can also call the Fl_Widget methods size(x,y) and position(w,h), which are inline wrappers for this virtual function.

A top-level window can not force, but merely suggest a position and size to the operating system. The window manager may not be willing or able to display a window at the desired position or with the given dimensions. It is up to the application developer to verify window parameters after the resize request.

Reimplemented from Fl_Window.

Reimplemented in Fl_Overlay_Window.

void Fl_Double_Window::show ( ) [virtual]

Puts the window on the screen.

Usually (on X) this has the side effect of opening the display.

If the window is already shown then it is restored and raised to the top. This is really convenient because your program can call show() at any time, even if the window is already up. It also means that show() serves the purpose of raise() in other toolkits.

Fl_Window::show(int argc, char **argv) is used for top-level windows and allows standard arguments to be parsed from the command-line.

See also:
Fl_Window::show(int argc, char **argv)

Reimplemented from Fl_Window.

Reimplemented in Fl_Overlay_Window.

void Fl_Double_Window::show ( int  argc,
char **  argv 
) [inline]

Puts the window on the screen and parses command-line arguments.

Usually (on X) this has the side effect of opening the display.

This form should be used for top-level windows, at least for the first (main) window. It allows standard arguments to be parsed from the command-line. You can use argc and argv from main(int argc, char **argv) for this call.

The first call also sets up some system-specific internal variables like the system colors.

Todo:
explain which system parameters are set up.
Parameters:
argccommand-line argument count, usually from main()
argvcommand-line argument vector, usually from main()
See also:
virtual void Fl_Window::show()

Reimplemented from Fl_Window.

Reimplemented in Fl_Overlay_Window.


The documentation for this class was generated from the following files: