X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lwlib%2Flwlib-Xm.c;h=254691dc6a496b575a67578fa281eac2049f48f4;hb=bd37f8f1fecf42847e5a6e9a895ea2d0ffa21455;hp=48bb2de5b98863e4ee25da2ca5475943329f67fa;hpb=0d13da69401238f67cf3b2ffddfc575446da1b59;p=chise%2Fxemacs-chise.git diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 48bb2de..254691d 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -60,9 +60,11 @@ Boston, MA 02111-1307, USA. */ #include #include #include +#ifdef LWLIB_WIDGETS_MOTIF #include #if XmVERSION > 1 -#include +#include +#endif #endif #ifdef LWLIB_MENUBARS_MOTIF @@ -72,7 +74,9 @@ static void xm_internal_update_other_instances (Widget, XtPointer, XtPointer); static void xm_pop_down_callback (Widget, XtPointer, XtPointer); static void xm_generic_callback (Widget, XtPointer, XtPointer); -#ifdef LWLIB_DIALOGS_MOTIF +static void mark_dead_instance_destroyed (Widget widget, XtPointer closure, + XtPointer call_data); +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) static void xm_nosel_callback (Widget, XtPointer, XtPointer); #endif #ifdef LWLIB_SCROLLBARS_MOTIF @@ -171,35 +175,6 @@ resource_string (Widget widget, char *name) return result; } -#ifdef LWLIB_MENUBARS_MOTIF - -static void -destroy_all_children (Widget widget) -{ - Widget* children; - unsigned int number; - int i; - - children = XtCompositeChildren (widget, &number); - if (children) - { - /* Unmanage all children and destroy them. They will only be - * really destroyed when we get out of DispatchEvent. */ - for (i = 0; i < number; i++) - { - Widget child = children [i]; - if (!child->core.being_destroyed) - { - XtUnmanageChild (child); - XtDestroyWidget (child); - } - } - XtFree ((char *) children); - } -} - -#endif /* LWLIB_MENUBARS_MOTIF */ - #ifdef LWLIB_DIALOGS_MOTIF @@ -221,7 +196,7 @@ is_in_dialog_box (Widget w) #endif /* LWLIB_DIALOGS_MOTIF */ -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) /* update the label of anything subclass of a label */ static void @@ -233,9 +208,21 @@ xm_update_label (widget_instance* instance, Widget widget, widget_value* val) XmString name_string = NULL; Arg al [20]; int ac = 0; + int type; + + /* Don't clobber pixmap types. */ + XtSetArg (al [0], XmNlabelType, &type); + XtGetValues (widget, al, 1); + + if (type == XmPIXMAP) + return; if (val->value) { + /* #### Temporary fix. I though Motif was supposed to grok %_ + type things. */ + lw_remove_accelerator_spec (val->value); + #ifdef LWLIB_DIALOGS_MOTIF /* * Sigh. The main text of a label is the name field for menubar @@ -262,24 +249,30 @@ xm_update_label (widget_instance* instance, Widget widget, widget_value* val) char *res_name = NULL; res_name = resource_string (widget, val->name); + /* Concatenating the value with itself seems just plain daft. */ if (!res_name) - res_name = val->name; - - name_string = - XmStringCreateLtoR (res_name, XmSTRING_DEFAULT_CHARSET); + { + built_string = + XmStringCreateLtoR (val->value, XmSTRING_DEFAULT_CHARSET); + } + else + { + name_string = + XmStringCreateLtoR (res_name, XmSTRING_DEFAULT_CHARSET); - value_name = XtMalloc (strlen (val->value) + 2); - *value_name = 0; - strcat (value_name, " "); - strcat (value_name, val->value); + value_name = XtMalloc (strlen (val->value) + 2); + *value_name = 0; + strcat (value_name, " "); + strcat (value_name, val->value); - val_string = - XmStringCreateLtoR (value_name, XmSTRING_DEFAULT_CHARSET); + val_string = + XmStringCreateLtoR (value_name, XmSTRING_DEFAULT_CHARSET); - built_string = - XmStringConcat (name_string, val_string); + built_string = + XmStringConcat (name_string, val_string); - XtFree (value_name); + XtFree (value_name); + } } XtSetArg (al [ac], XmNlabelString, built_string); ac++; @@ -303,6 +296,17 @@ xm_update_label (widget_instance* instance, Widget widget, widget_value* val) if (name_string) XmStringFree (name_string); + + if (val_string) + XmStringFree (val_string); +} + +static void +xm_safe_update_label (widget_instance* instance, Widget widget, widget_value* val) +{ + /* Don't clobber non-labels. */ + if (XtIsSubclass (widget, xmLabelWidgetClass)) + xm_update_label (instance, widget, val); } #endif /* defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) */ @@ -340,6 +344,38 @@ xm_update_pushbutton (widget_instance* instance, Widget widget, XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); } +#ifdef LWLIB_WIDGETS_MOTIF +static void +xm_update_progress (widget_instance* instance, Widget scale, + widget_value* val) +{ + Arg al[20]; + int ac = 0; + Dimension height = 0; + Dimension width = 0; + if (!val->call_data) + { + XtSetArg (al [ac], XmNeditable, False); ac++; + } + else + { + XtSetArg (al [ac], XmNeditable, val->enabled); ac++; + } + height = (Dimension)lw_get_value_arg (val, XtNheight); + width = (Dimension)lw_get_value_arg (val, XtNwidth); + if (height > 0) + { + XtSetArg (al [ac], XmNscaleHeight, height); ac++; + } + if (width > 0) + { + XtSetArg (al [ac], XmNscaleWidth, width); ac++; + } + + XtSetValues (scale, al, 1); +} +#endif /* LWLIB_WIDGETS_MOTIF */ + #ifdef LWLIB_MENUBARS_MOTIF static void @@ -380,7 +416,7 @@ xm_update_toggle (widget_instance* instance, Widget widget, widget_value* val) instance); XtSetArg (al [0], XmNset, val->selected); XtSetArg (al [1], XmNalignment, XmALIGNMENT_BEGINNING); - XtSetValues (widget, al, 2); + XtSetValues (widget, al, 1); } static void @@ -425,6 +461,29 @@ xm_update_radiobox (widget_instance* instance, Widget widget, } } +#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 +/* update of combo box */ +static void +xm_update_combo_box (widget_instance* instance, Widget widget, widget_value* val) +{ + widget_value* cur; + int i; + XtRemoveAllCallbacks (widget, XmNselectionCallback); + XtAddCallback (widget, XmNselectionCallback, xm_generic_callback, + instance); + for (cur = val->contents, i = 0; cur; cur = cur->next) + if (cur->value) + { + XmString xmstr = XmStringCreate (cur->value, XmSTRING_DEFAULT_CHARSET); + i += 1; + XmListAddItem (CB_List (widget), xmstr, 0); + if (cur->selected) + XmListSelectPos (CB_List (widget), i, False); + XmStringFree (xmstr); + } +} +#endif + #ifdef LWLIB_MENUBARS_MOTIF /* update a popup menu, pulldown menu or a menubar */ @@ -491,7 +550,7 @@ make_menu_in_widget (widget_instance* instance, Widget widget, XtSetArg (al [ac], XmNsubMenuId, menu); ac++; button = XmCreateCascadeButton (widget, cur->name, al, ac); - xm_update_label (instance, button, cur); + xm_safe_update_label (instance, button, cur); XtAddCallback (button, XmNcascadingCallback, xm_pull_down_callback, (XtPointer)instance); @@ -512,7 +571,7 @@ make_menu_in_widget (widget_instance* instance, Widget widget, else button = XmCreatePushButtonGadget (widget, cur->name, al, ac); - xm_update_label (instance, button, cur); + xm_safe_update_label (instance, button, cur); /* don't add a callback to a simple label */ if (cur->type == TOGGLE_TYPE || cur->type == RADIO_TYPE) @@ -566,7 +625,8 @@ update_one_menu_entry (widget_instance* instance, Widget widget, /* update the menu button as a label. */ if (val->change >= VISIBLE_CHANGE) { - xm_update_label (instance, widget, val); + xm_safe_update_label (instance, widget, val); + if (XtClass (widget) == xmToggleButtonWidgetClass || XtClass (widget) == xmToggleButtonGadgetClass) { @@ -665,7 +725,7 @@ xm_update_menu (widget_instance* instance, Widget widget, widget_value* val, static void xm_update_text (widget_instance* instance, Widget widget, widget_value* val) { - XmTextSetString (widget, val->value ? val->value : ""); + XmTextSetString (widget, val->value ? val->value : (char *) ""); XtRemoveAllCallbacks (widget, XmNactivateCallback); XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); @@ -677,7 +737,7 @@ static void xm_update_text_field (widget_instance* instance, Widget widget, widget_value* val) { - XmTextFieldSetString (widget, val->value ? val->value : ""); + XmTextFieldSetString (widget, val->value ? val->value : (char *) ""); XtRemoveAllCallbacks (widget, XmNactivateCallback); XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); @@ -767,22 +827,21 @@ xm_update_one_widget (widget_instance* instance, Widget widget, widget_value* val, Boolean deep_p) { WidgetClass class; - Arg al [2]; + Arg al [20]; + int ac = 0; /* Mark as not edited */ val->edited = False; /* Common to all widget types */ - XtSetArg (al [0], XmNsensitive, val->enabled); - XtSetArg (al [1], XmNuserData, val->call_data); - XtSetValues (widget, al, 2); + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNuserData, val->call_data); ac++; + XtSetValues (widget, al, ac); -#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) /* Common to all label like widgets */ - if (XtIsSubclass (widget, xmLabelWidgetClass)) - xm_update_label (instance, widget, val); -#endif /* defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) */ - + xm_safe_update_label (instance, widget, val); +#endif class = XtClass (widget); /* Class specific things */ if (class == xmPushButtonWidgetClass || @@ -827,12 +886,27 @@ xm_update_one_widget (widget_instance* instance, Widget widget, { xm_update_list (instance, widget, val); } +#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 + else if (class == xmComboBoxWidgetClass) + { + xm_update_combo_box (instance, widget, val); + } +#endif #ifdef LWLIB_SCROLLBARS_MOTIF else if (class == xmScrollBarWidgetClass) { xm_update_scrollbar (instance, widget, val); } #endif +#ifdef LWLIB_WIDGETS_MOTIF + else if (class == xmScaleWidgetClass) + { + xm_update_progress (instance, widget, val); + } +#endif + /* Lastly update our global arg values. */ + if (val->args && val->args->nargs) + XtSetValues (widget, val->args->args, val->args->nargs); } /* getting the value back */ @@ -861,14 +935,14 @@ xm_update_one_value (widget_instance* instance, Widget widget, else if (class == xmTextWidgetClass) { if (val->value) - free (val->value); + XtFree (val->value); val->value = XmTextGetString (widget); val->edited = True; } else if (class == xmTextFieldWidgetClass) { if (val->value) - free (val->value); + XtFree (val->value); val->value = XmTextFieldGetString (widget); val->edited = True; } @@ -884,7 +958,7 @@ xm_update_one_value (widget_instance* instance, Widget widget, if (radiobox) { CompositeWidget radio = (CompositeWidget)widget; - int i; + unsigned int i; for (i = 0; i < radio->composite.num_children; i++) { int set = False; @@ -903,11 +977,20 @@ xm_update_one_value (widget_instance* instance, Widget widget, val->edited = True; } } - else if (class == xmListWidgetClass) + else if (class == xmListWidgetClass +#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 + || class == xmComboBoxWidgetClass +#endif + ) { int pos_cnt; int* pos_list; - if (XmListGetSelectedPos (widget, &pos_list, &pos_cnt)) + Widget list = widget; +#if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1 + if (class == xmComboBoxWidgetClass) + list = CB_List (widget); +#endif + if (XmListGetSelectedPos (list, &pos_list, &pos_cnt)) { int i; widget_value* cur; @@ -1006,7 +1089,7 @@ static char disable_dnd_trans[] = ": "; static Widget make_dialog (char* name, Widget parent, Boolean pop_up_p, - CONST char* shell_title, CONST char* icon_name, + const char* shell_title, const char* icon_name, Boolean text_input_slot, Boolean radio_box, Boolean list, int left_buttons, int right_buttons) { @@ -1107,7 +1190,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, n_children++; } - /* invisible seperator button */ + /* invisible separator button */ ac = 0; XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++; children [n_children] = XmCreateLabel (row, "separator_button", @@ -1223,10 +1306,11 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, XtSetArg(al[ac], XmNrightOffset, 13); ac++; value = XmCreateScrolledList (form, "list", al, ac); - /* this is the easiest way I found to have the dble click in the + /* this is the easiest way I found to have the double click in the list activate the default button */ XtAddCallback (value, XmNdefaultActionCallback, activate_button, button); } + /* else add nothing; it's a separator */ ac = 0; XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; @@ -1264,11 +1348,12 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, XtInstallAccelerators (value, button); XmProcessTraversal(value, XmTRAVERSE_CURRENT); } - else + else if (radio_box) { XtInstallAccelerators (form, button); XmProcessTraversal(value, XmTRAVERSE_CURRENT); } + /* else we don' need no STEENKIN' assellerators. */ #ifdef DND_KLUDGE XtFree ((char *) dnd_override); @@ -1316,14 +1401,6 @@ find_matching_instance (widget_instance* instance) } static void -mark_dead_instance_destroyed (Widget widget, XtPointer closure, - XtPointer call_data) -{ - destroyed_instance* instance = (destroyed_instance*)closure; - instance->widget = NULL; -} - -static void recenter_widget (Widget widget) { Widget parent = XtParent (widget); @@ -1414,8 +1491,8 @@ xm_create_dialog (widget_instance* instance) Widget parent = instance->parent; Widget widget; Boolean pop_up_p = instance->pop_up_p; - CONST char* shell_name = 0; - CONST char* icon_name = 0; + const char* shell_name = 0; + const char* icon_name = 0; Boolean text_input_slot = False; Boolean radio_box = False; Boolean list = False; @@ -1566,9 +1643,10 @@ make_horizontal_scrollbar (widget_instance *instance) #endif /* LWLIB_SCROLLBARS_MOTIF */ +#ifdef LWLIB_WIDGETS_MOTIF /* glyph widgets */ static Widget -make_button (widget_instance *instance) +xm_create_button (widget_instance *instance) { Arg al[20]; int ac = 0; @@ -1615,14 +1693,22 @@ make_button (widget_instance *instance) } static Widget -make_progress (widget_instance *instance) +xm_create_progress (widget_instance *instance) { Arg al[20]; int ac = 0; + Dimension height = 0; + Dimension width = 0; Widget scale = 0; widget_value* val = instance->info->val; - - XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + if (!val->call_data) + { + XtSetArg (al [ac], XmNeditable, False); ac++; + } + else + { + XtSetArg (al [ac], XmNeditable, val->enabled); ac++; + } XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; @@ -1631,8 +1717,17 @@ make_progress (widget_instance *instance) look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; - if (!val->call_data) - XtSetArg (al [ac], XmNsensitive, False); ac++; + + height = (Dimension)lw_get_value_arg (val, XtNheight); + width = (Dimension)lw_get_value_arg (val, XtNwidth); + if (height > 0) + { + XtSetArg (al [ac], XmNscaleHeight, height); ac++; + } + if (width > 0) + { + XtSetArg (al [ac], XmNscaleWidth, width); ac++; + } /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -1648,14 +1743,14 @@ make_progress (widget_instance *instance) } static Widget -make_text_field (widget_instance *instance) +xm_create_text_field (widget_instance *instance) { Arg al[20]; int ac = 0; Widget text = 0; widget_value* val = instance->info->val; - XtSetArg (al [ac], XmNsensitive, val->enabled && val->call_data); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; @@ -1677,9 +1772,45 @@ make_text_field (widget_instance *instance) return text; } +static Widget +xm_create_label_field (widget_instance *instance) +{ + return xm_create_label (instance->parent, instance->info->val); +} + +Widget +xm_create_label (Widget parent, widget_value* val) +{ + Arg al[20]; + int ac = 0; + Widget label = 0; + + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; + /* The highlight doesn't appear to be dynamically set which makes it + look ugly. I think this may be a LessTif bug but for now we just + get rid of it. */ + XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; + + /* add any args the user supplied for creation time */ + lw_add_value_args_to_args (val, al, &ac); + + label = XmCreateLabel (parent, val->name, al, ac); + + XtManageChild (label); + + /* Do it again for arguments that have no effect until the widget is realized. */ + ac = 0; + lw_add_value_args_to_args (val, al, &ac); + XtSetValues (label, al, ac); + + return label; +} + #if XmVERSION > 1 static Widget -make_combo_box (widget_instance *instance) +xm_create_combo_box (widget_instance *instance) { Arg al[20]; int ac = 0; @@ -1698,7 +1829,7 @@ make_combo_box (widget_instance *instance) /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); - combo = XmCreateComboBox (instance->parent, val->name, al, ac); + combo = XmCreateDropDownComboBox (instance->parent, val->name, al, ac); if (val->call_data) XtAddCallback (combo, XmNselectionCallback, xm_generic_callback, (XtPointer)instance); @@ -1708,11 +1839,12 @@ make_combo_box (widget_instance *instance) return combo; } #endif +#endif /* LWLIB_WIDGETS_MOTIF */ /* Table of functions to create widgets */ -widget_creation_entry +const widget_creation_entry xm_creation_table [] = { #ifdef LWLIB_MENUBARS_MOTIF @@ -1723,11 +1855,14 @@ xm_creation_table [] = {"vertical-scrollbar", make_vertical_scrollbar}, {"horizontal-scrollbar", make_horizontal_scrollbar}, #endif - {"button", make_button}, - {"progress", make_progress}, - {"text-field", make_text_field}, +#ifdef LWLIB_WIDGETS_MOTIF + {"button", xm_create_button}, + {"progress", xm_create_progress}, + {"text-field", xm_create_text_field}, + {"label", xm_create_label_field}, #if XmVERSION > 1 - {"combo-box", make_combo_box}, + {"combo-box", xm_create_combo_box}, +#endif #endif {NULL, NULL} }; @@ -1736,7 +1871,7 @@ xm_creation_table [] = void xm_destroy_instance (widget_instance* instance) { -#ifdef LWLIB_DIALOGS_MOTIF +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) /* It appears that this is used only for dialog boxes. */ Widget widget = instance->widget; /* recycle the dialog boxes */ @@ -1767,7 +1902,7 @@ xm_destroy_instance (widget_instance* instance) XtDestroyWidget (instance->widget); } -#endif /* LWLIB_DIALOGS_MOTIF */ +#endif /* LWLIB_DIALOGS_MOTIF || LWLIB_WIDGETS_MOTIF */ } /* popup utility */ @@ -1920,7 +2055,7 @@ xm_internal_update_other_instances (Widget widget, XtPointer closure, static void xm_generic_callback (Widget widget, XtPointer closure, XtPointer call_data) { -#if (defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_DIALOGS_MOTIF)) +#if (defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF)) /* We want the selected status to change only when we decide it should change. Yuck but correct. */ if (XtClass (widget) == xmToggleButtonWidgetClass @@ -1946,25 +2081,6 @@ xm_pop_down_callback (Widget widget, XtPointer closure, XtPointer call_data) do_call (widget, closure, post_activate); } -#ifdef LWLIB_DIALOGS_MOTIF - -static void -xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) -{ - /* This callback is only called when a dialog box is dismissed with the wm's - destroy button (WM_DELETE_WINDOW.) We want the dialog box to be destroyed - in that case, not just unmapped, so that it releases its keyboard grabs. - But there are problems with running our callbacks while the widget is in - the process of being destroyed, so we set XmNdeleteResponse to XmUNMAP - instead of XmDESTROY and then destroy it ourself after having run the - callback. - */ - do_call (widget, closure, no_selection); - XtDestroyWidget (widget); -} - -#endif - #ifdef LWLIB_MENUBARS_MOTIF static void @@ -2073,6 +2189,31 @@ xm_scrollbar_callback (Widget widget, XtPointer closure, XtPointer call_data) } #endif /* LWLIB_SCROLLBARS_MOTIF */ +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) +static void +mark_dead_instance_destroyed (Widget widget, XtPointer closure, + XtPointer call_data) +{ + destroyed_instance* instance = (destroyed_instance*)closure; + instance->widget = NULL; +} + +static void +xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) +{ + /* This callback is only called when a dialog box is dismissed with the wm's + destroy button (WM_DELETE_WINDOW.) We want the dialog box to be destroyed + in that case, not just unmapped, so that it releases its keyboard grabs. + But there are problems with running our callbacks while the widget is in + the process of being destroyed, so we set XmNdeleteResponse to XmUNMAP + instead of XmDESTROY and then destroy it ourself after having run the + callback. + */ + do_call (widget, closure, no_selection); + XtDestroyWidget (widget); +} +#endif + /* set the keyboard focus */ void