[comp.windows.x] Calling Actions, List Widget

ems@aristotle.JPL.NASA.gov (Eric Slimko) (11/03/90)

  Is it possible to call an arbitrary action of a given widget
without sending an artificial event?  For example, based on
a return in a Text Widget, I want to be able to call the
"ListNextElement()" action of a list widget.  Is this possible?

Speaking of ListNextElement, I am having problems invoking it in
the usual way.  The Motif (1.0) Programmer's Reference lists
that action as being tied to ~Shit~Ctrl~Meta<Key>Down, but I have
not had any luck in getting that to work.  My test application
consists of only a list widget, so I don't think other translations
are overriding it.  I tried to tie ListNextElement to <Key>a, but that
didn't work either.  Any ideas?

-- 
Eric Slimko                |  Jet Propulsion Laboratories
ems@aristotle.jpl.nasa.gov |  NASA/CalTech

dbrooks@osf.org (David Brooks) (11/03/90)

In article <1990Nov2.191421.19731@elroy.jpl.nasa.gov>, ems@aristotle.JPL.NASA.gov (Eric Slimko) writes:
|> The Motif (1.0) Programmer's Reference lists
|> that action as being tied to ~Shit~Ctrl~Meta<Key>Down, but I have
				 ^^^^
|> not had any luck in getting that to work.

There's your problem.  You mustn't cuss as you press the key.

What does happen when you press the downarrow (and swear)?
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks
It was the best of times, it was the worst of times, but now it's Miller time.

bjaspan@athena.mit.edu (Barr3y Jaspan) (11/03/90)

In article <1990Nov2.191421.19731@elroy.jpl.nasa.gov>, ems@aristotle.JPL.NASA.gov (Eric Slimko) writes:
|>   Is it possible to call an arbitrary action of a given widget
|> without sending an artificial event?

Yes.  You can use XtCallActionProc(Widget w, String action, XEvent *event,
 String *params, Cardinal num_params).

--
Barr3y Jaspan, bjaspan@mit.edu

ems@aristotle.JPL.NASA.gov (Eric Slimko) (11/03/90)

In article <15757@paperboy.OSF.ORG>, dbrooks@osf.org (David Brooks) writes:
> In article <1990Nov2.191421.19731@elroy.jpl.nasa.gov>, ems@aristotle.JPL.NASA.gov (Eric Slimko) writes:
> |> The Motif (1.0) Programmer's Reference lists
> |> that action as being tied to ~Shit~Ctrl~Meta<Key>Down, but I have
> 				 ^^^^
> |> not had any luck in getting that to work.
> 
> There's your problem.  You mustn't cuss as you press the key.
  Ohhh, so that's what I was doing wrong! :-)

 
> What does happen when you press the downarrow (and swear)?
Absolutely nothing.  Doesn't even swear back.  :)

-- 
Eric Slimko                |  Jet Propulsion Laboratories
ems@aristotle.jpl.nasa.gov |  NASA/CalTech

ems@aristotle.JPL.NASA.gov (Eric Slimko) (11/03/90)

In article <1990Nov2.231256.25030@athena.mit.edu>, bjaspan@athena.mit.edu (Barr3y Jaspan) writes:

> Yes.  You can use XtCallActionProc(Widget w, String action, XEvent *event,
>  String *params, Cardinal num_params).
> 
Hmmm-- I gave this a try but came up with an undefined symbol.  Also couldn't
find any documentation for it.  I'm running Motif 1.0 with X11 R4.  Maybe
its only in the standard Xt?

-- 
Eric Slimko                |  Jet Propulsion Laboratories
ems@aristotle.jpl.nasa.gov |  NASA/CalTech

bjaspan@athena.mit.edu (Barr3y Jaspan) (11/03/90)

In article <1990Nov2.235548.1125@elroy.jpl.nasa.gov>, ems@aristotle.JPL.NASA.gov (Eric Slimko) writes:
|> > Yes.  You can use XtCallActionProc(Widget w, String action, XEvent *event,
|> >  String *params, Cardinal num_params).
|> Hmmm-- I gave this a try but came up with an undefined symbol.

XtCallActionProc() is new with the R4 version of the X Toolkit.  If Motif
doesn't have it, flame at the OSF (and stop using Motif).  :-)

Barr3y Jaspan, bjaspan@mit.edu

aw@cellar.uucp (Andrew Wason) (11/04/90)

In article <1990Nov2.191421.19731@elroy.jpl.nasa.gov> ems@socrates.jpl.nasa.gov writes:
>
>  Is it possible to call an arbitrary action of a given widget
>without sending an artificial event?  For example, based on
>a return in a Text Widget, I want to be able to call the
>"ListNextElement()" action of a list widget.  Is this possible?

You could use accelerators to make the return event in the Text
widget call the ListNextElement() action of the List widget.

However, I've found you often have to do headstands to get accelerators
to work in Motif because of all the behind the scenes stuff Motif
does for all of its keyboard traversal/menu accelerators etc.
It can be done, it's just not always straightforward.

Andrew

--------------------------------------------------------------------------------
Andrew Wason                                        Bell Communications Research
aw@cellar.bae.bellcore.com                          Piscataway, NJ
bellcore!cellar!aw
--------------------------------------------------------------------------------
Andrew Wason                                        Bell Communications Research
aw@cellar.bae.bellcore.com                          Piscataway, NJ
bellcore!cellar!aw

meo@rsiatl.UUCP (Miles ONeal) (11/04/90)

