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 XtSetArg (al [0], XtNlabel, val->value);
183 XtSetArg (al [1], XtNsensitive, val->enabled);
184 /* Force centered button text. See above. */
185 XtSetArg (al [2], XtNjustify, XtJustifyCenter);
186 XtSetValues (widget, al, 3);
188 XtRemoveAllCallbacks (widget, XtNcallback);
189 XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance);
190 #ifdef LWLIB_WIDGETS_ATHENA
191 /* set the selected state */
192 if (XtIsSubclass (widget, toggleWidgetClass))
194 XtSetArg (al [0], XtNstate, val->selected);
195 XtSetValues (widget, al, 1);
197 #endif /* LWLIB_WIDGETS_ATHENA */
199 #endif /* LWLIB_DIALOGS_ATHENA */
200 /* Lastly update our global arg values. */
201 if (val->args && val->args->nargs)
202 XtSetValues (widget, val->args->args, val->args->nargs);
206 xaw_update_one_value (widget_instance *instance, Widget widget,
209 #ifdef LWLIB_WIDGETS_ATHENA
210 widget_value *old_wv;
212 /* copy the call_data slot into the "return" widget_value */
213 for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next)
214 if (!strcmp (val->name, old_wv->name))
216 val->call_data = old_wv->call_data;
220 if (XtIsSubclass (widget, toggleWidgetClass))
223 XtSetArg (al [0], XtNstate, &val->selected);
224 XtGetValues (widget, al, 1);
228 else if (XtIsSubclass (widget, asciiTextWidgetClass))
232 XtSetArg (al [0], XtNstring, &buf);
233 XtGetValues (widget, al, 1);
240 /* I don't think this causes a leak. */
242 val->value = strdup (buf);
246 #endif /* LWLIB_WIDGETS_ATHENA */
250 xaw_destroy_instance (widget_instance *instance)
252 #ifdef LWLIB_DIALOGS_ATHENA
253 if (XtIsSubclass (instance->widget, dialogWidgetClass))
254 /* Need to destroy the Shell too. */
255 XtDestroyWidget (XtParent (instance->widget));
258 XtDestroyWidget (instance->widget);
262 xaw_popup_menu (Widget widget, XEvent *event)
264 /* An Athena menubar has not been implemented. */
269 xaw_pop_instance (widget_instance *instance, Boolean up)
271 Widget widget = instance->widget;
275 #ifdef LWLIB_DIALOGS_ATHENA
276 if (XtIsSubclass (widget, dialogWidgetClass))
278 /* For dialogs, we need to call XtPopup on the parent instead
279 of calling XtManageChild on the widget.
280 Also we need to hack the shell's WM_PROTOCOLS to get it to
281 understand what the close box is supposed to do!!
283 Display *dpy = XtDisplay (widget);
284 Widget shell = XtParent (widget);
287 props [i++] = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
288 XChangeProperty (dpy, XtWindow (shell),
289 XInternAtom (dpy, "WM_PROTOCOLS", False),
290 XA_ATOM, 32, PropModeAppend,
291 (unsigned char *) props, i);
293 /* Center the widget in its parent. Why isn't this kind of crap
294 done automatically? I thought toolkits were supposed to make
298 unsigned int x, y, w, h;
299 Widget topmost = instance->parent;
300 w = shell->core.width;
301 h = shell->core.height;
302 while (topmost->core.parent &&
303 XtIsRealized (topmost->core.parent) &&
304 /* HAVE_SESSION adds an unmapped parent widget that
305 we should ignore here. */
306 topmost->core.parent->core.mapped_when_managed)
307 topmost = topmost->core.parent;
308 if (topmost->core.width < w) x = topmost->core.x;
309 else x = topmost->core.x + ((topmost->core.width - w) / 2);
310 if (topmost->core.height < h) y = topmost->core.y;
311 else y = topmost->core.y + ((topmost->core.height - h) / 2);
312 XtMoveWidget (shell, x, y);
315 /* Finally, pop it up. */
316 XtPopup (shell, XtGrabNonexclusive);
319 #endif /* LWLIB_DIALOGS_ATHENA */
320 XtManageChild (widget);
324 #ifdef LWLIB_DIALOGS_ATHENA
325 if (XtIsSubclass (widget, dialogWidgetClass))
326 XtUnmanageChild (XtParent (widget));
329 XtUnmanageChild (widget);
334 #ifdef LWLIB_DIALOGS_ATHENA
337 static char overrideTrans[] =
338 "<Message>WM_PROTOCOLS: lwlib_delete_dialog()";
339 static XtActionProc wm_delete_window (Widget shell, XtPointer closure,
340 XtPointer call_data);
341 static XtActionsRec xaw_actions [] = {
342 {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
344 static Boolean actions_initted = False;
347 make_dialog (const char* name, Widget parent, Boolean pop_up_p,
348 const char* shell_title, const char* icon_name,
349 Boolean text_input_slot,
350 Boolean radio_box, Boolean list,
351 int left_buttons, int right_buttons)
356 char button_name [255];
360 XtTranslations override;
362 if (! pop_up_p) abort (); /* not implemented */
363 if (text_input_slot) abort (); /* not implemented */
364 if (radio_box) abort (); /* not implemented */
365 if (list) abort (); /* not implemented */
367 if (! actions_initted)
369 XtAppContext app = XtWidgetToApplicationContext (parent);
370 XtAppAddActions (app, xaw_actions,
371 sizeof (xaw_actions) / sizeof (xaw_actions[0]));
372 actions_initted = True;
375 override = XtParseTranslationTable (overrideTrans);
378 XtSetArg (av[ac], XtNtitle, shell_title); ac++;
379 XtSetArg (av[ac], XtNallowShellResize, True); ac++;
380 XtSetArg (av[ac], XtNtransientFor, parent); ac++;
381 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
383 XtOverrideTranslations (shell, override);
386 dialog = XtCreateManagedWidget (name, dialogWidgetClass, shell, av, ac);
390 for (i = 0; i < left_buttons; i++)
393 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
394 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
395 XtSetArg (av [ac], XtNright, XtChainLeft); ac++;
396 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
397 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
398 XtSetArg (av [ac], XtNresizable, True); ac++;
399 sprintf (button_name, "button%d", ++bc);
400 button = XtCreateManagedWidget (button_name, commandWidgetClass,
405 /* Create a separator
407 I want the separator to take up the slack between the buttons on
408 the right and the buttons on the left (that is I want the buttons
409 after the separator to be packed against the right edge of the
410 window) but I can't seem to make it do it.
413 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
414 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
415 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
416 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
417 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
418 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
419 XtSetArg (av [ac], XtNlabel, ""); ac++;
420 XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */
421 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
422 XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
423 XtSetArg (av [ac], XtNresizable, False); ac++;
424 XtSetArg (av [ac], XtNsensitive, False); ac++;
425 button = XtCreateManagedWidget ("separator",
426 /* labelWidgetClass, */
427 /* This has to be Command to fake out
428 the Dialog widget... */
432 for (i = 0; i < right_buttons; i++)
435 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
436 XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
437 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
438 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
439 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
440 XtSetArg (av [ac], XtNresizable, True); ac++;
441 sprintf (button_name, "button%d", ++bc);
442 button = XtCreateManagedWidget (button_name, commandWidgetClass,
450 xaw_create_dialog (widget_instance* instance)
452 char *name = instance->info->type;
453 Widget parent = instance->parent;
455 Boolean pop_up_p = instance->pop_up_p;
456 const char *shell_name = 0;
457 const char *icon_name = 0;
458 Boolean text_input_slot = False;
459 Boolean radio_box = False;
460 Boolean list = False;
462 int left_buttons = 0;
463 int right_buttons = 1;
467 icon_name = "dbox-error";
468 shell_name = "Error";
472 icon_name = "dbox-info";
473 shell_name = "Information";
478 icon_name = "dbox-question";
479 shell_name = "Prompt";
483 text_input_slot = True;
484 icon_name = "dbox-question";
485 shell_name = "Prompt";
489 icon_name = "dbox-question";
490 shell_name = "Question";
494 total_buttons = name [1] - '0';
496 if (name [3] == 'T' || name [3] == 't')
498 text_input_slot = False;
502 right_buttons = name [4] - '0';
504 left_buttons = total_buttons - right_buttons;
506 widget = make_dialog (name, parent, pop_up_p,
507 shell_name, icon_name, text_input_slot, radio_box,
508 list, left_buttons, right_buttons);
512 #endif /* LWLIB_DIALOGS_ATHENA */
516 xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
518 widget_instance *instance = (widget_instance *) closure;
519 Widget instance_widget;
522 #ifdef LWLIB_WIDGETS_ATHENA
523 /* We want the selected status to change only when we decide it
524 should change. Yuck but correct. */
525 if (XtIsSubclass (widget, toggleWidgetClass))
530 XtSetArg (al [0], XtNstate, &check);
531 XtGetValues (widget, al, 1);
533 XtSetArg (al [0], XtNstate, !check);
534 XtSetValues (widget, al, 1);
536 #endif /* LWLIB_WIDGETS_ATHENA */
537 lw_internal_update_other_instances (widget, closure, call_data);
541 if (widget->core.being_destroyed)
544 instance_widget = instance->widget;
545 if (!instance_widget)
548 id = instance->info->id;
554 XtSetArg (al [0], XtNuserData, &user_data);
555 XtGetValues (widget, al, 1);
558 /* Damn! Athena doesn't give us a way to hang our own data on the
559 buttons, so we have to go find it... I guess this assumes that
560 all instances of a button have the same call data.
562 ... Which is a totally bogus assumption --andyp */
564 widget_value *val = instance->info->val;
565 /* If the widget is a buffer/gutter widget then we already have
566 the one we are looking for, so don't try and descend the widget
570 char *name = XtName (widget);
574 if (val->name && !strcmp (val->name, name))
580 user_data = val->call_data;
584 if (instance->info->selection_cb)
585 instance->info->selection_cb (widget, id, user_data);
588 #ifdef LWLIB_DIALOGS_ATHENA
591 wm_delete_window (Widget shell, XtPointer closure, XtPointer call_data)
597 if (! XtIsSubclass (shell, shellWidgetClass))
599 XtSetArg (al [0], XtNchildren, &kids);
600 XtGetValues (shell, al, 1);
604 if (! XtIsSubclass (widget, dialogWidgetClass))
606 id = lw_get_widget_id (widget);
610 widget_info *info = lw_get_widget_info (id);
611 if (! info) abort ();
612 if (info->selection_cb)
613 info->selection_cb (widget, id, (XtPointer) -1);
616 lw_destroy_all_widgets (id);
620 #endif /* LWLIB_DIALOGS_ATHENA */
625 #ifdef LWLIB_SCROLLBARS_ATHENA
627 xaw_scrollbar_scroll (Widget widget, XtPointer closure, XtPointer call_data)
629 widget_instance *instance = (widget_instance *) closure;
631 scroll_event event_data;
633 if (!instance || widget->core.being_destroyed)
636 id = instance->info->id;
637 event_data.slider_value = (int) call_data;
640 if ((int) call_data > 0)
641 /* event_data.action = SCROLLBAR_PAGE_DOWN;*/
642 event_data.action = SCROLLBAR_LINE_DOWN;
644 /* event_data.action = SCROLLBAR_PAGE_UP;*/
645 event_data.action = SCROLLBAR_LINE_UP;
647 if (instance->info->pre_activate_cb)
648 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
652 xaw_scrollbar_jump (Widget widget, XtPointer closure, XtPointer call_data)
654 widget_instance *instance = (widget_instance *) closure;
656 scroll_event event_data;
657 scrollbar_values *val =
658 (scrollbar_values *) instance->info->val->scrollbar_data;
661 if (!instance || widget->core.being_destroyed)
664 id = instance->info->id;
666 percent = * (float *) call_data;
667 event_data.slider_value =
668 (int) (percent * (float) (val->maximum - val->minimum)) + val->minimum;
671 event_data.action = SCROLLBAR_DRAG;
673 if (instance->info->pre_activate_cb)
674 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
678 xaw_create_scrollbar (widget_instance *instance, int vertical)
683 static XtCallbackRec jumpCallbacks[2] =
684 { {xaw_scrollbar_jump, NULL}, {NULL, NULL} };
686 static XtCallbackRec scrollCallbacks[2] =
687 { {xaw_scrollbar_scroll, NULL}, {NULL, NULL} };
689 jumpCallbacks[0].closure = scrollCallbacks[0].closure = (XtPointer) instance;
691 /* #### This is tacked onto the with and height and completely
692 screws our geometry management. We should probably make the
693 top-level aware of this so that people could have a border but so
694 few people use the Athena scrollbar now that it really isn't
695 worth the effort, at least not at the moment. */
696 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
697 XtSetArg (av [ac], XtNorientation,
698 vertical ? XtorientVertical : XtorientHorizontal); ac++;
699 XtSetArg (av [ac], "jumpProc", jumpCallbacks); ac++;
700 XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++;
702 return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
703 instance->parent, av, ac);
707 xaw_create_vertical_scrollbar (widget_instance *instance)
709 return xaw_create_scrollbar (instance, 1);
713 xaw_create_horizontal_scrollbar (widget_instance *instance)
715 return xaw_create_scrollbar (instance, 0);
717 #endif /* LWLIB_SCROLLBARS_ATHENA */
719 #ifdef LWLIB_WIDGETS_ATHENA
722 xaw_create_button (widget_instance *instance)
727 widget_value* val = instance->info->val;
729 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
730 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
731 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
732 /* The highlight doesn't appear to be dynamically set which makes it
733 look ugly. I think this may be a LessTif bug but for now we just
735 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
737 /* add any args the user supplied for creation time */
738 lw_add_value_args_to_args (val, al, &ac);
741 button = XtCreateManagedWidget (val->name, labelWidgetClass,
742 instance->parent, al, ac);
746 if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
748 XtSetArg (al [ac], XtNstate, val->selected); ac++;
749 button = XtCreateManagedWidget
751 val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
752 instance->parent, al, ac);
756 button = XtCreateManagedWidget (val->name, commandWidgetClass,
757 instance->parent, al, ac);
759 XtRemoveAllCallbacks (button, XtNcallback);
760 XtAddCallback (button, XtNcallback, xaw_generic_callback, (XtPointer)instance);
763 XtManageChild (button);
769 xaw_create_label_field (widget_instance *instance)
771 return xaw_create_label (instance->parent, instance->info->val);
775 xaw_create_label (Widget parent, widget_value* val)
781 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
782 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
783 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
785 /* add any args the user supplied for creation time */
786 lw_add_value_args_to_args (val, al, &ac);
788 label = XtCreateManagedWidget (val->name, labelWidgetClass,
791 /* Do it again for arguments that have no effect until the widget is realized. */
793 lw_add_value_args_to_args (val, al, &ac);
795 abort (); /* #### need assert macro in lwlib */
796 XtSetValues (label, al, ac);
802 xaw_create_progress (widget_instance *instance)
807 widget_value* val = instance->info->val;
808 #if 0 /* This looks too awful, although more correct. */
811 XtSetArg (al [ac], XtNsensitive, False); ac++;
815 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
818 XtSetArg (al [ac], XtNsensitive, True); ac++;
821 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
822 XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
823 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
824 XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++;
826 /* add any args the user supplied for creation time */
827 lw_add_value_args_to_args (val, al, &ac);
829 scale = XtCreateManagedWidget (val->name, gaugeWidgetClass,
830 instance->parent, al, ac);
831 /* add the callback */
833 XtAddCallback (scale, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
835 XtManageChild (scale);
841 #define TEXT_BUFFER_SIZE 128
843 xaw_create_text_field (widget_instance *instance)
848 widget_value* val = instance->info->val;
850 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
851 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
852 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
853 XtSetArg (al [ac], XtNtype, XawAsciiString); ac++;
854 XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++;
855 XtSetArg (al [ac], XtNuseStringInPlace, False); ac++;
857 XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
861 XtSetArg (al [ac], XtNstring, val->value); ac++;
864 /* add any args the user supplied for creation time */
865 lw_add_value_args_to_args (val, al, &ac);
867 text = XtCreateManagedWidget (val->name, asciiTextWidgetClass,
868 instance->parent, al, ac);
870 /* add the callback */
872 XtAddCallback (text, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
874 XtManageChild (text);
880 #endif /* LWLIB_WIDGETS_ATHENA */
882 widget_creation_entry
883 xaw_creation_table [] =
885 #ifdef LWLIB_SCROLLBARS_ATHENA
886 {"vertical-scrollbar", xaw_create_vertical_scrollbar },
887 {"horizontal-scrollbar", xaw_create_horizontal_scrollbar },
889 #ifdef LWLIB_WIDGETS_ATHENA
890 {"button", xaw_create_button },
891 { "label", xaw_create_label_field },
893 {"text-field", xaw_create_text_field },
895 {"progress", xaw_create_progress },