[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1691.0. "What does XtInitialize really do?" by KOBAL::BARTELL (Keith Bartell) Tue Nov 07 1989 13:51

Can someone tell me exactly what XtInitialize does
(or what I'm doing wrong :-) ?

I'm trying to replace my XtInitialize call with everything that it
would normally do for me, except that I want to use XtOpenDisplay
to open a particular named display.  I thought XtInitialize just did
XtToolkitInitialize, XtCreateApplicationContext, XtDisplayInitialize,
and XtAppCreateShell.  However, my brief program crashes with the
following:

--------------------
X Toolkit Error: Error in XMultiplexInput
%DWT-F-DWTABORT, xtoolkit fatal error
%TRACE-F-TRACEBACK, symbolic stack dump follows
module name     routine name                     line       rel PC    abs PC

                                                           0018CABF  0018CABF
                                                           0018CAF3  0018CAF3
                                                           0018C8D3  0018C8D3
                                                           0018C9C7  0018C9C7
                                                           0018B90D  0018B90D
                                                           0018AF41  0018AF41
                                                           0018AF29  0018AF29
XTINIT          main                             8587      00000085  00000499
--------------------

#include <DwtAppl.h>
#include <stdio.h>

static const char application_name[] = "XtInit Test";
static const char class_name[]       = "TEST";

int main (argc, argv)
    unsigned int argc;
    char **argv;
{
    Widget		toplevel, main_widget;
    XtAppContext	application_context;
    Display		*display;
    XrmOptionDescRec	options;

    XtToolkitInitialize();

    application_context = XtCreateApplicationContext();

    display = XtOpenDisplay( application_context,
			     "KEITHW::0",
			     application_name,
			     class_name,
			     &options,
			     0,
			     &argc,
			     argv );

    toplevel = XtAppCreateShell( application_name,
				 class_name,
				 applicationShellWidgetClass,
				 display,
				 NULL,
				 0 );

    main_widget = DwtMainWindow( toplevel,
				 "main widget",
				 0,
				 0,
				 100,
				 100 );

    XtManageChild(main_widget);
    XtRealizeWidget(toplevel);
    XtMainLoop();

    return (0);
}
T.RTitleUserPersonal
Name
DateLines
1691.1Must use XtApp* routinesLEOVAX::TREGGIARITue Nov 07 1989 15:174
When you create your own application context, then you must use the XtApp*
routines (i.e. XtAppMainLoop instead of XtMainLoop).

Leo