What does mouse button 2 on a cascade menu button do? - Motif

This is a discussion on What does mouse button 2 on a cascade menu button do? - Motif ; I built a standard pulldown menu (with XmCreatePulldownMenu), with several cascade menu buttons (xmCascadeButtonWidgetClass) for my application. When I run this application under Solaris 2.8 (or 2.9) and click Mouse Button 2 on one of the menu buttons, I get ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: What does mouse button 2 on a cascade menu button do?

  1. What does mouse button 2 on a cascade menu button do?

    I built a standard pulldown menu (with XmCreatePulldownMenu), with
    several cascade menu buttons (xmCascadeButtonWidgetClass) for my
    application. When I run this application under Solaris 2.8 (or 2.9)
    and click Mouse Button 2 on one of the menu buttons, I get a bizarre
    little page icon that I can drag all over the screen! When I release
    Mouse Button 2, this little icon runs back to the button from which it
    came.

    What is the purpose of this behavior, and how can I disable it?

    The reason I ask is that when I specify in XtVaAppInitialize that I
    want my application to use a TrueColor visual, and then click Mouse
    Button 2 on a cascade menu button, I get an X protocol error (BadMatch
    - invalid parameter attributes) upon X_CreateWindow. Apparently the
    little page icon is still using the default visual, an apparent
    violation of the X protocol.

    Any insights would be appreciated.

  2. Re: What does mouse button 2 on a cascade menu button do?

    Herbert Swan wrote:

    > I built a standard pulldown menu (with XmCreatePulldownMenu), with
    > several cascade menu buttons (xmCascadeButtonWidgetClass) for my
    > application. When I run this application under Solaris 2.8 (or 2.9)
    > and click Mouse Button 2 on one of the menu buttons, I get a bizarre
    > little page icon that I can drag all over the screen! When I release
    > Mouse Button 2, this little icon runs back to the button from which it
    > came.
    >
    > What is the purpose of this behavior, and how can I disable it?


    It's called "drag and drop", my friend.

    Labels and their descendandts (such as CascadeButtons) are by default set up
    as drag initiators. Try the following:

    Open a dtterm window.
    Press button 2 over, say, the "Window" menu CascadeButton.
    Now drag and drop the pointer to the terminal area.

    You should get the text "Window" plus maybe some additional garbage displayed
    in the terminal.

    > The reason I ask is that when I specify in XtVaAppInitialize that I
    > want my application to use a TrueColor visual, and then click Mouse
    > Button 2 on a cascade menu button, I get an X protocol error (BadMatch
    > - invalid parameter attributes) upon X_CreateWindow. Apparently the
    > little page icon is still using the default visual, an apparent
    > violation of the X protocol.


    I've had similar experiences when creating windows on non-default screens on a
    multi-screen X server.

    If you have no intention of using drag and drop in your application, you can
    just put the following in your app-defaults file or fallback resources:

    *dragInitiatorProtocolStyle: XmDRAG_NONE
    *dragReceiverProtocolStyle: XmDRAG_NONE

    Alternatively, you can disable only initiator behaviour, allowing users to
    drop e.g. text from other applications into suitable receiver widgets in your
    application.

    --
    Per Espen Hagen, Principal Scientist
    Norwegian Defence Research Establishment

    http://www.ffi.no/hugin/

  3. Re: What does mouse button 2 on a cascade menu button do?

    Per Espen Hagen wrote in message news:<402C99F6.B9FBB80F@ffi.no>...
    > Herbert Swan wrote:
    >
    > > I built a standard pulldown menu (with XmCreatePulldownMenu), with
    > > several cascade menu buttons (xmCascadeButtonWidgetClass) for my
    > > application. When I run this application under Solaris 2.8 (or 2.9)
    > > and click Mouse Button 2 on one of the menu buttons, I get a bizarre
    > > little page icon that I can drag all over the screen! When I release
    > > Mouse Button 2, this little icon runs back to the button from which it
    > > came.
    > >
    > > What is the purpose of this behavior, and how can I disable it?

    >
    > It's called "drag and drop", my friend.
    >
    > Labels and their descendandts (such as CascadeButtons) are by default set up
    > as drag initiators. Try the following:
    >
    > Open a dtterm window.
    > Press button 2 over, say, the "Window" menu CascadeButton.
    > Now drag and drop the pointer to the terminal area.
    >
    > You should get the text "Window" plus maybe some additional garbage displayed
    > in the terminal.
    >
    > > The reason I ask is that when I specify in XtVaAppInitialize that I
    > > want my application to use a TrueColor visual, and then click Mouse
    > > Button 2 on a cascade menu button, I get an X protocol error (BadMatch
    > > - invalid parameter attributes) upon X_CreateWindow. Apparently the
    > > little page icon is still using the default visual, an apparent
    > > violation of the X protocol.

    >
    > I've had similar experiences when creating windows on non-default screens on a
    > multi-screen X server.
    >
    > If you have no intention of using drag and drop in your application, you can
    > just put the following in your app-defaults file or fallback resources:
    >
    > *dragInitiatorProtocolStyle: XmDRAG_NONE
    > *dragReceiverProtocolStyle: XmDRAG_NONE
    >
    > Alternatively, you can disable only initiator behaviour, allowing users to
    > drop e.g. text from other applications into suitable receiver widgets in your
    > application.



    You are a genius, my friend. Thanks for your help - it did the trick!

+ Reply to Thread