[comp.windows.x] Button selection

jstravis@athena.mit.edu (John S. Travis) (09/26/89)

	How can one start a program with some buttons initially
invoked. I have  a series of buttons (options A-F), and when
i run the program i want option A to be in effect at the beginning.
It's easy to set A as the option, but how do i start with the button for
option A highlighted, as if it had been selected? Using the Resource
file or selecting it soemhow in the program?

John Travis

meo@stiatl.UUCP (Miles O'Neal) (09/26/89)

In article <14630@bloom-beacon.MIT.EDU> jstravis@athena.mit.edu (John S. Travis) writes:
|
|	How can one start a program with some buttons initially
|invoked. I have  a series of buttons (options A-F), and when
|i run the program i want option A to be in effect at the beginning.
|It's easy to set A as the option, but how do i start with the button for
|option A highlighted, as if it had been selected? Using the Resource
|file or selecting it soemhow in the program?

Probably the easiest way ois to send it the event sequence it would
receive if it were actually pressed. Use XSendEvent from the X11 intrinsics
(NOTE: not the Xt intrinsics). Here is the declaration:

Status
XSendEvent(dpy, w, propagate, event_mask, event)
    register Display *dpy;
    Window w;
    Bool propagate;
    long event_mask;
    XEvent *event;
{

As an example, check out Xt/Selection.c .

-Miles O'Neal
{yr fave backbone here}!gatech!stiatl!meo

eag@silvlis.COM (Eric Geyer) (09/28/89)

h

q