Subject: motif 'options menu' problem in FVWM

From: [email-masked]
Date: Fri, 24 Dec 1999 06:57:56 -0600 (CST)

Full_Name: A.Nixon
Version: 1.24r, 2.2.2, 2.2.4
CVS_Date: 
OS: Redhat Linux 4.2
X_Server: XFree86's XF86_SVGA
Submission from: (NULL) (202.54.64.15)

   When ClickToFocus is the focus setting, we created options menu using
Motif 2.1 libraries. When we select the options menu for the first time the
focus behaviour becomes "focusfollowsmouse" and when we operate on the
option menu the second time the window completely loses focus. The window
or any text control in it does not get focus when we click on it. The
clickToFocus behaviour is restored only when we click on the title bar.
    NOTE: This behaviour is not present in twm and mwm. Also,it is not 
there if the focus "follows mouse" option in .fvwmrc is enabled. 

I am enclosing an example program herewith. 

-----

#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <Xm/MainW.h>
#include <Xm/Form.h>
#include <Xm/PushB.h>
#include <Xm/Label.h>
#include <Xm/BulletinB.h>
#include <Xm/Text.h>
#include <Xm/RowColumn.h>
#include <stdio.h>
#include <linux/unistd.h>

Widget topShell, top, aForm, portWid, pullDown, tmpWid;

static void SelectComPort(Widget w, XtPointer clientdata, XtPointer
calldata)
{
   printf("SelectComPort: U selected option %d\n", (int) clientdata);
}

void MyScreen()
{
   XmString str1, str2, str3, str4;

   aForm = XtVaCreateManagedWidget("TopForm",
                  //xmFormWidgetClass, top,
                  xmRowColumnWidgetClass, top,
                  XmNheight, 200,
                  XmNwidth, 400,
                  NULL);

   XmMainWindowSetAreas(top, NULL, NULL, NULL, NULL, aForm);

   str1 = XmStringCreateLocalized("Com Port:     ");
   str2 = XmStringCreateLocalized("Com 1 ");
   str3 = XmStringCreateLocalized("Com 2 ");

   portWid = XmVaCreateSimpleOptionMenu(aForm, "Com Port Option Menu",
		str1, NULL, 0, SelectComPort,
                XmVaPUSHBUTTON, str2, '1', NULL, NULL,
                XmVaPUSHBUTTON, str3, '2', NULL, NULL,
                NULL);
   XtManageChild(portWid);

   XmStringFree(str1);
   XmStringFree(str2);
   XmStringFree(str3);

} //End of MyScreen().

int main(int argc, char **argv)
{
        XtAppContext app;

	topShell = XtVaAppInitialize(&app, "test", NULL, 0, (Cardinal *)&argc,
argv, NULL,
			XmNx, 312, XmNy, 284, XmNheight, 200, XmNwidth, 400, XmNtitle, "Option
Test", NULL);
	top = XtVaCreateManagedWidget("MainWin", xmMainWindowWidgetClass,
topShell, NULL);

	MyScreen();

	XtRealizeWidget(topShell);
        XtAppMainLoop(app);
        return(0);
}

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]