How to center the main application window of a MOTIF Widget in the center of the computer screen ? for example a form Widget here.The code is ready and working but the window appears on the left upper side on the screen.IN NORMAL C PROGRAMMING ! Of course no ++This MOTIF Windows is working correct already.The only thing i want to do is to position it in the middle of the computerscreen.It has something to do with the command Xtscreen.The code is attached as file form.cWBRSennenmutIll try to insert code here correct :===========================================
Code:
#include <Xm/Xm.h>
#include <Xm/Form.h>
#include <Xm/Label.h>
#include <Xm/PushB.h>
void main ( int argc, char ** argv )
{
Widget shell, form, label, button;
XtAppContext app;
int i;
shell = XtAppInitialize ( &app, "Formtest", NULL, 0,
&argc, argv, NULL, NULL, 0 );
form = XtCreateManagedWidget ( "form", xmFormWidgetClass,
shell, NULL, 0 );
XtVaSetValues ( form,
XmNwidth, 500,
XmNheight, 300,
NULL );
label = XtVaCreateManagedWidget ( "label", xmLabelWidgetClass,
form, NULL, 0 );
button = XtVaCreateManagedWidget ( "button", xmPushButtonWidgetClass,
form,
XmNbottomAttachment, XmATTACH_FORM,
0 );
XtVaSetValues ( button,
XmNwidth, 100,
XmNheight, 50,
NULL );
XtRealizeWidget ( shell );
XtAppMainLoop ( app );
}