[comp.windows.x] Neophyte X user questions

plummer@cs.swarthmore.edu (David Barker-Plummer) (10/19/90)

Apologies if this is a FAQ, or below the general level of discussion here.

I am using TWM and X11R4.  I want to set up a menu that allows me to
bring up an xdvi window.  However xdvi needs an argument (the dvi file to 
load) and I don't know how to build my menu so that the argument can be 
passed to xdvi.  Perhaps this is simple, perhaps its impossible?

Thnx in advance -- Dave

PS: Is there an equivalent to SunView's lpqtool built to run under X.  lpqtool
monitors lpq and if you have a job in the queue opens itself showing the queue
updating every so often.  When your job leaves the queue it iconifies itself
again.

converse@EXPO.LCS.MIT.EDU (10/19/90)

> Apologies if this is a FAQ, or below the general level of discussion here.

I see so many statements of this sort that I feel compelled to say that
people are welcome to ask questions.  I will make an effort not to post
intimidating and oblique answers.


> I am using TWM and X11R4.  I want to set up a menu that allows me to
> bring up an xdvi window.  However xdvi needs an argument (the dvi file to 
> load) and I don't know how to build my menu so that the argument can be 
> passed to xdvi. 

It is probably not documented very well.  Here's an example:

menu "applications"
{
"Applications"	f.title
"xterm"		!"xterm&"
"xcalc -rpn"	!"xcalc -rpn &"
}

dce@smsc.sony.com (David Elliott) (10/21/90)

In article <12WR8N@cs.swarthmore.edu> plummer@cs.swarthmore.edu (David Barker-Plummer) writes:
>I am using TWM and X11R4.  I want to set up a menu that allows me to
>bring up an xdvi window.  However xdvi needs an argument (the dvi file to 
>load) and I don't know how to build my menu so that the argument can be 
>passed to xdvi.  Perhaps this is simple, perhaps its impossible?

I'm not sure what your question is, so I'll answer it in two ways
(first in my normal voice, and then in a tiny little...sorry).

If you know the argument in advance, you just put it in the menu.

If you know the directory where the file is, you could use Gary
Shea's xf program to choose the file.

If you have a list of names, you could use Richard Hesketh's xmenu
program to display the list and select one.

If you don't know anything, you could use Richard Hesketh's xselect
along with xterm's selection mechanism.  There's also a program
in the X contrib package that let's you type in text from a window
(sorry, that MO disk isn't online right now, so I don't know the
name).

rhealey@digibd.com (Rob Healey) (10/26/90)

In article <9010191615.AA06992@excess.lcs.mit.edu> converse@EXPO.LCS.MIT.EDU writes:
>> I am using TWM and X11R4.  I want to set up a menu that allows me to
>> bring up an xdvi window.  However xdvi needs an argument (the dvi file to 
>> load) and I don't know how to build my menu so that the argument can be 
>> passed to xdvi. 
>It is probably not documented very well.  Here's an example:
>
>menu "applications"
>{
>"Applications"	f.title
>"xterm"		!"xterm&"
>"xcalc -rpn"	!"xcalc -rpn &"
>}

	?????? The person was asking how to SPECIFY the argument at
	"run time" rather than hard coding it into .twmrc. I.e.
	I want to run xdvi on foo.dvi, i.e. xdvi foo.dvi. Later, I
	want to run xdvi on bar.dvi, i.e. xdvi bar.dvi. How do
	I write ONE entry to handle BOTH cases? Can twm be told to
	prompt for operands? Can it snarf operands from a buffer?

	As far as I can tell, twm can't do this. I'm willing to be
	told, and shown, otherwise. B^).

		-Rob

converse@EXPO.LCS.MIT.EDU (10/29/90)

> I am using TWM and X11R4.  I want to set up a menu that allows me to
> bring up an xdvi window.  However xdvi needs an argument (the dvi file to 
> load) and I don't know how to build my menu so that the argument can be 
> passed to xdvi. 

twm doesn't provide any mechanism for dynamically specifying flags and 
arguments for commands invoked from menus.  Sorry to cause alarm, I 
misunderstood the question the first time I answered it.


Donna Converse

thoth@reef.cis.ufl.edu (Gilligan) (10/30/90)

  For those of you who want to prompt for arguments within a menu
entry you should consider using the "xprompt" program.  We have a
locally developed version that handles multiple lines much better than
the one posted to comp.sources.x a long time ago.
  If the demand is high enough we will clean it up for release.
Otherwise you can get it from uunet in the comp.sources.x archive.

"F6"    =       : root  : !"xterm -geom 30x20 -e zwrite `xprompt -rlen 20 -p User` & "
"L10"   = c|m   : root  : !"xrshell `xprompt -rlen 20 -p Machine`&"

"arbitrary"             ("white":"#ff60a0")     !"xrshell `xprompt -rlen 20 -p Machine`&"

--
"Until it's on my desk, it's vaporware"  (`it' is the NeXT)