~ubuntu-branches/ubuntu/karmic/fltk1.1/karmic

« back to all changes in this revision

Viewing changes to documentation/Fl.html

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-05-22 13:57:06 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050522135706-mchag24yf42lu7bu
Tags: 1.1.6-5
* Revert previous change, which seems to have been ineffective for some
  reason, in favor of commenting out the problematic Makefile rule
  altogether.  (Closes: #310151.)
* debian/control: Go back to specifying the URL as part of the
  description rather than via a non-standard field that doesn't seem to
  have caught on.  (Closes: #310240.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        <LI><A HREF="#Fl.copy">copy</A></LI>
50
50
        <LI><A HREF="#Fl.damage">damage</A></LI>
51
51
        <LI><A HREF="#Fl.default_atclose">default_atclose</A></LI>
 
52
        <LI><A HREF="#Fl.delete_widget">delete_widget</A></LI>
52
53
        <LI><A HREF="#Fl.display">display</A></LI>
53
54
        <LI><A HREF="#Fl.dnd">dnd</A></LI>
54
55
        <LI><A HREF="#Fl.dnd_text_ops">dnd_text_ops</A></LI>
233
234
<tt>Fl::wait()</tt> at <i>t</i> seconds after this function is called.
234
235
The optional <tt>void*</tt> argument is passed to the callback.
235
236
 
 
237
<P>You can have multiple timeout callbacks. To remove an timeout
 
238
callback use <A
 
239
href="#Fl.remove_timeout"><tt>Fl::remove_timeout()</tt></A>.
 
240
 
 
241
<p>If you need more accurate, repeated timeouts, use <a
 
242
href='#Fl.repeat_timeout'><tt>Fl::repeat_timeout()</tt></a> to
 
243
reschedule the subsequent timeouts.</p>
 
244
 
 
245
<p>The following code will print &quot;TICK&quot; each second on
 
246
<tt>stdout</tt> with a fair degree of accuracy:</p>
 
247
 
 
248
<PRE>
 
249
    void callback(void*) {
 
250
      puts("TICK");
 
251
      Fl::repeat_timeout(1.0, callback);
 
252
    }
 
253
 
 
254
    int main() {
 
255
      Fl::add_timeout(1.0, callback);
 
256
      return Fl::run();
 
257
    }
 
258
</PRE>
 
259
 
236
260
<H4><A NAME="Fl.arg">int arg(int, char**, int&amp;);</A></H4>
237
261
 
238
262
<P>Consume a single switch from <tt>argv</tt>, starting at word i.
468
492
 
469
493
<H4><A NAME="Fl.default_atclose">void default_atclose(Fl_Window*,void*);</A></H4>
470
494
 
 
495
<p>This is the default callback for window widgets. It hides the
 
496
window and then calls the default widget callback.</p>
 
497
 
 
498
<H4><A NAME="Fl.delete_widget">void delete_widget(Fl_Widget*);</A></H4>
 
499
 
 
500
<p>Schedules a widget for deletion when it is safe to do so. Use
 
501
this method to delete a widget inside a callback function. When
 
502
deleting groups or windows, you must only delete the group or
 
503
window widget and not the individual child widgets.</p>
 
504
 
471
505
<H4><A NAME="Fl.display">void display(const char*);</A></H4>
472
506
 
473
507
<P>Sets the X display to use for all windows.  Actually this just sets
988
1022
 
989
1023
<H4><A NAME="Fl.repeat_timeout">void repeat_timeout(double t, Fl_Timeout_Handler,void* = 0);</A></H4>
990
1024
 
991
 
<P>Inside a timeout callback you can call this to add another timeout.
992
 
Rather than the time being measured from "now", it is measured from
993
 
when the system call elapsed that caused this timeout to be called.  This
994
 
will result in far more accurate spacing of the timeout callbacks, it
995
 
also has slightly less system call overhead.  (It will also use all
996
 
your machine time if your timeout code and FLTK's overhead take more
997
 
than <i>t</i> seconds, as the real timeout will be reduced to zero).
998
 
 
999
 
<p>It is undefined what this does if called from outside a timeout
1000
 
callback.
1001
 
 
1002
 
<P>This code will print &quot;TICK&quot; each second on stdout, with a
1003
 
fair degree of accuracy:
1004
 
 
1005
 
<UL><PRE>
1006
 
void callback(void*) {
1007
 
  printf(&quot;TICK\n&quot;);
1008
 
  Fl::repeat_timeout(1.0,callback);
1009
 
}
1010
 
 
1011
 
main() {
1012
 
  Fl::add_timeout(1.0,callback);
1013
 
  return Fl::run();
1014
 
}
1015
 
</PRE></UL>
 
1025
<P>This method repeats a timeout callback from the expiration of the
 
1026
previous timeout, allowing for more accurate timing. You may only call
 
1027
this method inside a timeout callback.
 
1028
 
 
1029
<p>The following code will print &quot;TICK&quot; each second on
 
1030
<tt>stdout</tt> with a fair degree of accuracy:</p>
 
1031
 
 
1032
<PRE>
 
1033
    void callback(void*) {
 
1034
      puts("TICK");
 
1035
      Fl::repeat_timeout(1.0, callback);
 
1036
    }
 
1037
 
 
1038
    int main() {
 
1039
      Fl::add_timeout(1.0, callback);
 
1040
      return Fl::run();
 
1041
    }
 
1042
</PRE>
1016
1043
 
1017
1044
<H4><A NAME="Fl.run">int run();</A></H4>
1018
1045