[comp.windows.x] Two simple user interfaces wanted

DAVISM@kcgl1.eng.ohio-state.edu (Michael T. Davis) (06/06/90)

	I am modifying a program to be more user friendly under X (actually
DECwindows 2.0 under VMS 5.3-1, but since I'm writing with "pure" Xlib, it
should be pretty much the same).  Before I go off and possibly re-invent the
wheel, I was wondering if anyone had a couple of Xlib-based routines to perform
the following:

	1) Given/passed a character string, display the string and two
	   push-buttons labelled "Yes" and "No"; for example:

                                +--------------+
                                | Do you wish  |
                                | to continue? |
                                | +---+   +--+ |
                                | |Yes|   |No| |
                                | +---+   +--+ |
                                +--------------+

	2) Given/passed a character string, display the string, a text
	   entry field and two push-buttons labelled "OK" and "Cancel";
	   for example:

                           +------------------------+
                           | Please enter filename: |
                           |                        |
                           |   |________________    |
                           | +--+          +------+ |
                           | |OK|          |Cancel| |
                           | +--+          +------+ |
                           +------------------------+

Please reply directly to me.  If there's enough interest, I'll summarize.

							Thanks,
							 Mike

    ________________________________________________________________________
   |   InterNet> davism@{kcgl1.eng|rcgl1.eng|osu-20.ircc}.ohio-state.edu    |
   |                                  -or-                                  |
   |                       davis-m@eng.ohio-state.edu                       |
   |                         CompuServe> 73667,541                          |
   |************************************************************************|
   |                      These thoughts, they be mine                      |
    ------------------------------------------------------------------------

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (06/06/90)

> ...since I'm writing with "pure" Xlib...

> I was wondering if anyone had a couple of Xlib-based routines to perform
> the following:

This is exactly the sort of thing that the X Toolkit was designed to make
easier.  I would suggest that you look into using a toolkit to do this.  There
are several avaliable, and they will substantially cut down on your development
time.  The following list is not comprehensive but gives a list of the most
widely used toolkit.

The Athena Widget Set
The Motif Toolkit
The Xt+ Toolkit
XView

"It is impossible to write an X Application without a Toolkit...  Although some
 people choose to inline their toolkits."

I suggest that you save yourself a lot of greif and build upon the work already
accomplished in this area.

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213

DAVISM@kcgl1.eng.ohio-state.edu (Michael T. Davis) (06/06/90)

In article <5073@quanta.eng.ohio-state.edu>, I wrote:

>
>	I am modifying a program to be more user friendly under X (actually
>DECwindows 2.0 under VMS 5.3-1, but since I'm writing with "pure" Xlib, it
>should be pretty much the same).  Before I go off and possibly re-invent the
>wheel, I was wondering if anyone had a couple of Xlib-based routines to perform
>the following:
>
>	1) Given/passed a character string, display the string and two
>	   push-buttons labelled "Yes" and "No"; for example:
>
>[figure deleted]
>
>	2) Given/passed a character string, display the string, a text
>	   entry field and two push-buttons labelled "OK" and "Cancel";
>	   for example:
>
>[rest deleted]

	A few responses suggested that I use a toolkit to perform these
actions.  I'd rather avoid the extra performance overhead, minimal though it
may be, of a toolkit, since performance is an issue.

	Bill Cheng (william@cs.ucla.edu) suggested I look at the code for
tgif 1.6, which was recently announced here.  He pointed the way to the
routines YesNoCancel() in button.c and Dialog() in dialog.c.  I would suggest
taking a gander at these for code examples; they seem to be quite complete.

						    Thanks for the interest,
							     Mike

    ________________________________________________________________________
   |   InterNet> davism@{kcgl1.eng|rcgl1.eng|osu-20.ircc}.ohio-state.edu    |
   |                                  -or-                                  |
   |                       davis-m@eng.ohio-state.edu                       |
   |                         CompuServe> 73667,541                          |
   |************************************************************************|
   |                      These thoughts, they be mine                      |
    ------------------------------------------------------------------------