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"
49 #include ATHENA_AsciiText_h_
51 #include <X11/Xatom.h>
53 static void xaw_generic_callback (Widget, XtPointer, XtPointer);
57 lw_xaw_widget_p (Widget widget)
60 #ifdef LWLIB_SCROLLBARS_ATHENA
61 || XtIsSubclass (widget, scrollbarWidgetClass)
63 #ifdef LWLIB_DIALOGS_ATHENA
64 || XtIsSubclass (widget, dialogWidgetClass)
66 #ifdef LWLIB_WIDGETS_ATHENA
67 || XtIsSubclass (widget, labelWidgetClass)
68 || XtIsSubclass (widget, toggleWidgetClass)
69 || XtIsSubclass (widget, gaugeWidgetClass)
71 || XtIsSubclass (widget, asciiTextWidgetClass)
77 #ifdef LWLIB_SCROLLBARS_ATHENA
79 xaw_update_scrollbar (widget_instance *instance, Widget widget,
82 if (val->scrollbar_data)
84 scrollbar_values *data = val->scrollbar_data;
85 float widget_shown, widget_topOfThumb;
86 float new_shown, new_topOfThumb;
89 /* First size and position the scrollbar widget. */
90 XtSetArg (al [0], XtNx, data->scrollbar_x);
91 XtSetArg (al [1], XtNy, data->scrollbar_y);
92 XtSetArg (al [2], XtNwidth, data->scrollbar_width);
93 XtSetArg (al [3], XtNheight, data->scrollbar_height);
94 XtSetValues (widget, al, 4);
96 /* Now size the scrollbar's slider. */
97 XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb);
98 XtSetArg (al [1], XtNshown, &widget_shown);
99 XtGetValues (widget, al, 2);
101 new_shown = (double) data->slider_size /
102 (double) (data->maximum - data->minimum);
104 new_topOfThumb = (double) (data->slider_position - data->minimum) /
105 (double) (data->maximum - data->minimum);
109 else if (new_shown < 0)
112 if (new_topOfThumb > 1.0)
113 new_topOfThumb = 1.0;
114 else if (new_topOfThumb < 0)
117 if (new_shown != widget_shown || new_topOfThumb != widget_topOfThumb)
118 XawScrollbarSetThumb (widget, new_topOfThumb, new_shown);
121 #endif /* LWLIB_SCROLLBARS_ATHENA */
124 xaw_update_one_widget (widget_instance *instance, Widget widget,
125 widget_value *val, Boolean deep_p)
129 #ifdef LWLIB_SCROLLBARS_ATHENA
130 else if (XtIsSubclass (widget, scrollbarWidgetClass))
132 xaw_update_scrollbar (instance, widget, val);
135 #ifdef LWLIB_WIDGETS_ATHENA
137 else if (XtIsSubclass (widget, asciiTextWidgetClass))
142 #ifdef LWLIB_DIALOGS_ATHENA
143 else if (XtIsSubclass (widget, dialogWidgetClass))
146 XtSetArg (al [0], XtNlabel, val->contents->value);
147 XtSetValues (widget, al, 1);
149 #endif /* LWLIB_DIALOGS_ATHENA */
150 #ifdef LWLIB_WIDGETS_ATHENA
151 else if (XtClass (widget) == labelWidgetClass)
154 XtSetArg (al [0], XtNlabel, val->value);
155 XtSetValues (widget, al, 1);
157 #endif /* LWLIB_WIDGETS_ATHENA */
158 #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA)
159 else if (XtIsSubclass (widget, commandWidgetClass))
163 XtSetArg (al [0], XtNborderWidth, &bw);
164 XtGetValues (widget, al, 1);
166 #ifndef LWLIB_DIALOGS_ATHENA3D
168 /* Don't let buttons end up with 0 borderwidth, that's ugly...
169 Yeah, all this should really be done through app-defaults files
170 or fallback resources, but that's a whole different can of worms
171 that I don't feel like opening right now. Making Athena widgets
172 not look like shit is just entirely too much work.
175 XtSetArg (al [0], XtNborderWidth, 1);
176 XtSetValues (widget, al, 1);
178 #endif /* ! LWLIB_DIALOGS_ATHENA3D */
180 lw_remove_accelerator_spec (val->value);
181 XtSetArg (al [0], XtNlabel, val->value);
182 XtSetArg (al [1], XtNsensitive, val->enabled);
183 /* Force centered button text. See above. */
184 XtSetArg (al [2], XtNjustify, XtJustifyCenter);
185 XtSetValues (widget, al, 3);
187 XtRemoveAllCallbacks (widget, XtNcallback);
188 XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance);
189 #ifdef LWLIB_WIDGETS_ATHENA
190 /* set the selected state */
191 if (XtIsSubclass (widget, toggleWidgetClass))
193 XtSetArg (al [0], XtNstate, val->selected);
194 XtSetValues (widget, al, 1);
196 #endif /* LWLIB_WIDGETS_ATHENA */
198 #endif /* LWLIB_DIALOGS_ATHENA */
199 /* Lastly update our global arg values. */
200 if (val->args && val->args->nargs)
201 XtSetValues (widget, val->args->args, val->args->nargs);
205 xaw_update_one_value (widget_instance *instance, Widget widget,
208 #ifdef LWLIB_WIDGETS_ATHENA
209 widget_value *old_wv;
211 /* copy the call_data slot into the "return" widget_value */
212 for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next)
213 if (!strcmp (val->name, old_wv->name))
215 val->call_data = old_wv->call_data;
219 if (XtIsSubclass (widget, toggleWidgetClass))
222 XtSetArg (al [0], XtNstate, &val->selected);
223 XtGetValues (widget, al, 1);
227 else if (XtIsSubclass (widget, asciiTextWidgetClass))
231 XtSetArg (al [0], XtNstring, &buf);
232 XtGetValues (widget, al, 1);
239 /* I don't think this causes a leak. */
241 val->value = strdup (buf);
245 #endif /* LWLIB_WIDGETS_ATHENA */
249 xaw_destroy_instance (widget_instance *instance)
251 #ifdef LWLIB_DIALOGS_ATHENA
252 if (XtIsSubclass (instance->widget, dialogWidgetClass))
253 /* Need to destroy the Shell too. */
254 XtDestroyWidget (XtParent (instance->widget));
257 XtDestroyWidget (instance->widget);
261 xaw_popup_menu (Widget widget, XEvent *event)
263 /* An Athena menubar has not been implemented. */
268 xaw_pop_instance (widget_instance *instance, Boolean up)
270 Widget widget = instance->widget;
274 #ifdef LWLIB_DIALOGS_ATHENA
275 if (XtIsSubclass (widget, dialogWidgetClass))
277 /* For dialogs, we need to call XtPopup on the parent instead
278 of calling XtManageChild on the widget.
279 Also we need to hack the shell's WM_PROTOCOLS to get it to
280 understand what the close box is supposed to do!!
282 Display *dpy = XtDisplay (widget);
283 Widget shell = XtParent (widget);
286 props [i++] = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
287 XChangeProperty (dpy, XtWindow (shell),
288 XInternAtom (dpy, "WM_PROTOCOLS", False),
289 XA_ATOM, 32, PropModeAppend,
290 (unsigned char *) props, i);
292 /* Center the widget in its parent. Why isn't this kind of crap
293 done automatically? I thought toolkits were supposed to make
297 unsigned int x, y, w, h;
298 Widget topmost = instance->parent;
299 w = shell->core.width;
300 h = shell->core.height;
301 while (topmost->core.parent &&
302 XtIsRealized (topmost->core.parent) &&
303 /* HAVE_SESSION adds an unmapped parent widget that
304 we should ignore here. */
305 topmost->core.parent->core.mapped_when_managed)
306 topmost = topmost->core.parent;
307 if (topmost->core.width < w) x = topmost->core.x;
308 else x = topmost->core.x + ((topmost->core.width - w) / 2);
309 if (topmost->core.height < h) y = topmost->core.y;
310 else y = topmost->core.y + ((topmost->core.height - h) / 2);
311 XtMoveWidget (shell, x, y);
314 /* Finally, pop it up. */
315 XtPopup (shell, XtGrabNonexclusive);
318 #endif /* LWLIB_DIALOGS_ATHENA */
319 XtManageChild (widget);
323 #ifdef LWLIB_DIALOGS_ATHENA
324 if (XtIsSubclass (widget, dialogWidgetClass))
325 XtUnmanageChild (XtParent (widget));
328 XtUnmanageChild (widget);
333 #ifdef LWLIB_DIALOGS_ATHENA
336 static char overrideTrans[] =
337 "<Message>WM_PROTOCOLS: lwlib_delete_dialog()";
338 static XtActionProc wm_delete_window (Widget shell, XtPointer closure,
339 XtPointer call_data);
340 static XtActionsRec xaw_actions [] = {
341 {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
343 static Boolean actions_initted = False;
346 make_dialog (const char* name, Widget parent, Boolean pop_up_p,
347 const char* shell_title, const char* icon_name,
348 Boolean text_input_slot,
349 Boolean radio_box, Boolean list,
350 int left_buttons, int right_buttons)
355 char button_name [255];
359 XtTranslations override;
361 if (! pop_up_p) abort (); /* not implemented */
362 if (text_input_slot) abort (); /* not implemented */
363 if (radio_box) abort (); /* not implemented */
364 if (list) abort (); /* not implemented */
366 if (! actions_initted)
368 XtAppContext app = XtWidgetToApplicationContext (parent);
369 XtAppAddActions (app, xaw_actions,
370 sizeof (xaw_actions) / sizeof (xaw_actions[0]));
371 actions_initted = True;
374 override = XtParseTranslationTable (overrideTrans);
377 XtSetArg (av[ac], XtNtitle, shell_title); ac++;
378 XtSetArg (av[ac], XtNallowShellResize, True); ac++;
379 XtSetArg (av[ac], XtNtransientFor, parent); ac++;
380 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
382 XtOverrideTranslations (shell, override);
385 dialog = XtCreateManagedWidget (name, dialogWidgetClass, shell, av, ac);
389 for (i = 0; i < left_buttons; i++)
392 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
393 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
394 XtSetArg (av [ac], XtNright, XtChainLeft); ac++;
395 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
396 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
397 XtSetArg (av [ac], XtNresizable, True); ac++;
398 sprintf (button_name, "button%d", ++bc);
399 button = XtCreateManagedWidget (button_name, commandWidgetClass,
404 /* Create a separator
406 I want the separator to take up the slack between the buttons on
407 the right and the buttons on the left (that is I want the buttons
408 after the separator to be packed against the right edge of the
409 window) but I can't seem to make it do it.
412 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
413 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
414 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
415 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
416 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
417 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
418 XtSetArg (av [ac], XtNlabel, ""); ac++;
419 XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */
420 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
421 XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
422 XtSetArg (av [ac], XtNresizable, False); ac++;
423 XtSetArg (av [ac], XtNsensitive, False); ac++;
424 button = XtCreateManagedWidget ("separator",
425 /* labelWidgetClass, */
426 /* This has to be Command to fake out
427 the Dialog widget... */
431 for (i = 0; i < right_buttons; i++)
434 XtSetArg (av [ac], XtNfromHoriz, button); ac++;
435 XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
436 XtSetArg (av [ac], XtNright, XtChainRight); ac++;
437 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
438 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
439 XtSetArg (av [ac], XtNresizable, True); ac++;
440 sprintf (button_name, "button%d", ++bc);
441 button = XtCreateManagedWidget (button_name, commandWidgetClass,
449 xaw_create_dialog (widget_instance* instance)
451 char *name = instance->info->type;
452 Widget parent = instance->parent;
454 Boolean pop_up_p = instance->pop_up_p;
455 const char *shell_name = 0;
456 const char *icon_name = 0;
457 Boolean text_input_slot = False;
458 Boolean radio_box = False;
459 Boolean list = False;
461 int left_buttons = 0;
462 int right_buttons = 1;
466 icon_name = "dbox-error";
467 shell_name = "Error";
471 icon_name = "dbox-info";
472 shell_name = "Information";
477 icon_name = "dbox-question";
478 shell_name = "Prompt";
482 text_input_slot = True;
483 icon_name = "dbox-question";
484 shell_name = "Prompt";
488 icon_name = "dbox-question";
489 shell_name = "Question";
493 total_buttons = name [1] - '0';
495 if (name [3] == 'T' || name [3] == 't')
497 text_input_slot = False;
501 right_buttons = name [4] - '0';
503 left_buttons = total_buttons - right_buttons;
505 widget = make_dialog (name, parent, pop_up_p,
506 shell_name, icon_name, text_input_slot, radio_box,
507 list, left_buttons, right_buttons);
511 #endif /* LWLIB_DIALOGS_ATHENA */
515 xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
517 widget_instance *instance = (widget_instance *) closure;
518 Widget instance_widget;
521 #ifdef LWLIB_WIDGETS_ATHENA
522 /* We want the selected status to change only when we decide it
523 should change. Yuck but correct. */
524 if (XtIsSubclass (widget, toggleWidgetClass))
529 XtSetArg (al [0], XtNstate, &check);
530 XtGetValues (widget, al, 1);
532 XtSetArg (al [0], XtNstate, !check);
533 XtSetValues (widget, al, 1);
535 #endif /* LWLIB_WIDGETS_ATHENA */
536 lw_internal_update_other_instances (widget, closure, call_data);
540 if (widget->core.being_destroyed)
543 instance_widget = instance->widget;
544 if (!instance_widget)
547 id = instance->info->id;
553 XtSetArg (al [0], XtNuserData, &user_data);
554 XtGetValues (widget, al, 1);
557 /* Damn! Athena doesn't give us a way to hang our own data on the
558 buttons, so we have to go find it... I guess this assumes that
559 all instances of a button have the same call data.
561 ... Which is a totally bogus assumption --andyp */
563 widget_value *val = instance->info->val;
564 /* If the widget is a buffer/gutter widget then we already have
565 the one we are looking for, so don't try and descend the widget
569 char *name = XtName (widget);
573 if (val->name && !strcmp (val->name, name))
579 user_data = val->call_data;
583 if (instance->info->selection_cb)
584 instance->info->selection_cb (widget, id, user_data);
587 #ifdef LWLIB_DIALOGS_ATHENA
590 wm_delete_window (Widget shell, XtPointer closure, XtPointer call_data)
596 if (! XtIsSubclass (shell, shellWidgetClass))
598 XtSetArg (al [0], XtNchildren, &kids);
599 XtGetValues (shell, al, 1);
600 if (!kids || !*kids) abort ();
603 widget && ! XtIsSubclass (widget, dialogWidgetClass);
606 if (!widget) abort ();
608 id = lw_get_widget_id (widget);
612 widget_info *info = lw_get_widget_info (id);
613 if (! info) abort ();
614 if (info->selection_cb)
615 info->selection_cb (widget, id, (XtPointer) -1);
618 lw_destroy_all_widgets (id);
622 #endif /* LWLIB_DIALOGS_ATHENA */
627 #ifdef LWLIB_SCROLLBARS_ATHENA
629 xaw_scrollbar_scroll (Widget widget, XtPointer closure, XtPointer call_data)
631 widget_instance *instance = (widget_instance *) closure;
633 scroll_event event_data;
635 if (!instance || widget->core.being_destroyed)
638 id = instance->info->id;
639 event_data.slider_value = (int) call_data;
642 if ((int) call_data > 0)
643 /* event_data.action = SCROLLBAR_PAGE_DOWN;*/
644 event_data.action = SCROLLBAR_LINE_DOWN;
646 /* event_data.action = SCROLLBAR_PAGE_UP;*/
647 event_data.action = SCROLLBAR_LINE_UP;
649 if (instance->info->pre_activate_cb)
650 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
654 xaw_scrollbar_jump (Widget widget, XtPointer closure, XtPointer call_data)
656 widget_instance *instance = (widget_instance *) closure;
658 scroll_event event_data;
659 scrollbar_values *val =
660 (scrollbar_values *) instance->info->val->scrollbar_data;
663 if (!instance || widget->core.being_destroyed)
666 id = instance->info->id;
668 percent = * (float *) call_data;
669 event_data.slider_value =
670 (int) (percent * (float) (val->maximum - val->minimum)) + val->minimum;
673 event_data.action = SCROLLBAR_DRAG;
675 if (instance->info->pre_activate_cb)
676 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
680 xaw_create_scrollbar (widget_instance *instance, int vertical)
685 static XtCallbackRec jumpCallbacks[2] =
686 { {xaw_scrollbar_jump, NULL}, {NULL, NULL} };
688 static XtCallbackRec scrollCallbacks[2] =
689 { {xaw_scrollbar_scroll, NULL}, {NULL, NULL} };
691 jumpCallbacks[0].closure = scrollCallbacks[0].closure = (XtPointer) instance;
693 /* #### This is tacked onto the with and height and completely
694 screws our geometry management. We should probably make the
695 top-level aware of this so that people could have a border but so
696 few people use the Athena scrollbar now that it really isn't
697 worth the effort, at least not at the moment. */
698 XtSetArg (av [ac], XtNborderWidth, 0); ac++;
699 XtSetArg (av [ac], XtNorientation,
700 vertical ? XtorientVertical : XtorientHorizontal); ac++;
701 XtSetArg (av [ac], "jumpProc", jumpCallbacks); ac++;
702 XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++;
704 return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
705 instance->parent, av, ac);
709 xaw_create_vertical_scrollbar (widget_instance *instance)
711 return xaw_create_scrollbar (instance, 1);
715 xaw_create_horizontal_scrollbar (widget_instance *instance)
717 return xaw_create_scrollbar (instance, 0);
719 #endif /* LWLIB_SCROLLBARS_ATHENA */
721 #ifdef LWLIB_WIDGETS_ATHENA
724 xaw_create_button (widget_instance *instance)
729 widget_value* val = instance->info->val;
731 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
732 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
733 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
734 /* The highlight doesn't appear to be dynamically set which makes it
735 look ugly. I think this may be a LessTif bug but for now we just
737 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
739 /* add any args the user supplied for creation time */
740 lw_add_value_args_to_args (val, al, &ac);
743 button = XtCreateManagedWidget (val->name, labelWidgetClass,
744 instance->parent, al, ac);
748 if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
750 XtSetArg (al [ac], XtNstate, val->selected); ac++;
751 button = XtCreateManagedWidget
753 val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
754 instance->parent, al, ac);
758 button = XtCreateManagedWidget (val->name, commandWidgetClass,
759 instance->parent, al, ac);
761 XtRemoveAllCallbacks (button, XtNcallback);
762 XtAddCallback (button, XtNcallback, xaw_generic_callback, (XtPointer)instance);
765 XtManageChild (button);
771 xaw_create_label_field (widget_instance *instance)
773 return xaw_create_label (instance->parent, instance->info->val);
777 xaw_create_label (Widget parent, widget_value* val)
783 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
784 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
785 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
787 /* add any args the user supplied for creation time */
788 lw_add_value_args_to_args (val, al, &ac);
790 label = XtCreateManagedWidget (val->name, labelWidgetClass,
793 /* Do it again for arguments that have no effect until the widget is realized. */
795 lw_add_value_args_to_args (val, al, &ac);
797 abort (); /* #### need assert macro in lwlib */
798 XtSetValues (label, al, ac);
804 xaw_create_progress (widget_instance *instance)
809 widget_value* val = instance->info->val;
810 #if 0 /* This looks too awful, although more correct. */
813 XtSetArg (al [ac], XtNsensitive, False); ac++;
817 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
820 XtSetArg (al [ac], XtNsensitive, True); ac++;
823 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
824 XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
825 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
826 XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++;
828 /* add any args the user supplied for creation time */
829 lw_add_value_args_to_args (val, al, &ac);
831 scale = XtCreateManagedWidget (val->name, gaugeWidgetClass,
832 instance->parent, al, ac);
833 /* add the callback */
835 XtAddCallback (scale, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
837 XtManageChild (scale);
842 #if defined(LWLIB_WIDGETS_ATHENA)
843 #define TEXT_BUFFER_SIZE 128
845 xaw_create_text_field (widget_instance *instance)
850 widget_value* val = instance->info->val;
852 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
853 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
854 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
855 XtSetArg (al [ac], XtNtype, XawAsciiString); ac++;
856 XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++;
857 XtSetArg (al [ac], XtNuseStringInPlace, False); ac++;
859 XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
863 XtSetArg (al [ac], XtNstring, val->value); ac++;
866 /* add any args the user supplied for creation time */
867 lw_add_value_args_to_args (val, al, &ac);
869 text = XtCreateManagedWidget (val->name, asciiTextWidgetClass,
870 instance->parent, al, ac);
872 /* add the callback */
874 XtAddCallback (text, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
876 XtManageChild (text);
882 #endif /* LWLIB_WIDGETS_ATHENA */
884 const widget_creation_entry
885 xaw_creation_table [] =
887 #ifdef LWLIB_SCROLLBARS_ATHENA
888 {"vertical-scrollbar", xaw_create_vertical_scrollbar },
889 {"horizontal-scrollbar", xaw_create_horizontal_scrollbar },
891 #ifdef LWLIB_WIDGETS_ATHENA
892 {"button", xaw_create_button },
893 { "label", xaw_create_label_field },
894 {"text-field", xaw_create_text_field },
895 {"progress", xaw_create_progress },