1 /*
2 * This file is part of XForms.
3 *
4 * XForms is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1, or
7 * (at your option) any later version.
8 *
9 * XForms is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with XForms; see the file COPYING. If not, write to
16 * the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
17 * MA 02111-1307, USA.
18 */
19
20
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24
25 #include "include/forms.h"
26
27
28 /***************************************
29 ***************************************/
30
31 void
input_cb(FL_OBJECT * ob,long data FL_UNUSED_ARG)32 input_cb( FL_OBJECT * ob,
33 long data FL_UNUSED_ARG )
34 {
35 int x, y;
36
37 fl_get_input_cursorpos( ob, &x , &y );
38 fprintf( stderr," x = %d y = %d\n", x, y );
39 }
40
41
42 /***************************************
43 ***************************************/
44
45 int
main(int argc,char * argv[])46 main( int argc,
47 char * argv[ ] )
48 {
49 FL_FORM *form;
50 FL_OBJECT *but,
51 *obj;
52
53 fl_initialize( &argc, argv, "FormDemo", 0, 0 );
54
55 form = fl_bgn_form( FL_UP_BOX, 400, 450 );
56
57 fl_add_input( FL_MULTILINE_INPUT, 30, 270, 340, 150, "" );
58
59 obj = fl_add_input( FL_MULTILINE_INPUT, 30, 90, 340, 150, "" );
60 fl_set_object_lsize( obj, FL_NORMAL_SIZE );
61 fl_set_object_callback( obj, input_cb, 0 );
62
63 but = fl_add_button( FL_NORMAL_BUTTON, 160, 30, 80, 30, "Exit" );
64
65 fl_end_form( );
66
67 fl_show_form( form, FL_PLACE_CENTERFREE, FL_FULLBORDER, "MultiLineInput" );
68
69 do
70 obj = fl_do_forms( );
71 while ( obj != but );
72
73 fl_finish( );
74
75 return 0;
76 }
77
78
79 /*
80 * Local variables:
81 * tab-width: 4
82 * indent-tabs-mode: nil
83 * End:
84 */
85