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 /*
22  * Test iconification
23  *
24  * T.C. Zhao and M. Overmars
25  */
26 
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30 
31 #include "include/forms.h"
32 #include "crab.xpm"
33 
34 FL_FORM * create_form_form(void);
35 
36 
37 /***************************************
38  ***************************************/
39 
40 int
main(int argc,char * argv[])41 main( int    argc,
42       char * argv[ ] )
43 {
44     FL_FORM *form;
45     Pixmap p,
46            mask;
47     unsigned int w,
48                  h;
49 
50     fl_initialize( &argc, argv, "FormDemo", 0, 0 );
51 
52     form = create_form_form( );
53     p = fl_read_pixmapfile( fl_root, "crab.xpm", &w, &h, &mask, 0, 0, 0 );
54     fl_set_form_icon( form, p, mask );
55 
56     fl_show_form( form, FL_PLACE_CENTER, FL_FULLBORDER, "IconTest" );
57     fl_do_forms( );
58 
59 	fl_finish( );
60     return 0;
61 }
62 
63 
64 /***************************************
65  ***************************************/
66 
67 FL_FORM *
create_form_form(void)68 create_form_form( void )
69 {
70     FL_OBJECT *obj;
71     FL_FORM *form = fl_bgn_form( FL_NO_BOX, 151, 111 );
72 
73     obj = fl_add_pixmapbutton( FL_NORMAL_BUTTON, 0, 0, 151, 111,
74                                "Iconify Me\nvia Window Manager" );
75     fl_set_object_lalign( obj, fl_to_inside_lalign( FL_ALIGN_BOTTOM ) );
76     fl_set_object_lstyle( obj, FL_BOLD_STYLE );
77     fl_set_pixmapbutton_data( obj, crab );
78 
79     fl_end_form( );
80 
81     return form;
82 }
83 
84 
85 /*
86  * Local variables:
87  * tab-width: 4
88  * indent-tabs-mode: nil
89  * End:
90  */
91