Why do popup menus not work when running on Solaris and displaying on Linux?
|
29-Jan-02 18:00 GMT
|
Question: in an application running on Solaris, but displaying
on Linux, popup menus fail to display when the mouse is pressed.
Why is this ?
The Cause
The problem is related to the XmNwhichButton resource.
For unknown reasons,
this defaults to Button5 when displaying onto the Linux platform, whereas it
ought to be set to Button3.
The result is that the _XmMatchBtnEvent() routine, used to compare the post button
recorded in the RowColumn widget instance record with the Button found in the
incoming X event, marks the menu popup state as invalid. This prevents
the menu from posting.
The Solution
You should set the XmNwhichButton default back to Button3 in these circumstances.
Either explicitly place a resource into your X application defaults file:
*.whichButton: 3
Or pass the default by command-line argument:
myApplication -xrm "*.whichButton: 3"
There are alternatives to this: the resource could be set as a fallback
inside the application, thereby safeguarding against missing resources
or faulty command-line arguments.
Notes
I have verified the problem, and the solution, against Redhat Linux 7.1, running
from both Solaris 2.7 and 8. I have also verified the problem against Solaris 2.6,
which indicates that the issue is not Motif 2.1 specific. Displaying onto Linux 6.2
seems not to exhibit the problem. This does not mean to say that the problem
does not persist in other combinations - this remains unverified.
Looking at the OSF Motif distibutions, there is nothing in any of 1.2.4, 1.2.5,
2.1.10 or 2.1.30 to indicate that the problem lies in these sources: these strictly
apply a default of Button1 or Button3, depending on the menu type.
Since running an application under HP-UX 11.0 running Motif 2.1 and displaying
onto the Linux 7.1 does not exhibit the problem, we can deduce that the issue is
specific to Sun CDE Motif.
Sponsored
by X-Designer - The Leading X/Motif GUI Builder
- Click to download a FREE evaluation
Goto top of page
|