/*
xhello.c -- An XForms Hello World Program
On a "standard" Linux system, this program can be
compiled with the command:
gcc -lX11 -lforms -lm xhello.c -o xhello
To have access to the XForms routines, we need to
include the forms header file
*/
#include <forms.h>
/*
Since XForms applications are just standard C, we
use a normal main() with command line arguments
(if any) stored in argv.
*/
int main(int argc, char *argv[])
{
/*
We need a couple of XForms variables
*/
FL_FORM *hello_window;
FL_OBJECT *hello_button;
/*
The first call is to fl_initialize(), which
sets up XForms and handles relevant command
line options
*/
fl_initialize(&argc, argv,"xldlas", 0, 0);
/*
We create a simple window with a helloworld
button in it
*/
hello_window = fl_bgn_form(FL_UP_BOX, 150, 50);
hello_button = fl_add_button(FL_NORMAL_BUTTON,10,10,130,30,\
"Hello World");
fl_end_form();
/*
Now that we've created our window, we
need to show it.
*/
fl_show_form(hello_window,FL_PLACE_FREE,FL_FULLBORDER,\
"Push the Button");
/*
Wait for the button to be pressed before exiting
*/
fl_do_forms();
return(0);
}
Copyright © 1994 - 2018 Linux Journal. All rights reserved.