From 87dd7f0d23eba5c09e71ec6efeb34c6844f5e95f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 29 Dec 1998 14:21:17 +0000 Subject: Revised documentation files. git-svn-id: file:///fltk/svn/fltk/trunk@177 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/osissues.html | 455 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 455 insertions(+) create mode 100644 documentation/osissues.html (limited to 'documentation/osissues.html') diff --git a/documentation/osissues.html b/documentation/osissues.html new file mode 100644 index 000000000..f9cd36991 --- /dev/null +++ b/documentation/osissues.html @@ -0,0 +1,455 @@ + + + +

F - Operating System Specific Issues

+ +Fltk X-specific interface +

Fltk X-specific interface

+ +#include <FL/x.H> + +

On Unix/X you can include this file to access fltk's X-specific +functions. Be warned that some of the structures and calls in it are +subject to change in future version of fltk. Try to avoid doing this +so your code is portable. + +


+ +

Handling other X events

+ + +

void Fl::add_handler(int (*f)(int));

extern XEvent* fl_xvent;

extern ulong fl_event_time;

Window fl_xid(const Fl_Window*);

Fl_Window* fl_find(ulong xid);

int fl_handle(const XEvent&);

+


+ + +

Drawing using Xlib

+ +

+extern Display* fl_display;
+extern Window fl_window;
+extern GC fl_gc;
+extern int fl_screen;
+extern XVisualInfo* fl_visual;
+extern Colormap fl_colormap;

unsigned long fl_xpixel(Fl_Color i);

unsigned long fl_xpixel(uchar r, uchar g, uchar +b);

extern XFontStruct* fl_xfont;

+ +


+ + +

Changing the display, screen, or X visual

+ +

Fltk uses only a single display, screen, X visual, and X colormap. +This greatly simplifies it's internal structure and makes it much +smaller and faster. You can change which it uses by setting global +variables before the first Fl_Window::show() is called. +You may also want to call Fl::visual(int), which is a portable interface +to get a full color and/or double buffered visual. + +

int Fl::display(const char *)

extern Display* fl_display;

void fl_open_display();

void fl_close_display();

extern int fl_screen;

extern XVisualInfo* fl_visual;
+extern Colormap fl_colormap;

+ +


+ +

Using a subclass of Fl_Window for special X stuff

+ +Fltk can manage an X window on a different screen, visual and/or +colormap, you just can't use fltk's drawing routines to draw into it. +But you can write your own draw() method that uses Xlib calls only. + +

Fltk can also manage xid's provided by other libraries or programs, +and call those libraries when the window needs to be redrawn. + +

To do this, you need to make a subclass of Fl_Window and override some of these virtual +functions: + +

virtual void Fl_Window::show()

virtual void Fl_Window::flush()

virtual void Fl_Window::hide()

virtual void Fl_Window::~Fl_Window()

+ +

(back to contents) +Fltk MSWindows-specific interface +

#include <FL/x.H>
+Fltk MSWindows-specific interface

+ +The <FL/x.H> header file defines the interface to fltk's +MSWindows-specific functions. Be warned that some of the structures +and calls in it are subject to change in future version of fltk. Try +to avoid doing this so your code is portable. + +


+ +

Handling other MSWindows messages

+ +

A single WNDCLASSEX called "FLTK" is created. All +Fl_Windows are of this class. This window class is created the first +time Fl_Window::show() is called. + +

You can probably combine fltk with other libraries that make their +own MSWindows window classes. The easiest way is to call Fl::wait(), it +will call DispatchMessage for all messages to the other windows. If +necessary you can let the other library take over (as long as it calls +DispatchMessage()), but you will have to arrange for the function +Fl::flush() to be called regularily (otherwise widgets will not +update), and timeouts and the idle function will not work. + + +

extern MSG fl_msg;

void Fl::add_handler(int (*f)(int));

HWND fl_xid(const Fl_Window*);

Fl_Window* fl_find(HWND xid)

+ +


+ +
+

Drawing things using the MSWindows GDI

+ +

When the virtual function Fl_Widget::draw() is called, fltk has +stashed in some global variables all the silly extra arguments you +need to make a proper GDI call. These are: + +

+extern HINSTANCE fl_display;
+extern HWND fl_window;
+extern HDC fl_gc;
+COLORREF fl_RGB();
+HPEN fl_pen();
+HBRUSH fl_brush();

+


+

How to not get a MSDOS console window

+ +MSWindows has a really stupid mode switch stored in the executables that +controls whether or not to make a console window (hint to Mr Gates: +why not leave it hidden until the program prints something?). + +

To not produce a "console" window when you run your program add the +following secret incantation to the Micro$oft linker: + +

        /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
+ +

Unfortunately this seems to completely disable stdin/stdout, even +if you run the program from a console. So don't do this until you +have debugged your program! + +


+

Other hints

+ +

I use capital C as the extension for c++ source code, for instace +for Fluid output. Unfortunately there is no way to convince VC++ to +use this except to tell it to compile *everything* using C++ by +putting the switch "/TP" in the options. This makes it impossible to +combine old C code and fltk code. + +


+

Known bugs

+ +

If program is deactivated, Fl::wait() does not return until it is +activated again, even though many events are delivered to the program. +This can cause idle background processes to stop unexpectedly. This +also happens while the user is dragging or resizing windows or +otherwise holding the mouse down. I was forced to remove most of the +efficiency fltk uses for redrawing in order to get windows to update +while being moved. This is a design error in MSWindows and probably +impossible to get around. + +

Fl_Gl_Window::can_do_overlay() returns true until the first time it +attempts to draw an overlay, and then correctly returns whether or not +there is overlay hardware. + +

Cut text contains ^J rather than ^M^J to break lines. This is a +feature, not a bug. + +

I can't seem to get SetCapture (used by Fl::grab()) to work, and I +can't find a way to stop the main window title from turning gray while +menus are popped up. + +

glpuzzle program does not animate unless you resize it first. Unknown why. + +

Fl_Window::fullscreen() not implemented (should take over the screen +without a title bar). Currently does maximize instead. + +

Import .bmp files into fluid. Wonko has the specs. + +

Can't set icon of windows. + + + + -- cgit v1.2.3