Prevent double-click default action - Motif

This is a discussion on Prevent double-click default action - Motif ; I want to prevent the double-click default action in a scrolled list. I thought one way to do this would be to override the double-click key in the translations table. How do I specify the double-click key in a translation? ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Prevent double-click default action

  1. Prevent double-click default action

    I want to prevent the double-click default action in a scrolled list. I
    thought one way to do this would be to override the double-click key in the
    translations table. How do I specify the double-click key in a translation?
    This should also allow normal clicking in the list and the vertical scroll
    bar. I would welcome any alternative suggestions to prevent the
    double-click.

    I also noticed both the multiple select callback and the default action
    callback were called on a double-click. I expected one or the other. Does
    this seem right?

    BTW using Digital/Compaq UNIX.

    Thanks
    Robin



  2. Re: Prevent double-click default action



    Robin James wrote:
    >
    > I want to prevent the double-click default action in a scrolled list. I
    > thought one way to do this would be to override the double-click key in the
    > translations table. How do I specify the double-click key in a translation?
    > This should also allow normal clicking in the list and the vertical scroll
    > bar. I would welcome any alternative suggestions to prevent the
    > double-click.
    >
    > I also noticed both the multiple select callback and the default action
    > callback were called on a double-click. I expected one or the other. Does
    > this seem right?
    >
    > BTW using Digital/Compaq UNIX.
    >
    > Thanks
    > Robin


    XmList does not use translations to detect double-click. Instead, it
    keeps track of the time for a button-down event, and if another
    button-down occurs within the double click interval it invokes the
    defaultAction callback. Thus you get the two callbacks - the
    selectionCallback on the first click, and the defaultAction on the
    second if it is within the proper interval.

    To disable the default action on a double click, you have to decide what
    you want to happen: either ignore the second click, or treat it as
    another single click.

    To ignore it, just check the event that is passed in the callback struct
    pointer in the defaultAction callback. If the event is a ButtonUp, just
    return without doing anything. If the Enter key is pressed, the
    defaultAction callback will be invoked, but the event will be the Key
    event, not a Button event.

    If you want double clicks to act like two single clicks, try setting
    XmNdoubleClickInterval to zero.

    --
    Fred L. Kleinschmidt
    Associate Technical Fellow
    Boeing Common User Interface Services

+ Reply to Thread