Home Home Company Information Email Japanese

XRT/gear FAQ

Tabbed Dialogs

How do I change the size of the tab button?

In addition to setting XmNheight and XmNwidth, you must also set XmNrecomputeSize to False. This behavior is inherited from the XmLabel widget.

Enhanced Toggle Button

Why am I having trouble using enhanced toggle buttons in a radio box?

Enhanced toggle buttons don't work in a radio box. However, it's not too hard to simulate a radio box.

How do I get the state of the toggle button?

Use XrtGearToggleButtonGetState() (see p.35 of manual).

Widget Tips

How are widget tips created?

The sample code below shows how to put widget tips onto a pushbutton.

#include <Xm/Form.h>
#include <Xm/PushB.h>
#include <Xm/XrtTips.h>

static char *fallback_resources[] = {
    "*.xrtGearTipsBorderType: BORDER_ETCHED_IN",
    "*.xrtGearFontList: *-medium-r-normal--14-*:",
    NULL
};
int main(int argc, char *argv[])
{
    XtAppContext app_context;
    Widget toplevel, form, btn1, btn2;
    XtSetLanguageProc(NULL, NULL, NULL);
    toplevel = XtAppInitialize(&app_context, "tips", NULL, 0,
        &argc, argv, fallback_resources, NULL, 0);
    form = XtVaCreateManagedWidget("form",
        xmFormWidgetClass,       toplevel,
        NULL);
    btn1 = XtVaCreateManagedWidget("button1",
        xmPushButtonWidgetClass, form,
        XmNtopAttachment,        XmATTACH_FORM,
        XmNbottomAttachment,     XmATTACH_FORM,
        XmNleftAttachment,       XmATTACH_FORM,
        NULL);
    XrtGearTipsVaSetValues(btn1,
        XmNxrtGearText,          XmStringCreateLtoR("その子1", XmSTRING_DEFAULT_CHARSET),
        NULL);
    btn2 = XtVaCreateManagedWidget("button2",
        xmPushButtonWidgetClass, form,
        XmNtopAttachment,        XmATTACH_FORM,
        XmNbottomAttachment,     XmATTACH_FORM,
        XmNleftAttachment,       XmATTACH_WIDGET,
        XmNleftWidget,           btn1,
        NULL);
    XrtGearTipsVaSetValues(btn2,
        XmNxrtGearText, XmStringCreateLtoR("その子2", XmSTRING_DEFAULT_CHARSET),
        NULL);
    XrtGearTipsEnable(form, True);
    XtRealizeWidget(toplevel);
    XtAppMainLoop(app_context);
}

There are problems with the tips after adding a new child to the toplevel.

Whenever a new child is added to a toplevel shell and a tip is added to the child, the application must enable tips again on the toplevel using XrtGearTipsEnable(toplevel, True).

When would I ever use XrtGearTipsEnable(toplevel, False)?

If you are using XrtGearTipsDisplayHelp() and you don't want any tips popping up automatically, you should initialize tips with XrtGearTipsEnable(toplevel, False). Note that you must initialize tips even if you want to set them only manually.

Why can't I install widget tips on Motif gadgets?

Widget Tips is currently unsupported when used with gadgets.