Making a subclass of Fl_Window

There are two reasons to make a subclass of Fl_Window. First, you may want to make a widget that is an entire window. In that case, just override the draw() and handle() routines exactly like you would do for a subclass of Fl_Object.

The other reason for making a subclass of Fl_Window is to change X stuff, such as the visual or background pixel or any of the other complexities that X sometimes requires. There are then several virtual functions you must override to change how your window is created, destroyed, and drawn. This entire section is very subject to change! It is also X-specific and your code will not be portable to other systems.

#include <FL/x.H>

You almost certainly need to use this header file in order to override any of these virtual functions.

Virtual methods on Fl_Window

virtual void show()

virtual void flush()

virtual void hide()

virtual ulong colormap()

Useful proteced methods on Fl_Window

void Fl_Window::make_xid(XVisualInfo *);

void Fl_Window::make_current(ulong xid);

(back to contents)