2 * MICO --- a free CORBA implementation
3 * Copyright (C) 1997-98 Kay Roemer & Arno Puder
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * Send comments and/or bug reports to:
20 * mico@informatik.uni-frankfurt.de
23 #include <CORBA-SMALL.h>
24 #ifdef HAVE_ANSI_CPLUSPLUS_HEADERS
32 #include <X11/Intrinsic.h>
33 #include <X11/StringDefs.h>
34 #include <X11/Xaw/Command.h>
35 #include <X11/Xaw/AsciiText.h>
36 #include <X11/Xaw/Form.h>
41 Widget top, form, entry, quit;
43 HelloWorld_var hello_client;
46 return_cb (Widget, XEvent *, String *, Cardinal *)
53 hello_client->hello (arg);
57 quit_cb (Widget, XtPointer, XtPointer)
63 main (int argc, char *argv[])
68 CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "mico-local-orb");
73 static String fallback_res[] = {
79 top = XtAppInitialize (&appctx, "Xhello",
88 orb->dispatcher (new X11Dispatcher (appctx));
95 CORBA::Object_var obj = orb->bind ("IDL:HelloWorld:1.0", argv[1]);
96 if (CORBA::is_nil (obj)) {
97 cout << "cannot bind to " << argv[1] << endl;
100 hello_client = HelloWorld::_narrow (obj);
106 form = XtVaCreateManagedWidget ("form",
112 entry = XtVaCreateManagedWidget ("argument",
113 asciiTextWidgetClass,
116 XtNeditType, XawtextEdit,
118 XtNresize, XawtextResizeWidth,
121 = XtParseTranslationTable ("<Key>Return: ReturnAction()\n");
122 XtOverrideTranslations (entry, trans);
124 static XtActionsRec actions[] = {
125 { "ReturnAction", return_cb }
127 XtAppAddActions (appctx, actions, XtNumber (actions));
130 quit = XtVaCreateManagedWidget ("quit",
135 XtAddCallback (quit, XtNcallback, quit_cb, 0);
138 XtRealizeWidget (top);
139 XtAppMainLoop (appctx);