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
7 and/or modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version.
11 The Lucid Widget Library is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #include "lwlib-Xaw.h"
28 #include <X11/StringDefs.h>
29 #include <X11/IntrinsicP.h>
30 #include <X11/CoreP.h>
31 #include <X11/Shell.h>
33 #ifdef LWLIB_SCROLLBARS_ATHENA
34 #include ATHENA_Scrollbar_h_
36 #ifdef LWLIB_DIALOGS_ATHENA
37 #include ATHENA_Dialog_h_
38 #include ATHENA_Form_h_
39 #include ATHENA_Command_h_
40 #include ATHENA_Label_h_
42 #ifdef LWLIB_WIDGETS_ATHENA
43 #include ATHENA_Toggle_h_
45 #include "xlwcheckbox.h"
47 #include ATHENA_AsciiText_h_
49 #include <X11/Xatom.h>
51 static void xaw_generic_callback(Widget, XtPointer, XtPointer);
53 Boolean lw_xaw_widget_p(Widget widget)
56 #ifdef LWLIB_SCROLLBARS_ATHENA
57 || XtIsSubclass(widget, scrollbarWidgetClass)
59 #ifdef LWLIB_DIALOGS_ATHENA
60 || XtIsSubclass(widget, dialogWidgetClass)
62 #ifdef LWLIB_WIDGETS_ATHENA
63 || XtIsSubclass(widget, labelWidgetClass)
64 || XtIsSubclass(widget, toggleWidgetClass)
65 || XtIsSubclass(widget, gaugeWidgetClass)
67 || XtIsSubclass(widget, asciiTextWidgetClass)
73 #ifdef LWLIB_SCROLLBARS_ATHENA
75 xaw_update_scrollbar(widget_instance * instance, Widget widget,
78 if (val->scrollbar_data) {
79 scrollbar_values *data = val->scrollbar_data;
80 float widget_shown, widget_topOfThumb;
81 float new_shown, new_topOfThumb;
84 /* First size and position the scrollbar widget. */
85 XtSetArg(al[0], XtNx, data->scrollbar_x);
86 XtSetArg(al[1], XtNy, data->scrollbar_y);
87 XtSetArg(al[2], XtNwidth, data->scrollbar_width);
88 XtSetArg(al[3], XtNheight, data->scrollbar_height);
89 XtSetValues(widget, al, 4);
91 /* Now size the scrollbar's slider. */
92 XtSetArg(al[0], XtNtopOfThumb, &widget_topOfThumb);
93 XtSetArg(al[1], XtNshown, &widget_shown);
94 XtGetValues(widget, al, 2);
96 new_shown = (double)data->slider_size /
97 (double)(data->maximum - data->minimum);
100 (double)(data->slider_position -
101 data->minimum) / (double)(data->maximum -
106 else if (new_shown < 0)
109 if (new_topOfThumb > 1.0)
110 new_topOfThumb = 1.0;
111 else if (new_topOfThumb < 0)
114 if (new_shown != widget_shown
115 || new_topOfThumb != widget_topOfThumb)
116 XawScrollbarSetThumb(widget, new_topOfThumb, new_shown);
119 #endif /* LWLIB_SCROLLBARS_ATHENA */
122 xaw_update_one_widget(widget_instance * instance, Widget widget,
123 widget_value * val, Boolean deep_p)
126 #ifdef LWLIB_SCROLLBARS_ATHENA
127 else if (XtIsSubclass(widget, scrollbarWidgetClass)) {
128 xaw_update_scrollbar(instance, widget, val);
131 #ifdef LWLIB_WIDGETS_ATHENA
133 else if (XtIsSubclass(widget, asciiTextWidgetClass)) {
137 #ifdef LWLIB_DIALOGS_ATHENA
138 else if (XtIsSubclass(widget, dialogWidgetClass)) {
140 XtSetArg(al[0], XtNlabel, val->contents->value);
141 XtSetValues(widget, al, 1);
143 #endif /* LWLIB_DIALOGS_ATHENA */
144 #ifdef LWLIB_WIDGETS_ATHENA
145 else if (XtClass(widget) == labelWidgetClass) {
147 XtSetArg(al[0], XtNlabel, val->value);
148 XtSetValues(widget, al, 1);
150 #endif /* LWLIB_WIDGETS_ATHENA */
151 #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA)
152 else if (XtIsSubclass(widget, commandWidgetClass)) {
155 XtSetArg(al[0], XtNborderWidth, &bw);
156 XtGetValues(widget, al, 1);
158 #ifndef LWLIB_DIALOGS_ATHENA3D
160 /* Don't let buttons end up with 0 borderwidth, that's ugly...
161 Yeah, all this should really be done through app-defaults files
162 or fallback resources, but that's a whole different can of worms
163 that I don't feel like opening right now. Making Athena widgets
164 not look like shit is just entirely too much work.
167 XtSetArg(al[0], XtNborderWidth, 1);
168 XtSetValues(widget, al, 1);
170 #endif /* ! LWLIB_DIALOGS_ATHENA3D */
172 lw_remove_accelerator_spec(val->value);
173 XtSetArg(al[0], XtNlabel, val->value);
174 XtSetArg(al[1], XtNsensitive, val->enabled);
175 /* Force centered button text. See above. */
176 XtSetArg(al[2], XtNjustify, XtJustifyCenter);
177 XtSetValues(widget, al, 3);
179 XtRemoveAllCallbacks(widget, XtNcallback);
180 XtAddCallback(widget, XtNcallback, xaw_generic_callback,
182 #ifdef LWLIB_WIDGETS_ATHENA
183 /* set the selected state */
184 if (XtIsSubclass(widget, toggleWidgetClass)) {
185 XtSetArg(al[0], XtNstate, val->selected);
186 XtSetValues(widget, al, 1);
188 #endif /* LWLIB_WIDGETS_ATHENA */
190 #endif /* LWLIB_DIALOGS_ATHENA */
191 /* Lastly update our global arg values. */
192 if (val->args && val->args->nargs)
193 XtSetValues(widget, val->args->args, val->args->nargs);
197 xaw_update_one_value(widget_instance * instance, Widget widget,
200 #ifdef LWLIB_WIDGETS_ATHENA
201 widget_value *old_wv;
203 /* copy the call_data slot into the "return" widget_value */
204 for (old_wv = instance->info->val->contents; old_wv;
205 old_wv = old_wv->next)
206 if (!strcmp(val->name, old_wv->name)) {
207 val->call_data = old_wv->call_data;
211 if (XtIsSubclass(widget, toggleWidgetClass)) {
213 XtSetArg(al[0], XtNstate, &val->selected);
214 XtGetValues(widget, al, 1);
218 else if (XtIsSubclass(widget, asciiTextWidgetClass)) {
221 XtSetArg(al[0], XtNstring, &buf);
222 XtGetValues(widget, al, 1);
228 /* I don't think this causes a leak. */
230 val->value = strdup(buf);
234 #endif /* LWLIB_WIDGETS_ATHENA */
237 void xaw_destroy_instance(widget_instance * instance)
239 #ifdef LWLIB_DIALOGS_ATHENA
240 if (XtIsSubclass(instance->widget, dialogWidgetClass))
241 /* Need to destroy the Shell too. */
242 XtDestroyWidget(XtParent(instance->widget));
245 XtDestroyWidget(instance->widget);
248 void xaw_popup_menu(Widget widget, XEvent * event)
250 /* An Athena menubar has not been implemented. */
254 void xaw_pop_instance(widget_instance * instance, Boolean up)
256 Widget widget = instance->widget;
259 #ifdef LWLIB_DIALOGS_ATHENA
260 if (XtIsSubclass(widget, dialogWidgetClass)) {
261 /* For dialogs, we need to call XtPopup on the parent instead
262 of calling XtManageChild on the widget.
263 Also we need to hack the shell's WM_PROTOCOLS to get it to
264 understand what the close box is supposed to do!!
266 Display *dpy = XtDisplay(widget);
267 Widget shell = XtParent(widget);
271 XInternAtom(dpy, "WM_DELETE_WINDOW", False);
272 XChangeProperty(dpy, XtWindow(shell),
273 XInternAtom(dpy, "WM_PROTOCOLS", False),
274 XA_ATOM, 32, PropModeAppend,
275 (unsigned char *)props, i);
277 /* Center the widget in its parent. Why isn't this kind of crap
278 done automatically? I thought toolkits were supposed to make
282 unsigned int x, y, w, h;
283 Widget topmost = instance->parent;
284 w = shell->core.width;
285 h = shell->core.height;
286 while (topmost->core.parent &&
287 XtIsRealized(topmost->core.parent) &&
288 /* HAVE_SESSION adds an unmapped parent widget that
289 we should ignore here. */
290 topmost->core.parent->core.
292 topmost = topmost->core.parent;
293 if (topmost->core.width < w)
296 x = topmost->core.x +
297 ((topmost->core.width - w) / 2);
298 if (topmost->core.height < h)
301 y = topmost->core.y +
302 ((topmost->core.height - h) / 2);
303 XtMoveWidget(shell, x, y);
306 /* Finally, pop it up. */
307 XtPopup(shell, XtGrabNonexclusive);
309 #endif /* LWLIB_DIALOGS_ATHENA */
310 XtManageChild(widget);
312 #ifdef LWLIB_DIALOGS_ATHENA
313 if (XtIsSubclass(widget, dialogWidgetClass))
314 XtUnmanageChild(XtParent(widget));
317 XtUnmanageChild(widget);
321 #ifdef LWLIB_DIALOGS_ATHENA
324 static char overrideTrans[] = "<Message>WM_PROTOCOLS: lwlib_delete_dialog()";
325 static XtActionProc wm_delete_window(Widget shell, XtPointer closure,
326 XtPointer call_data);
327 static XtActionsRec xaw_actions[] = {
328 {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
330 static Boolean actions_initted = False;
333 make_dialog(const char *name, Widget parent, Boolean pop_up_p,
334 const char *shell_title, const char *icon_name,
335 Boolean text_input_slot,
336 Boolean radio_box, Boolean list,
337 int left_buttons, int right_buttons)
342 char button_name[255];
346 XtTranslations override;
349 abort(); /* not implemented */
351 abort(); /* not implemented */
353 abort(); /* not implemented */
355 abort(); /* not implemented */
357 if (!actions_initted) {
358 XtAppContext app = XtWidgetToApplicationContext(parent);
359 XtAppAddActions(app, xaw_actions,
360 sizeof(xaw_actions) / sizeof(xaw_actions[0]));
361 actions_initted = True;
364 override = XtParseTranslationTable(overrideTrans);
367 XtSetArg(av[ac], XtNtitle, shell_title);
369 XtSetArg(av[ac], XtNallowShellResize, True);
371 XtSetArg(av[ac], XtNtransientFor, parent);
373 shell = XtCreatePopupShell("dialog", transientShellWidgetClass,
375 XtOverrideTranslations(shell, override);
378 dialog = XtCreateManagedWidget(name, dialogWidgetClass, shell, av, ac);
382 for (i = 0; i < left_buttons; i++) {
385 XtSetArg(av[ac], XtNfromHoriz, button);
387 XtSetArg(av[ac], XtNleft, XtChainLeft);
389 XtSetArg(av[ac], XtNright, XtChainLeft);
391 XtSetArg(av[ac], XtNtop, XtChainBottom);
393 XtSetArg(av[ac], XtNbottom, XtChainBottom);
395 XtSetArg(av[ac], XtNresizable, True);
397 sz = snprintf(button_name, sizeof(button_name), "button%d", ++bc);
398 assert(sz >= 0 && (size_t)sz < sizeof(button_name));
399 button = XtCreateManagedWidget(button_name, commandWidgetClass,
403 /* Create a separator
405 I want the separator to take up the slack between the buttons on
406 the right and the buttons on the left (that is I want the buttons
407 after the separator to be packed against the right edge of the
408 window) but I can't seem to make it do it.
411 XtSetArg(av[ac], XtNfromHoriz, button);
413 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
414 XtSetArg(av[ac], XtNleft, XtChainLeft);
416 XtSetArg(av[ac], XtNright, XtChainRight);
418 XtSetArg(av[ac], XtNtop, XtChainBottom);
420 XtSetArg(av[ac], XtNbottom, XtChainBottom);
422 XtSetArg(av[ac], XtNlabel, "");
424 XtSetArg(av[ac], XtNwidth, 30);
425 ac++; /* #### aaack!! */
426 XtSetArg(av[ac], XtNborderWidth, 0);
428 XtSetArg(av[ac], XtNshapeStyle, XmuShapeRectangle);
430 XtSetArg(av[ac], XtNresizable, False);
432 XtSetArg(av[ac], XtNsensitive, False);
434 button = XtCreateManagedWidget("separator",
435 /* labelWidgetClass, */
436 /* This has to be Command to fake out
437 the Dialog widget... */
441 for (i = 0; i < right_buttons; i++) {
444 XtSetArg(av[ac], XtNfromHoriz, button);
446 XtSetArg(av[ac], XtNleft, XtChainRight);
448 XtSetArg(av[ac], XtNright, XtChainRight);
450 XtSetArg(av[ac], XtNtop, XtChainBottom);
452 XtSetArg(av[ac], XtNbottom, XtChainBottom);
454 XtSetArg(av[ac], XtNresizable, True);
456 sz = snprintf(button_name, sizeof(button_name), "button%d", ++bc);
457 assert(sz >= 0 && (size_t)sz < sizeof(button_name));
458 button = XtCreateManagedWidget(button_name, commandWidgetClass,
465 Widget xaw_create_dialog(widget_instance * instance)
467 char *name = instance->info->type;
468 Widget parent = instance->parent;
470 Boolean pop_up_p = instance->pop_up_p;
471 const char *shell_name = 0;
472 const char *icon_name = 0;
473 Boolean text_input_slot = False;
474 Boolean radio_box = False;
475 Boolean list = False;
477 int left_buttons = 0;
478 int right_buttons = 1;
483 icon_name = "dbox-error";
484 shell_name = "Error";
489 icon_name = "dbox-info";
490 shell_name = "Information";
496 icon_name = "dbox-question";
497 shell_name = "Prompt";
502 text_input_slot = True;
503 icon_name = "dbox-question";
504 shell_name = "Prompt";
509 icon_name = "dbox-question";
510 shell_name = "Question";
516 total_buttons = name[1] - '0';
518 if (name[3] == 'T' || name[3] == 't') {
519 text_input_slot = False;
522 right_buttons = name[4] - '0';
524 left_buttons = total_buttons - right_buttons;
526 widget = make_dialog(name, parent, pop_up_p,
527 shell_name, icon_name, text_input_slot, radio_box,
528 list, left_buttons, right_buttons);
532 #endif /* LWLIB_DIALOGS_ATHENA */
535 xaw_generic_callback(Widget widget, XtPointer closure, XtPointer call_data)
537 widget_instance *instance = (widget_instance *) closure;
538 Widget instance_widget;
540 XtPointer user_data = NULL;
541 #ifdef LWLIB_WIDGETS_ATHENA
542 /* We want the selected status to change only when we decide it
543 should change. Yuck but correct. */
544 if (XtIsSubclass(widget, toggleWidgetClass)) {
548 XtSetArg(al[0], XtNstate, &check);
549 XtGetValues(widget, al, 1);
551 XtSetArg(al[0], XtNstate, !check);
552 XtSetValues(widget, al, 1);
554 #endif /* LWLIB_WIDGETS_ATHENA */
555 lw_internal_update_other_instances(widget, closure, call_data);
559 if (widget->core.being_destroyed)
562 instance_widget = instance->widget;
563 if (!instance_widget)
566 id = instance->info->id;
572 XtSetArg(al[0], XtNuserData, &user_data);
573 XtGetValues(widget, al, 1);
576 /* Damn! Athena doesn't give us a way to hang our own data on the
577 buttons, so we have to go find it... I guess this assumes that
578 all instances of a button have the same call data.
580 ... Which is a totally bogus assumption --andyp */
582 widget_value *val = instance->info->val;
583 /* If the widget is a buffer/gutter widget then we already have
584 the one we are looking for, so don't try and descend the widget
586 if (val && val->contents) {
587 char *name = XtName(widget);
590 if (val->name && !strcmp(val->name, name))
596 user_data = val->call_data;
602 if (instance->info->selection_cb && user_data)
603 instance->info->selection_cb(widget, id, user_data);
606 #ifdef LWLIB_DIALOGS_ATHENA
609 wm_delete_window(Widget shell, XtPointer closure, XtPointer call_data)
615 if (!XtIsSubclass(shell, shellWidgetClass))
617 XtSetArg(al[0], XtNchildren, &kids);
618 XtGetValues(shell, al, 1);
623 if (!XtIsSubclass(widget, dialogWidgetClass))
625 id = lw_get_widget_id(widget);
629 widget_info *info = lw_get_widget_info(id);
632 else if (info->selection_cb)
633 info->selection_cb(widget, id, (XtPointer) - 1);
636 lw_destroy_all_widgets(id);
641 #endif /* LWLIB_DIALOGS_ATHENA */
645 #ifdef LWLIB_SCROLLBARS_ATHENA
647 xaw_scrollbar_scroll(Widget widget, XtPointer closure, XtPointer call_data)
649 widget_instance *instance = (widget_instance *) closure;
651 scroll_event event_data;
653 if (!instance || widget->core.being_destroyed)
656 id = instance->info->id;
657 event_data.slider_value = (int)call_data;
660 if ((int)call_data > 0)
661 /* event_data.action = SCROLLBAR_PAGE_DOWN; */
662 event_data.action = SCROLLBAR_LINE_DOWN;
664 /* event_data.action = SCROLLBAR_PAGE_UP; */
665 event_data.action = SCROLLBAR_LINE_UP;
667 if (instance->info->pre_activate_cb)
668 instance->info->pre_activate_cb(widget, id,
669 (XtPointer) & event_data);
673 xaw_scrollbar_jump(Widget widget, XtPointer closure, XtPointer call_data)
675 widget_instance *instance = (widget_instance *) closure;
677 scroll_event event_data;
678 scrollbar_values *val =
679 (scrollbar_values *) instance->info->val->scrollbar_data;
682 if (!instance || widget->core.being_destroyed)
685 id = instance->info->id;
687 percent = *(float *)call_data;
688 event_data.slider_value =
689 (int)(percent * (float)(val->maximum - val->minimum)) +
693 event_data.action = SCROLLBAR_DRAG;
695 if (instance->info->pre_activate_cb)
696 instance->info->pre_activate_cb(widget, id,
697 (XtPointer) & event_data);
700 static Widget xaw_create_scrollbar(widget_instance * instance, int vertical)
705 static XtCallbackRec jumpCallbacks[2] =
706 { {xaw_scrollbar_jump, NULL}, {NULL, NULL} };
708 static XtCallbackRec scrollCallbacks[2] =
709 { {xaw_scrollbar_scroll, NULL}, {NULL, NULL} };
711 jumpCallbacks[0].closure = scrollCallbacks[0].closure =
712 (XtPointer) instance;
714 /* #### This is tacked onto the with and height and completely
715 screws our geometry management. We should probably make the
716 top-level aware of this so that people could have a border but so
717 few people use the Athena scrollbar now that it really isn't
718 worth the effort, at least not at the moment. */
719 XtSetArg(av[ac], XtNborderWidth, 0);
721 XtSetArg(av[ac], XtNorientation,
722 vertical ? XtorientVertical : XtorientHorizontal);
724 XtSetArg(av[ac], "jumpProc", jumpCallbacks);
726 XtSetArg(av[ac], "scrollProc", scrollCallbacks);
729 return XtCreateWidget(instance->info->name, scrollbarWidgetClass,
730 instance->parent, av, ac);
733 static Widget xaw_create_vertical_scrollbar(widget_instance * instance)
735 return xaw_create_scrollbar(instance, 1);
738 static Widget xaw_create_horizontal_scrollbar(widget_instance * instance)
740 return xaw_create_scrollbar(instance, 0);
742 #endif /* LWLIB_SCROLLBARS_ATHENA */
744 #ifdef LWLIB_WIDGETS_ATHENA
746 static Widget xaw_create_button(widget_instance * instance)
751 widget_value *val = instance->info->val;
753 XtSetArg(al[ac], XtNsensitive, val->enabled);
755 XtSetArg(al[ac], XtNmappedWhenManaged, FALSE);
757 XtSetArg(al[ac], XtNjustify, XtJustifyCenter);
759 /* The highlight doesn't appear to be dynamically set which makes it
760 look ugly. I think this may be a LessTif bug but for now we just
762 XtSetArg(al[ac], XtNhighlightThickness, (Dimension) 0);
765 /* add any args the user supplied for creation time */
766 lw_add_value_args_to_args(val, al, &ac);
769 button = XtCreateManagedWidget(val->name, labelWidgetClass,
770 instance->parent, al, ac);
773 if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) {
774 XtSetArg(al[ac], XtNstate, val->selected);
776 button = XtCreateManagedWidget
779 TOGGLE_TYPE ? checkboxWidgetClass :
780 radioWidgetClass, instance->parent, al, ac);
783 XtCreateManagedWidget(val->name, commandWidgetClass,
784 instance->parent, al, ac);
786 XtRemoveAllCallbacks(button, XtNcallback);
787 XtAddCallback(button, XtNcallback, xaw_generic_callback,
788 (XtPointer) instance);
791 XtManageChild(button);
796 static Widget xaw_create_label_field(widget_instance * instance)
798 return xaw_create_label(instance->parent, instance->info->val);
801 Widget xaw_create_label(Widget parent, widget_value * val)
807 XtSetArg(al[ac], XtNsensitive, val->enabled);
809 XtSetArg(al[ac], XtNmappedWhenManaged, FALSE);
811 XtSetArg(al[ac], XtNjustify, XtJustifyCenter);
814 /* add any args the user supplied for creation time */
815 lw_add_value_args_to_args(val, al, &ac);
817 label = XtCreateManagedWidget(val->name, labelWidgetClass,
820 /* Do it again for arguments that have no effect until the widget is realized. */
822 lw_add_value_args_to_args(val, al, &ac);
824 abort(); /* #### need assert macro in lwlib */
825 XtSetValues(label, al, ac);
830 static Widget xaw_create_progress(widget_instance * instance)
835 widget_value *val = instance->info->val;
836 #if 0 /* This looks too awful, although more correct. */
837 if (!val->call_data) {
838 XtSetArg(al[ac], XtNsensitive, False);
841 XtSetArg(al[ac], XtNsensitive, val->enabled);
845 XtSetArg(al[ac], XtNsensitive, True);
849 XtSetArg(al[ac], XtNmappedWhenManaged, FALSE);
851 XtSetArg(al[ac], XtNorientation, XtorientHorizontal);
853 XtSetArg(al[ac], XtNhighlightThickness, (Dimension) 0);
855 XtSetArg(al[ac], XtNntics, (Cardinal) 10);
858 /* add any args the user supplied for creation time */
859 lw_add_value_args_to_args(val, al, &ac);
861 scale = XtCreateManagedWidget(val->name, gaugeWidgetClass,
862 instance->parent, al, ac);
863 /* add the callback */
865 XtAddCallback(scale, XtNgetValue, xaw_generic_callback,
866 (XtPointer) instance);
868 XtManageChild(scale);
873 #if defined(LWLIB_WIDGETS_ATHENA)
874 #define TEXT_BUFFER_SIZE 128
875 static Widget xaw_create_text_field(widget_instance * instance)
880 widget_value *val = instance->info->val;
882 XtSetArg(al[ac], XtNsensitive, val->enabled);
884 XtSetArg(al[ac], XtNmappedWhenManaged, FALSE);
886 XtSetArg(al[ac], XtNhighlightThickness, (Dimension) 0);
888 XtSetArg(al[ac], XtNtype, XawAsciiString);
890 XtSetArg(al[ac], XtNeditType, XawtextEdit);
892 XtSetArg(al[ac], XtNuseStringInPlace, False);
895 XtSetArg(al[ac], XtNlength, TEXT_BUFFER_SIZE);
899 XtSetArg(al[ac], XtNstring, val->value);
903 /* add any args the user supplied for creation time */
904 lw_add_value_args_to_args(val, al, &ac);
906 text = XtCreateManagedWidget(val->name, asciiTextWidgetClass,
907 instance->parent, al, ac);
909 /* add the callback */
911 XtAddCallback(text, XtNgetValue, xaw_generic_callback,
912 (XtPointer) instance);
920 #endif /* LWLIB_WIDGETS_ATHENA */
922 const widget_creation_entry xaw_creation_table[] = {
923 #ifdef LWLIB_SCROLLBARS_ATHENA
924 {"vertical-scrollbar", xaw_create_vertical_scrollbar},
925 {"horizontal-scrollbar", xaw_create_horizontal_scrollbar},
927 #ifdef LWLIB_WIDGETS_ATHENA
928 {"button", xaw_create_button},
929 {"label", xaw_create_label_field},
930 {"text-field", xaw_create_text_field},
931 {"progress", xaw_create_progress},