1 /* The lwlib interface to Athena widgets.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
4 This file is part of the Lucid Widget Library.
6 The Lucid Widget Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 1, or (at your option)
11 The Lucid Widget Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
28 #include "lwlib-Xaw.h"
30 #include <X11/StringDefs.h>
31 #include <X11/IntrinsicP.h>
32 #include <X11/CoreP.h>
33 #include <X11/Shell.h>
35 #ifdef LWLIB_SCROLLBARS_ATHENA
36 #include ATHENA_Scrollbar_h_
38 #ifdef LWLIB_DIALOGS_ATHENA
39 #include ATHENA_Dialog_h_
40 #include ATHENA_Form_h_
41 #include ATHENA_Command_h_
42 #include ATHENA_Label_h_
44 #ifdef LWLIB_WIDGETS_ATHENA
45 #include ATHENA_Toggle_h_
47 #include "xlwcheckbox.h"
50 #include ATHENA_AsciiText_h_
53 #include <X11/Xatom.h>
55 static void xaw_generic_callback (Widget, XtPointer, XtPointer);
59 lw_xaw_widget_p (Widget widget)
62 #ifdef LWLIB_SCROLLBARS_ATHENA
63 || XtIsSubclass (widget, scrollbarWidgetClass)
65 #ifdef LWLIB_DIALOGS_ATHENA
66 || XtIsSubclass (widget, dialogWidgetClass)
68 #ifdef LWLIB_WIDGETS_ATHENA
69 || XtIsSubclass (widget, labelWidgetClass)
70 || XtIsSubclass (widget, toggleWidgetClass)
71 || XtIsSubclass (widget, gaugeWidgetClass)
73 || XtIsSubclass (widget, asciiTextWidgetClass)
79 #ifdef LWLIB_SCROLLBARS_ATHENA
81 xaw_update_scrollbar (widget_instance *instance, Widget widget,
84 if (val->scrollbar_data)
86 scrollbar_values *data = val->scrollbar_data;
87 float widget_shown, widget_topOfThumb;
88 float new_shown, new_topOfThumb;
91 /* First size and position the scrollbar widget. */
92 XtSetArg (al [0], XtNx, data->scrollbar_x);
93 XtSetArg (al [1], XtNy, data->scrollbar_y);
94 XtSetArg (al [2], XtNwidth, data->scrollbar_width);
95 XtSetArg (al [3], XtNheight, data->scrollbar_height);
96 XtSetValues (widget, al, 4);
98 /* Now size the scrollbar's slider. */
99 XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb);
100 XtSetArg (al [1], XtNshown, &widget_shown);
101 XtGetValues (widget, al, 2);
103 new_shown = (double) data->slider_size /
104 (double) (data->maximum - data->minimum);
106 new_topOfThumb = (double) (data->slider_position - data->minimum) /
107 (double) (data->maximum - data->minimum);
111 else if (new_shown < 0)
114 if (new_topOfThumb > 1.0)
115 new_topOfThumb = 1.0;
116 else if (new_topOfThumb < 0)
119 if (new_shown != widget_shown || new_topOfThumb != widget_topOfThumb)
120 XawScrollbarSetThumb (widget, new_topOfThumb, new_shown);
123 #endif /* LWLIB_SCROLLBARS_ATHENA */
126 xaw_update_one_widget (widget_instance *instance, Widget widget,
127 widget_value *val, Boolean deep_p)
131 #ifdef LWLIB_SCROLLBARS_ATHENA
132 else if (XtIsSubclass (widget, scrollbarWidgetClass))
134 xaw_update_scrollbar (instance, widget, val);
137 #ifdef LWLIB_WIDGETS_ATHENA
139 else if (XtIsSubclass (widget, asciiTextWidgetClass))
144 #ifdef LWLIB_DIALOGS_ATHENA
145 else if (XtIsSubclass (widget, dialogWidgetClass))
148 XtSetArg (al [0], XtNlabel, val->contents->value);
149 XtSetValues (widget, al, 1);
151 #endif /* LWLIB_DIALOGS_ATHENA */
152 #ifdef LWLIB_WIDGETS_ATHENA
153 else if (XtClass (widget) == labelWidgetClass)
156 XtSetArg (al [0], XtNlabel, val->value);
157 XtSetValues (widget, al, 1);
159 #endif /* LWLIB_WIDGETS_ATHENA */
160 #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA)
161 else if (XtIsSubclass (widget, commandWidgetClass))
165 XtSetArg (al [0], XtNborderWidth, &bw);
166 XtGetValues (widget, al, 1);
168 #ifndef LWLIB_DIALOGS_ATHENA3D
170 /* Don't let buttons end up with 0 borderwidth, that's ugly...
171 Yeah, all this should really be done through app-defaults files
172 or fallback resources, but that's a whole different can of worms
173 that I don't feel like opening right now. Making Athena widgets
174 not look like shit is just entirely too much work.
177 XtSetArg (al [0], XtNborderWidth, 1);
178 XtSetValues (widget, al, 1);
180 #endif /* ! LWLIB_DIALOGS_ATHENA3D */
182 lw_remove_accelerator_spec (val->value);
183 XtSetArg (al [0], XtNlabel, val->value);
184 XtSetArg (al [1], XtNsensitive, val->enabled);
185 /* Force centered button text. See above. */
186 XtSetArg (al [2], XtNjustify, XtJustifyCenter);
187 XtSetValues (widget, al, 3);
189 XtRemoveAllCallbacks (widget, XtNcallback);
190 XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance);
191 #ifdef LWLIB_WIDGETS_ATHENA
192 /* set the selected state */
193 if (XtIsSubclass (widget, toggleWidgetClass))
195 XtSetArg (al [0], XtNstate, val->selected);
196 XtSetValues (widget, al, 1);
198 #endif /* LWLIB_WIDGETS_ATHENA */
200 #endif /* LWLIB_DIALOGS_ATHENA */
201 /* Lastly update our global arg values. */
202 if (val->args && val->args->nargs)
203 XtSetValues (widget, val->args->args, val->args->nargs);
207 xaw_update_one_value (widget_instance *instance, Widget widget,
210 #ifdef LWLIB_WIDGETS_ATHENA
211 widget_value *old_wv;
213 /* copy the call_data slot into the "return" widget_value */
214 for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next)
215 if (!strcmp (val->name, old_wv->name))
217 val->call_data = old_wv->call_data;
221 if (XtIsSubclass (widget, toggleWidgetClass))
224 XtSetArg (al [0], XtNstate, &val->selected);
225 XtGetValues (widget, al, 1);
229 else if (XtIsSubclass (widget, asciiTextWidgetClass))
233 XtSetArg (al [0], XtNstring, &buf);
234 XtGetValues (widget, al, 1);
241 /* I don't think this causes a leak. */
243 val->value = strdup (buf);
247 #endif /* LWLIB_WIDGETS_ATHENA */
251 xaw_destroy_instance (widget_instance *instance)
253 #ifdef LWLIB_DIALOGS_ATHENA
254 if (XtIsSubclass (instance->widget, dialogWidgetClass))
255 /* Need to destroy the Shell too. */
256 XtDestroyWidget (XtParent (instance->widget));
259 XtDestroyWidget (instance->widget);
263 xaw_popup_menu (Widget widget, XEvent *event)
265 /* An Athena menubar has not been implemented. */
270 xaw_pop_instance (widget_instance *instance, Boolean up)
272 Widget widget = instance->widget;
276 #ifdef LWLIB_DIALOGS_ATHENA
277 if (XtIsSubclass (widget, dialogWidgetClass))
279 /* For dialogs, we need to call XtPopup on the parent instead
280 of calling XtManageChild on the widget.
281 Also we need to hack the shell's WM_PROTOCOLS to get it to
282 understand what the close box is supposed to do!!
284 Display *dpy = XtDisplay (widget);
285 Widget shell = XtParent (widget);
288 props [i++] = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
289 XChangeProperty (dpy, XtWindow (shell),
290 XInternAtom (dpy, "WM_PROTOCOLS", False),
291 XA_ATOM, 32, PropModeAppend,
292 (unsigned char *) props, i);
294 /* Center the widget in its parent. Why isn't this kind of crap
295 done automatically? I thought toolkits were supposed to make
299 unsigned int x, y, w, h;
300 Widget topmost = instance->parent;
301 w = shell->core.width;
302 h = shell->core.height;
303 while (topmost->core.parent &&
304 XtIsRealized (topmost->core.parent) &&
305 /* HAVE_SESSION adds an unmapped parent widget that
306 we should ignore here. */
307 topmost->core.parent->core.mapped_when_managed)
308 topmost = topmost->core.parent;
309 if (topmost->core.width < w) x = topmost->core.x;
310 else x = topmost->core.x + ((topmost->core.width - w) / 2);
311 if (topmost->core.height < h) y = topmost->core.y;
312 else y = topmost->core.y + ((topmost->core.height - h) / 2);
313 XtMoveWidget (shell, x, y);
316 /* Finally, pop it up. */
317 XtPopup (shell, XtGrabNonexclusive);
320 #endif /* LWLIB_DIALOGS_ATHENA */
321 XtManageChild (widget);
325 #ifdef LWLIB_DIALOGS_ATHENA
326 if (XtIsSubclass (widget, dialogWidgetClass))
327 XtUnmanageChild (XtParent (widget));
330 XtUnmanageChild (widget);
335 #ifdef LWLIB_DIALOGS_ATHENA
338 static char overrideTrans[] =
339 "<Message>WM_PROTOCOLS: lwlib_delete_dialog()";
340 static XtActionProc wm_delete_window (Widget shell, XtPointer closure,
341 XtPointer call_data);
342 static XtActionsRec xaw_actions [] = {
343 {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
345 static Boolean actions_initted = False;
348 make_dialog (const char* name, Widget parent, Boolean pop_up_p,
349 const char* shell_title, const char* icon_name,
350 Boolean text_input_slot,
351 Boolean radio_box, Boolean list,
352 int left_buttons, int right_buttons)
357 char button_name [255];
361 XtTranslations override;
363 if (! pop_up_p) abort (); /* not implemented */
364 if (text_input_slot) abort (); /* not implemented */
365 if (radio_box) abort (); /* not implemented */
366 if (list) abort (); /* not implemented */
368 if (! actions_initted)
370 XtAppContext app = XtWidgetToApplicationContext (parent);
371 XtAppAddActions (app, xaw_actions,
372 sizeof (xaw_actions) / sizeof (xaw_actions[0]));
373 actions_initted = True;
376 override = XtParseTranslationTable (overrideTrans);
379 XtSetArg (av[ac], XtNtitle, shell_title); ac++;
380 XtSetArg (av[ac], XtNallowShellResize, True); ac++;
381 XtSetArg (av[ac], XtNtransientFor, parent); ac++;
382 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
384 XtOverrideTranslations (shell, override);
387 dialog = XtCreateManagedWidget (name, dialogWidgetClass, shell, av, ac);
391 for (i = 0; i < left_buttons; i++)
394 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
395 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
396 XtSetArg (av [ac], XtNright, XtChainLeft); ac++;
397 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
398 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
399 XtSetArg (av [ac], XtNresizable, True); ac++;
400 sprintf (button_name, "button%d", ++bc);
401 button = XtCreateManagedWidget (button_name, commandWidgetClass,
406 /* Create a separator
408 I want the separator to take up the slack between the buttons on
409 the right and the buttons on the left (that is I want the buttons
410 after the separator to be packed against the right edge of the
411 window) but I can't seem to make it do it.
414 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
415 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
416 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
417 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
418 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
419 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
420 XtSetArg (av [ac], XtNlabel, ""); ac++;
421 XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */
422 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
423 XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
424 XtSetArg (av [ac], XtNresizable, False); ac++;
425 XtSetArg (av [ac], XtNsensitive, False); ac++;
426 button = XtCreateManagedWidget ("separator",
427 /* labelWidgetClass, */
428 /* This has to be Command to fake out
429 the Dialog widget... */
433 for (i = 0; i < right_buttons; i++)
436 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
437 XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
438 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
439 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
440 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
441 XtSetArg (av [ac], XtNresizable, True); ac++;
442 sprintf (button_name, "button%d", ++bc);
443 button = XtCreateManagedWidget (button_name, commandWidgetClass,
451 xaw_create_dialog (widget_instance* instance)
453 char *name = instance->info->type;
454 Widget parent = instance->parent;
456 Boolean pop_up_p = instance->pop_up_p;
457 const char *shell_name = 0;
458 const char *icon_name = 0;
459 Boolean text_input_slot = False;
460 Boolean radio_box = False;
461 Boolean list = False;
463 int left_buttons = 0;
464 int right_buttons = 1;
468 icon_name = "dbox-error";
469 shell_name = "Error";
473 icon_name = "dbox-info";
474 shell_name = "Information";
479 icon_name = "dbox-question";
480 shell_name = "Prompt";
484 text_input_slot = True;
485 icon_name = "dbox-question";
486 shell_name = "Prompt";
490 icon_name = "dbox-question";
491 shell_name = "Question";
495 total_buttons = name [1] - '0';
497 if (name [3] == 'T' || name [3] == 't')
499 text_input_slot = False;
503 right_buttons = name [4] - '0';
505 left_buttons = total_buttons - right_buttons;
507 widget = make_dialog (name, parent, pop_up_p,
508 shell_name, icon_name, text_input_slot, radio_box,
509 list, left_buttons, right_buttons);
513 #endif /* LWLIB_DIALOGS_ATHENA */
517 xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
519 widget_instance *instance = (widget_instance *) closure;
520 Widget instance_widget;
523 #ifdef LWLIB_WIDGETS_ATHENA
524 /* We want the selected status to change only when we decide it
525 should change. Yuck but correct. */
526 if (XtIsSubclass (widget, toggleWidgetClass))
531 XtSetArg (al [0], XtNstate, &check);
532 XtGetValues (widget, al, 1);
534 XtSetArg (al [0], XtNstate, !check);
535 XtSetValues (widget, al, 1);
537 #endif /* LWLIB_WIDGETS_ATHENA */
538 lw_internal_update_other_instances (widget, closure, call_data);
542 if (widget->core.being_destroyed)
545 instance_widget = instance->widget;
546 if (!instance_widget)
549 id = instance->info->id;
555 XtSetArg (al [0], XtNuserData, &user_data);
556 XtGetValues (widget, al, 1);
559 /* Damn! Athena doesn't give us a way to hang our own data on the
560 buttons, so we have to go find it... I guess this assumes that
561 all instances of a button have the same call data.
563 ... Which is a totally bogus assumption --andyp */
565 widget_value *val = instance->info->val;
566 /* If the widget is a buffer/gutter widget then we already have
567 the one we are looking for, so don't try and descend the widget
571 char *name = XtName (widget);
575 if (val->name && !strcmp (val->name, name))
581 user_data = val->call_data;
585 if (instance->info->selection_cb)
586 instance->info->selection_cb (widget, id, user_data);
589 #ifdef LWLIB_DIALOGS_ATHENA
592 wm_delete_window (Widget shell, XtPointer closure, XtPointer call_data)
598 if (! XtIsSubclass (shell, shellWidgetClass))
600 XtSetArg (al [0], XtNchildren, &kids);
601 XtGetValues (shell, al, 1);
605 if (! XtIsSubclass (widget, dialogWidgetClass))
607 id = lw_get_widget_id (widget);
611 widget_info *info = lw_get_widget_info (id);
612 if (! info) abort ();
613 if (info->selection_cb)
614 info->selection_cb (widget, id, (XtPointer) -1);
617 lw_destroy_all_widgets (id);
621 #endif /* LWLIB_DIALOGS_ATHENA */
626 #ifdef LWLIB_SCROLLBARS_ATHENA
628 xaw_scrollbar_scroll (Widget widget, XtPointer closure, XtPointer call_data)
630 widget_instance *instance = (widget_instance *) closure;
632 scroll_event event_data;
634 if (!instance || widget->core.being_destroyed)
637 id = instance->info->id;
638 event_data.slider_value = (int) call_data;
641 if ((int) call_data > 0)
642 /* event_data.action = SCROLLBAR_PAGE_DOWN;*/
643 event_data.action = SCROLLBAR_LINE_DOWN;
645 /* event_data.action = SCROLLBAR_PAGE_UP;*/
646 event_data.action = SCROLLBAR_LINE_UP;
648 if (instance->info->pre_activate_cb)
649 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
653 xaw_scrollbar_jump (Widget widget, XtPointer closure, XtPointer call_data)
655 widget_instance *instance = (widget_instance *) closure;
657 scroll_event event_data;
658 scrollbar_values *val =
659 (scrollbar_values *) instance->info->val->scrollbar_data;
662 if (!instance || widget->core.being_destroyed)
665 id = instance->info->id;
667 percent = * (float *) call_data;
668 event_data.slider_value =
669 (int) (percent * (float) (val->maximum - val->minimum)) + val->minimum;
672 event_data.action = SCROLLBAR_DRAG;
674 if (instance->info->pre_activate_cb)
675 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
679 xaw_create_scrollbar (widget_instance *instance, int vertical)
684 static XtCallbackRec jumpCallbacks[2] =
685 { {xaw_scrollbar_jump, NULL}, {NULL, NULL} };
687 static XtCallbackRec scrollCallbacks[2] =
688 { {xaw_scrollbar_scroll, NULL}, {NULL, NULL} };
690 jumpCallbacks[0].closure = scrollCallbacks[0].closure = (XtPointer) instance;
692 /* #### This is tacked onto the with and height and completely
693 screws our geometry management. We should probably make the
694 top-level aware of this so that people could have a border but so
695 few people use the Athena scrollbar now that it really isn't
696 worth the effort, at least not at the moment. */
697 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
698 XtSetArg (av [ac], XtNorientation,
699 vertical ? XtorientVertical : XtorientHorizontal); ac++;
700 XtSetArg (av [ac], "jumpProc", jumpCallbacks); ac++;
701 XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++;
703 return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
704 instance->parent, av, ac);
708 xaw_create_vertical_scrollbar (widget_instance *instance)
710 return xaw_create_scrollbar (instance, 1);
714 xaw_create_horizontal_scrollbar (widget_instance *instance)
716 return xaw_create_scrollbar (instance, 0);
718 #endif /* LWLIB_SCROLLBARS_ATHENA */
720 #ifdef LWLIB_WIDGETS_ATHENA
723 xaw_create_button (widget_instance *instance)
728 widget_value* val = instance->info->val;
730 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
731 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
732 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
733 /* The highlight doesn't appear to be dynamically set which makes it
734 look ugly. I think this may be a LessTif bug but for now we just
736 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
738 /* add any args the user supplied for creation time */
739 lw_add_value_args_to_args (val, al, &ac);
742 button = XtCreateManagedWidget (val->name, labelWidgetClass,
743 instance->parent, al, ac);
747 if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
749 XtSetArg (al [ac], XtNstate, val->selected); ac++;
750 button = XtCreateManagedWidget
752 val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
753 instance->parent, al, ac);
757 button = XtCreateManagedWidget (val->name, commandWidgetClass,
758 instance->parent, al, ac);
760 XtRemoveAllCallbacks (button, XtNcallback);
761 XtAddCallback (button, XtNcallback, xaw_generic_callback, (XtPointer)instance);
764 XtManageChild (button);
770 xaw_create_label_field (widget_instance *instance)
772 return xaw_create_label (instance->parent, instance->info->val);
776 xaw_create_label (Widget parent, widget_value* val)
782 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
783 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
784 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
786 /* add any args the user supplied for creation time */
787 lw_add_value_args_to_args (val, al, &ac);
789 label = XtCreateManagedWidget (val->name, labelWidgetClass,
792 /* Do it again for arguments that have no effect until the widget is realized. */
794 lw_add_value_args_to_args (val, al, &ac);
796 abort (); /* #### need assert macro in lwlib */
797 XtSetValues (label, al, ac);
803 xaw_create_progress (widget_instance *instance)
808 widget_value* val = instance->info->val;
809 #if 0 /* This looks too awful, although more correct. */
812 XtSetArg (al [ac], XtNsensitive, False); ac++;
816 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
819 XtSetArg (al [ac], XtNsensitive, True); ac++;
822 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
823 XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
824 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
825 XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++;
827 /* add any args the user supplied for creation time */
828 lw_add_value_args_to_args (val, al, &ac);
830 scale = XtCreateManagedWidget (val->name, gaugeWidgetClass,
831 instance->parent, al, ac);
832 /* add the callback */
834 XtAddCallback (scale, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
836 XtManageChild (scale);
842 #define TEXT_BUFFER_SIZE 128
844 xaw_create_text_field (widget_instance *instance)
849 widget_value* val = instance->info->val;
851 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
852 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
853 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
854 XtSetArg (al [ac], XtNtype, XawAsciiString); ac++;
855 XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++;
856 XtSetArg (al [ac], XtNuseStringInPlace, False); ac++;
858 XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
862 XtSetArg (al [ac], XtNstring, val->value); ac++;
865 /* add any args the user supplied for creation time */
866 lw_add_value_args_to_args (val, al, &ac);
868 text = XtCreateManagedWidget (val->name, asciiTextWidgetClass,
869 instance->parent, al, ac);
871 /* add the callback */
873 XtAddCallback (text, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
875 XtManageChild (text);
881 #endif /* LWLIB_WIDGETS_ATHENA */
883 const widget_creation_entry
884 xaw_creation_table [] =
886 #ifdef LWLIB_SCROLLBARS_ATHENA
887 {"vertical-scrollbar", xaw_create_vertical_scrollbar },
888 {"horizontal-scrollbar", xaw_create_horizontal_scrollbar },
890 #ifdef LWLIB_WIDGETS_ATHENA
891 {"button", xaw_create_button },
892 { "label", xaw_create_label_field },
894 {"text-field", xaw_create_text_field },
896 {"progress", xaw_create_progress },