ems@aristotle.JPL.NASA.gov (Eric Slimko) writes:
>  Is it possible to call an arbitrary action of a given widget
>without sending an artificial event?  For example, based on
>a return in a Text Widget, I want to be able to call the
>"ListNextElement()" action of a list widget.  Is this possible?

Are you writing a widget or a client?

It's possible, but is it really what you want to do? Why not send
the event? And depending on what you want to do it may be very,
very ugly.

All the normal internals are available through the widgetP.h
header files. Of course, using them may void the warranty (as
it were no warranty is implied or expressed, etc) for dropin
replacements of future releases of the toolkit/widget set.

Finally, if said "arbitrary action " is a static routine, you
will have to do something about that.

Miles O'Neal
{uunet | emory}!rsiatl!meo (home)
meo@sware.com              (work)
{uunet | emory}!sware!meo  (work)

nazgul@alphalpha.com (Kee Hinckley) (11/05/90)

In article <1990Nov3.155232.8670@athena.mit.edu> bjaspan@athena.mit.edu (Barr3y Jaspan) writes:
>XtCallActionProc() is new with the R4 version of the X Toolkit.  If Motif
>doesn't have it, flame at the OSF (and stop using Motif).  :-)
I assume that the author was not using Motif 1.1, and therefore not
using R4.  Motif 1.1 doesn't come with Xt (doesn't need to).
-- 
Alphalpha Software, Inc.	|	motif-request@alphalpha.com
nazgul@alphalpha.com		|-----------------------------------
617/646-7703 (voice/fax)	|	Proline BBS: 617/641-3722

I'm not sure which upsets me more; that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

don@zardoz.coral.COM (Don Dewar) (11/05/90)

) Return-Path: <uunet!expo.lcs.mit.edu!xpert-mailer>
) Date: Sat, 3 Nov 90 15:52:32 GMT
) From: uunet!athena.mit.edu!bjaspan  (Barr3y Jaspan)
) Organization: Massachusetts Institute of Technology
) Subject: Re: Calling Actions, List Widget
) References: <1990Nov2.191421.19731@elroy.jpl.nasa.gov>, <1990Nov2.231256.25030@athena.mit.edu>, <1990Nov2.235548.1125@elroy.jpl.nasa.gov>
) Sender: uunet!expo.lcs.mit.edu!xpert-request
) To: xpert@expo.lcs.mit.edu
) 
) In article <1990Nov2.235548.1125@elroy.jpl.nasa.gov>, ems@aristotle.JPL.NASA.gov (Eric Slimko) writes:
) |> > Yes.  You can use XtCallActionProc(Widget w, String action, XEvent *event,
) |> >  String *params, Cardinal num_params).
) |> Hmmm-- I gave this a try but came up with an undefined symbol.
) 
) XtCallActionProc() is new with the R4 version of the X Toolkit.  If Motif
) doesn't have it, flame at the OSF (and stop using Motif).  :-)
) 
) Barr3y Jaspan, bjaspan@mit.edu
) 
) 


I don't quite see how you can blame OSF.  You are talking about an X
call.  We buy Motif sources and build it here.  Some organizations buy
the Motif executables with X bundled in from other companies that sell
Motif.  But, As far as I am concerned it is up to the user to make sure
their X is up to date.  Moreover, OSF/Motif has done a pretty good job
keeping up with the major and minor changes and fixes to X.  

I think your suggestion to flame OSF and stop using Motif shows an
unjustified bias against the organization and their product.  Sure, you
may disagree with philosophy or on technical points of the product,
but to make such an obscenely obtuse and short statement such as that
is dishonorable.   At least have the good taste to back such words
with logical and thoughtful commentary.


  +---------+
  | Coral   |
  |@@@@@*@**|
  |@@*@@**@@|     Don Dewar
  |*@@**@@@@|     Coral Network Corporation, Marlborough, MA
  |@***@@@@@|     Internet: don@coral.com
  |@@**@@@@@|     Phone:    (508) 460-6010
  |*********|     Fax:      (508) 481-6258
  |Networks |
  +---------+

jerry@slhisc.uucp (Jerry Liebelson) (11/05/90)

Reply-To: uunet!slcpi!slhisc!jerry
Organization: Shearson Lehman Brothers, Inc.
------------------------------------------------------------------------------
In article <1990Nov2.191421.19731@elroy.jpl.nasa.gov> ems@socrates.jpl.nasa.gov writes:
>
>  Is it possible to call an arbitrary action of a given widget
>without sending an artificial event?  For example, based on
>a return in a Text Widget, I want to be able to call the
>"ListNextElement()" action of a list widget.  Is this possible?


 If you are using X11 Rel 4, try XtCallActionProc().  I don't think it
is documented in earlier versions of O'Reilly, so check the MIT documentation.
 
--
         Jerry Liebelson                   uunet!slcpi!slhisc!jerry   
    Distributed Infrastructure             rutgers!marob!slhisc!jerry 
   Shearson Lehman Brothers, Inc.          (212) 341-3166  FAX: (212) 528-0101

ems@aristotle.JPL.NASA.gov (Eric Slimko) (11/07/90)

Just to put a sense of closure on the question of calling actions
and the List Widget:

I WAS linking Motif 1.0 with Xtm and X11 (Release 4).  XtCallActionProc
is in Xt, which I wasn't linking with.  Soon, we're going to be going
to Motif 1.1 which uses Xt.  I've tried it with 1.1, and it looks like
it will work.  Thanks to those who responded.
-- 
Eric Slimko                |  Jet Propulsion Laboratories
ems@aristotle.jpl.nasa.gov |  NASA/CalTech