Re: Motif Style Gui
- Subject: Re: Motif Style Gui
- From: johnm-at-slmd.com
- Date: Fri, 24 Mar 2000 12:37:34 -0800
- Content-type: text/plain; charset=us-ascii
Terry,
In X-Windows, we process events and can intercept any single one.
Normally, one simply calls
XtAppMainLoop(app); // The main loop that processes events
but if you'd like to intercept the events, one can call as an example:
while(True) {
XEvent e;
XtAppNextEvent(app, &e);
switch(e.type)
{
case KeyPress:
if (e.xkey.keycode == 23) { /* tab key */ }
if (e.xkey.status ==128) { /* shift key */ }
break;
case KeyRelease:
if (e.xkey.keycode == 23) { /* tab key */ }
if (e.xkey.status ==128) { /* shift key */ }
break;
}
XtDispatch(&e);
}
An easy example is to run "xev" and it dumps all the events for a given
window.
Fred,
Yes, Lesstif is a free software that mimics the Motif calls exactly (use
the same API).
The whole purpose of Lesstif is to circumvent the royalty fees that are
associated with
Motif.
Of course, if you have Motif or want it, you can use it instead and the
code doesn't change.
Mostly it's a matter of re-linking.
John
"Terry Crook" <terry-at-cqg.com>-at-nist.gov on 03/24/2000 12:04:54 PM
Voice Mail #:
Please respond to emc-at-nist.gov
Sent by: emc-at-nist.gov
To: Multiple recipients of list <emc-at-nist.gov>
cc:
Subject: Re: Motif Style Gui
Hi,
I'm currently programming in windows, so I don't know how pertinent
this is, but can you handle key-up and key-down events rather than
keystrokes?
++
Terry
-----Original Message-----
From: Fred Proctor <proctor-at-cme.nist.gov>
To: Multiple recipients of list <emc-at-nist.gov>
Date: Friday, March 24, 2000 11:47 AM
Subject: Re: Motif Style Gui
>
>John Moore provided a true GUI expert's critique of the EMC GUIs and
>suggested improvements. They all sound good to me. I don't think there
>will be many complaints about changing operating instructions since the
>improvements all make it more intuitive to use. I say go ahead.
>
>Regarding Motif, my brief look into X programming told me you have to
>pay for the Motif development libraries, but lesstif is free. John, you
>probably know more about this than I do. True? I was trying to avoid
>requiring that people pay anything for software development if they
>wanted to recompile from scratch.
>
>My experience in building GUIs is that using the keyboard for jogging is
>a real pain, due to the keyboard repeat. If you look at xemc.cc, or
>tkemc.tcl, you can see the horrible things I had to do to debounce
>keyboard repeats. Key repeats can be disables globally (xset -r), but
>then you lose arrow-key-rapid-movement through editors. Is there a good
>way to do this?
>
>--Fred
Date Index |
Thread Index |
Back to archive index |
Back to Mailing List Page
Problems or questions? Contact