Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!mcnc!rti!sas!sherman From: sherman@sas.UUCP (Chris Sherman) Newsgroups: comp.windows.x Subject: Highlighting under Motif widgets Summary: Toggle button highlighting has a problem Message-ID: <1607@sas.UUCP> Date: 13 Mar 90 05:59:36 GMT Reply-To: sherman@sas.UUCP (Chris Sherman) Organization: SAS Institute Inc, Cary NC Lines: 67 I'm using motif widgets and I have a problem with the toggle button widget. I use highlighting to show when the pointer enters the widget, and it works for every widget (that I have checked) except for the toggle button widget. Below, I have sample code that demonstrates the problem. You can compile it with something that looks like the following: cc -o test test.c -lXm -lXt -lX11 Am I doing something wrong? Do toggle buttons have a different behavior than push buttons with relation to highlighting? Is this a bug? Thanx, Chris Cut here: ---------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include main(argc,argv) int argc; char **argv; { Widget toplevel, layout, button1, button2; static char * buttonNames[] = {"push", "toggle"}; Arg wargs[10]; int n; XtInitialize(argv[0], "Test", NULL, 0, &argc, argv); /* use the shell widget so I can define keyboard focus policy */ n = 0; XtSetArg(wargs[n], XmNkeyboardFocusPolicy, XmPOINTER); n++; toplevel = XtCreateApplicationShell("toplevel", applicationShellWidgetClass, wargs, n); layout = XtCreateManagedWidget("layout",xmRowColumnWidgetClass, toplevel, wargs, n); /* setup for highlights */ n = 0; XtSetArg(wargs[n], XmNhighlightOnEnter, True); n++; XtSetArg(wargs[n], XmNhighlightThickness, (short) 5); n++; XtSetArg(wargs[n], XmNindicatorOn, False); n++; XtSetArg(wargs[n], XmNshadowThickness, 2); n++; XtSetArg(wargs[n], XmNtraversalOn, True); n++; button1 = XtCreateManagedWidget(buttonNames[0], xmPushButtonWidgetClass, layout, wargs, n); button2 = XtCreateManagedWidget(buttonNames[1], xmToggleButtonWidgetClass, layout, wargs, n); XtRealizeWidget(toplevel); XtMainLoop(); }