comparison man/external-widget.texi @ 750:f929ab5ec903

[xemacs-hg @ 2002-02-13 12:52:03 by stephent] external widget docs <87d6z91r8d.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 13 Feb 2002 12:52:03 +0000
parents f72a191f8ecf
children 41528f633ff7
comparison
equal deleted inserted replaced
749:9cea8fcd2e61 750:f929ab5ec903
17 17
18 @menu 18 @menu
19 * Using an External Client Widget:: 19 * Using an External Client Widget::
20 * External Client Widget Resource Settings:: 20 * External Client Widget Resource Settings::
21 * Motif-Specific Info About the External Client Widget:: 21 * Motif-Specific Info About the External Client Widget::
22 * Example Program Using the External Client Widget::
22 @end menu 23 @end menu
23 24
24 25
25 @node Using an External Client Widget, External Client Widget Resource Settings, Top, Top 26 @node Using an External Client Widget, External Client Widget Resource Settings, Top, Top
26 @chapter Using an External Client Widget 27 @chapter Using an External Client Widget
110 Note that the requests that are made between the client and the shell 111 Note that the requests that are made between the client and the shell
111 are primarily for handling query-geometry and geometry-manager requests 112 are primarily for handling query-geometry and geometry-manager requests
112 made by parent or child widgets. 113 made by parent or child widgets.
113 114
114 115
115 @node Motif-Specific Info About the External Client Widget, , External Client Widget Resource Settings, Top 116 @node Motif-Specific Info About the External Client Widget, Example Program Using the External Client Widget, External Client Widget Resource Settings, Top
116 @chapter Motif-Specific Info About the External Client Widget 117 @chapter Motif-Specific Info About the External Client Widget
117 118
118 By default, the external client widget has navigation type 119 By default, the external client widget has navigation type
119 @samp{XmTAB_GROUP}. 120 @samp{XmTAB_GROUP}.
120 121
124 but functions like a normal @key{TAB} in Emacs. This follows the 125 but functions like a normal @key{TAB} in Emacs. This follows the
125 semantics of the Motif text widget. The traversal keystrokes 126 semantics of the Motif text widget. The traversal keystrokes
126 @kbd{Ctrl-@key{TAB}} and @kbd{Shift-@key{TAB}} are silently filtered by 127 @kbd{Ctrl-@key{TAB}} and @kbd{Shift-@key{TAB}} are silently filtered by
127 the external client widget and are not seen by Emacs. 128 the external client widget and are not seen by Emacs.
128 129
130
131 @node Example Program Using the External Client Widget, , Motif-Specific Info About the External Client Widget, Top
132 @chapter Example Program Using the External Client Widget
133
134 This is a very simple program. It currently doesn't actually work; the
135 client window does not accept keystroke input, although you can edit
136 with the mouse. It also has some issues with exiting. Be careful to
137 destroy the Emacs frame before exiting the client program.
138
139 @example
140 /*
141 Copyright (C) 2002 Free Software Foundation
142
143 This program is part of XEmacs. XEmacs is free software. See the
144 file COPYING that came with XEmacs for conditions on redistribution.
145
146 This is an example of the XEmacs external widget facility.
147
148 It uses libextcli-Xt.a to interface to the X Toolkit Intrinsics.
149
150 Compile with
151
152 gcc -I/path/to/XEmacs/source/src -L/path/to/XEmacs/build/src -static \
153 -lextcli_Xt -lXt -lX11 -lSM -lICE \
154 -o XEmacsInside XEmacsInside.c
155
156 Run it; it pops up a window, and prints a Lisp form on stdout. Eval
157 the form in XEmacs configured --external-widget.
158
159 Written by Stephen J. Turnbull <stephen@@xemacs.org>
160
161 Based on simple_text.c from _The Motif Programming Manual_ by Heller
162 and Ferguson, O'Reilly.
163 */
164
165 #include <stdio.h>
166
167 #include <X11/Intrinsic.h>
168 #include <X11/StringDefs.h>
169 #include <X11/Shell.h>
170
171 #include "ExternalClient.h"
172
173 main (int argc, char *argv[])
174 {
175 Widget toplevel, emacs;
176 XtAppContext app;
177
178 XtSetLanguageProc (NULL, NULL, NULL);
179
180 toplevel = XtVaOpenApplication (&app, "Demo",
181 NULL, 0, &argc, argv,
182 NULL, sessionShellWidgetClass,
183 NULL);
184
185 emacs = XtVaCreateManagedWidget ("externalWidget", externalClientWidgetClass,
186 toplevel,
187 NULL);
188
189 XtRealizeWidget (toplevel);
190
191 printf ("(make-frame '(window-id \"%d\"))\n", XtWindow(emacs));
192
193 XtAppMainLoop (app);
194 }
195
196 /* This function doesn't belong here but somehow it's not getting resolved
197 from the library. */
198 void
199 fatal (char *msg)
200 {
201 fprintf (stderr, "%s", msg);
202 exit (1);
203 }
204 @end example
205
206
129 @summarycontents 207 @summarycontents
130 @contents 208 @contents
131 @bye 209 @bye