30 Module Documentation. 31 Class Documentation code itself, special comments in the code, and additional documentation files. 2 – FLTK Basics. This chapter teaches you the basics of compiling programs that use FLTK. Writing Your First FLTK Program. All programs must include the file. class Fl. Class Hierarchy. Fl. Include Files. #include. Description. The Fl class is the FLTK global (static) class containing state information and global.

Author: Gusar Gusho
Country: Suriname
Language: English (Spanish)
Genre: Spiritual
Published (Last): 22 February 2016
Pages: 126
PDF File Size: 9.92 Mb
ePub File Size: 7.82 Mb
ISBN: 779-1-71720-322-6
Downloads: 21324
Price: Free* [*Free Regsitration Required]
Uploader: Vujin

The Fl class documentatiin the FLTK global static class containing state information and global methods for the current application. FLTK will call this callback just before it flushes the display and waits for events. This is different than an idle callback because it is only called once, then FLTK calls the system and tells it not to return until an event happens. This can be used by code that wants to monitor the application’s state, such as to keep a display up to date. The advantage of tltk a flgk callback is that it is called only when no events are pending.

If events are coming in quickly, whole blocks of them will be processed before this is called once. This can save significant time and avoid the application falling behind the events.

Fast Light Toolkit

When the fd becomes ready for reading Fl:: There can only be one callback of each type for a file descriptor. Under UNIX any file descriptor can be monitored files, devices, pipes, sockets, etc. If FLTK cannot figure out what to do with an event, it calls each of these functions most recent first until one of them returns non-zero. If none of them returns non zero then the event is ignored. Events that cause this to be called are: This lets you provide global shortcut keys.

System events that FLTK does not recognize. Some other events when the widget FLTK selected returns zero from its handle method. Exactly which ones may change in future versions, however.

The idle function can be used to get background processing done. You can have multiple idle callbacks. To remove an idle callback use Fl:: FLTK will not recursively call the idle callback. The function will be called by Fl:: You can have multiple timeout callbacks.

To remove an timeout callback use Fl:: If you need more accurate, repeated timeouts, use Fl:: The following code will print “TICK” each second on stdout with a fair degree of accuracy:.

Consume a single switch from argvstarting at word i. Returns the number of words eaten 1 or 2, or 0 if it is not recognized and adds the same value to i.

You can use this function if you prefer to control the incrementing through the arguments yourself. You don’t have to call it if you don’t like documentatiion

fltk(3) – Linux man page

Everything it can do can be done with other calls to FLTK. To use the switch parser, call Fl:: This does not open the display, instead switches that need the display open are stashed into static variables. It is called with the same argc and argvand with i the index of each word.


The callback should return zero if the switch is unrecognized, and not change i. It should return non-zero if the switch is recognized, and add at least 1 to i it can add more to consume words after the switch.

This function is called before any other tests, so you can override any FLTK switch this is why FLTK can use very short switches instead of the long ones all other toolkits force you to use. Documentatoin return i documentatoin set to the index of the first non-switch. The first word that does not start with ‘-‘.

The word ‘-‘ used by many programs to name stdin as a file The first unrecognized switch return value is 0. If your program takes no arguments other than switches you should produce an error if the return value is less than argc. All switches except -bg2 may be abbreviated one letter and case is ignored: The second form of Fl:: It parses all the switches, and if any are documentatiob recognized it calls Fl:: A usage string is displayed if Fl:: You can change the message by setting the Fl:: Multiple calls to Fl:: The default message handler saves the last message which can be accessed using the Fl:: The second form of awake registers a function that will be called by the main thread during documentatiln next message handling cycle.

fltk(3): fast light tool kit – Linux man page

Over a thousand awake callbacks can be registered simultaneously. Documentaion are the colors used as backgrounds by almost all widgets and used to draw the edges of all the boxtypes.

This is for highlighting buttons. These functions return the offset values necessary for a given boxtype, useful for computing the area inside a box’s borders, to prevent overdrawing the borders. An example to compute the area inside a widget’s box: Calling this during a big calculation will keep the screen up to date and the interface responsive: If true is returned, then it docymentation modified the Fl:: In will also set the “del” parameter to the number of bytes to the left of the documentafion to delete, this is used to delete the results of the previous call to Fl:: If false is returned, the keys should be treated as function keys, and del is set to zero.

You could insert the text anyways, if you don’t know what else to do.

Though the current implementation returns immediately, future versions may take quite awhile, as they may pop up a window or do other user-interface things to allow characters to be selected. The next call to Fl:: In particular it will not set “del” to non-zero.

This call is very fast so it is ok to call it many times and in many places. The selection clipboard is used for middle-mouse pastes and for drag-and-drop selections.


It hides the window and then calls the default widget callback. Schedules a widget for deletion at the next call to the event loop. Use this method to delete a widget inside a callback function. As with normal widget deletion it is your responsibility to remove the widget from docu,entation parent group or window before calling this. To avoid early deletion of widgets, this function should be called toward the end of a callback and only after any call to the event loop Fl:: When deleting groups or windows, you must only delete the group or window widget and not the individual child widgets.

Sets the X display to use for all windows. The clipboard should be filled with relevant data before calling this method. FLTK will then initiate the system wide drag and drop handling. Dropped data will be marked as text. You can override the behavior by setting the function pointer to docuemntation own routine. The default implementation prints the error message to stderr and returns. For more details, see Fl:: This function returns the button state at the time of the event.

Returns Doocumentation for N clicks. The second form directly sets the number returned by Fl:: This can be used to set it to zero so that later code does not think an item was double-clicked.

This can be used to determine if a callback is being dltk in response to a keypress, mouse click, etc. You should always call this rather than doing your own comparison so you are consistent about edge effects.

The second form clears the value returned by Fl:: Useful to prevent the next click from being counted as a double-click or to make a popup menu pick documentatioh item with a single click.

Don’t pass fktk to this. It returns zero if the last event was not a key press or release. This is constant until the next event is read from the server. Under X this requires a round-trip to the server and is much slower than Fl:: Keys are identified by the unshifted values.

FLTK defines a set of symbols that should work on most modern machines flhk every key on the keyboard: The space bar is All other keys on the keypad have a symbol: Be careful not to confuse these with the very similar, but all-caps, symbols used by Fl:: There will always be a nul at this position in the text.

However there may be dodumentation nul before docunentation if the keystroke translates to a nul character or you paste a nul character. The second version returns non-zero if any of the passed bits are turned on.

The legal bits are: The values were selected to match the XFree86 server on Linux.

Back to top