[comp.windows.x] help!

obrooks@NSWC-WO.ARPA (08/17/87)

	I have recently acquired the distribution tape for X-windows
release 10. I am considering trying to get it up on a Apollo DN580-T
Sr9.2.7. My problem is that the X documentation says it was done for
Sr9.5 - Will this greatly effect my effort? Has anyone else already
done this? Please send me some mail on the subject?

THANKS!!
	OSCAR


---------------------------------------------------------------------------
IN REAL LIFE:			ADDRESS:

Oscar Brooks			obrooks@nswc-wo.arpa
Naval Surface Weapons Center
10901 New Hampshire Ave
Silver Spring, MD. 20903

cuddy@convex.UUCP (07/27/88)

Here's a question for all you X11R2 wizards:

    I'm writing a program that does a select on a socket to wait for
    data from a daemon program.  It also needs to look for events from the 
    X server (exposes, mouse clicks, etc.).  I really don't want to do a 
    non blocking select, check if there are X events and then go back to 
    sleep.  I'm a novice 'X' programmer: is there something I'm missing?

+----------------------------------------+------------------------------------+
|Mike Cuddy                              | "Thank you Onan" -- Monty Python.  |
|Convex Computer Corporation             | "They Played PATTY CAKE!!" -- R. R.|
|701 N. Plano Rd. Richardson, TX 75081   +---+ #include <asbestos.h>          |
|{inhp4, allegra, uiucdcs, sun}!convex!cuddy | #include <fire_extinguisher.h> |
+--------------------------------------------+--------------------------------+

dana@dino.bellcore.com (Dana A. Chee) (08/22/88)

In article <80100001@convex> cuddy@convex.UUCP writes:

   Here's a question for all you X11R2 wizards:

       I'm writing a program that does a select on a socket to wait for
       data from a daemon program.  It also needs to look for events from the 
       X server (exposes, mouse clicks, etc.).  I really don't want to do a 
       non blocking select, check if there are X events and then go back to 
       sleep.  I'm a novice 'X' programmer: is there something I'm missing?

Yes,  you can add the X file descriptor to your select call.  It is
obtained by:
	Xfd = ConnectionNumber(display);

where 'display' is the display returned from your XOpenDisplay().

	Now, when your select returns, you test to see which file
descriptor has data.

	readfiles = (1 << yourSocket) | (1 << Xfd );
	n = select(32, &readfiles, 0, 0, 0);
	
	if( readfiles & (1 << Xfd) )
	{
		XNextEvent(dpy, &event);
		.
		.
		.
	}
	else
	{
		/* whatever you wish with your socket */
	}

Hope this helps.
--
+*************************************************************************+
*  Dana Chee				(201) 829-4488			  *
*  Bellcore								  *
*  Room 2Q-250								  *
*  445 South Street			ARPA: dana@bellcore.com		  *
*  Morristown,  NJ  07960-1910		UUCP: {gateways}!bellcore!dana	  *
+*************************************************************************+

spencer@CITI.UMICH.EDU (08/22/88)

In article <20088@citi.umich.edu> convex!authorplaceholder@texsun.central.sun.com writes:
>    It also needs to look for events from the
>    X server (exposes, mouse clicks, etc.).  I really don't want to do a
>    non blocking select, check if there are X events and then go back to
>    sleep.

You can do this easily by getting the file descriptor of the display
connection, and adding that to your select() call.  E.g.:

	Display * dpy;
	int readfs, xfd;
	...
	xfd = ConnectionNumber(dpy);
	readfds |= 1 << xfd;
	...
	select( ..., &readfds, ... );
	...
	if ( readfds & (1 << xfd) )
		ProcessXEvents(dpy);

=Spencer (spencer@crim.eecs.umich.edu)

casey@admin.cognet.ucla.edu (Casey Leedom) (08/23/88)

In article <DANA.88Aug22090308@dino.bellcore.com> dana@dino.bellcore.com
(Dana A. Chee) writes:
>
>	readfiles = (1 << yourSocket) | (1 << Xfd );
>	n = select(32, &readfiles, 0, 0, 0);
>	
>	if( readfiles & (1 << Xfd) )
>	...

  Just being picky here.  But if you're not going to use the fd_set stuff
from <sys/types.h>, you should at least get the types you are using right.
The above should read:

	readfiles = (1L << yourSocket) | (1L << Xfd );
	n = select(32, &readfiles, (long *)0, (long *)0, (struct timeval *)0);
	
	if( readfiles & (1L << Xfd) )

Casey

casey@ADMIN.COGNET.UCLA.EDU (Casey Leedom) (08/23/88)

In article <DANA.88Aug22090308@dino.bellcore.com> dana@dino.bellcore.com
(Dana A. Chee) writes:
>
>    readfiles = (1 << yourSocket) | (1 << Xfd );
>    n = select(32, &readfiles, 0, 0, 0);
>
>    if( readfiles & (1 << Xfd) )
>    ...

  Just being picky here.  But if you're not going to use the fd_set stuff
from <sys/types.h>, you should at least get the types you are using right.
The above should read:

    readfiles = (1L << yourSocket) | (1L << Xfd );
    n = select(32, &readfiles, (long *)0, (long *)0, (struct timeval *)0);

    if( readfiles & (1L << Xfd) )

Casey

jdi@sparky.UUCP (John Irwin) (01/29/89)

Your message:

    In article <7391@netnews.upenn.edu> arup@linc.cis.upenn.edu.UUCP (Arup Mukh
   erjee) writes:
    >
    >		 The program works fine if no
    >window manager is running, but if any of wm, uwm, twm or awm is
    >running, the window appears, and *nothing* is drawn into it.

    You should wait for an Expose event before drawing on the window.
    ...

--------

Note: This *won't* work if the window in question has a backing-store of
type Always, and the server has enough resources to retain the window.

With such a window, you should wait for a MapNotify event before drawing.

	-- John

PS: The ICCCM should mention this difference in section 4.2.2.

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (01/29/89)

    Note: This *won't* work if the window in question has a backing-store of
    type Always, and the server has enough resources to retain the window.
    With such a window, you should wait for a MapNotify event before drawing.

WRONG!  Even with such a window, you get an Expose event, and you should
drive repaint based on the Expose event.

(Perhaps you are confused by bugs in the unofficial backing store code that
people used with R2.)

jdi@sparky.UUCP (John Irwin) (01/30/89)

Your message:

        Note: This *won't* work if the window in question has a backing-store o
   f
        type Always, and the server has enough resources to retain the window.
        With such a window, you should wait for a MapNotify event before drawin
   g.

    WRONG!  Even with such a window, you get an Expose event, and you should
    drive repaint based on the Expose event.

    (Perhaps you are confused by bugs in the unofficial backing store code that
    people used with R2.)
--------

You are quite correct.  I was actually confused by the different places
where the Exposure event occurs.  Using a normal window, it occurs after
the call to map-window.  Using an :always window, it occurs after the call
to create-window.  So I guess with an :always window the MapNotify always
occurs after the Exposure, which is why I didn't see any lost graphics.

	-- John

law@planet.bt.co.uk (Lawrence Lordanich) (01/05/90)

I am trying to use xlog as a regression testing tool.
The hope is to run xlog with the '-o' option during which the client
saves the resulting diagram to a unix ascii file. This works fine.
Next I run xlog with the '-i' option. During this process there is no file 
created and saved in the curr dir.

Does anybody out there have an idea what is going on?

Does anybody have an idea where some documentation exists for xlog?

Can you contact me?

Thanking You,  L. Lordanich
 

rds@goanna.oz.au (Rowan D. Stevens) (01/24/90)

 ----  HELP!  ----

I am looking for information about either a user interface methodology, a
name of a research paper, an actual CASE tool or development environment, or
anything which might help me to locate the following:-

A tool or method which will allow a user interface to be developed visually
(similiar to Microsoft's Dialog Box Editor) but will output the operational
interface shell in some object-oriented programming type language (ie. c++)
The method should allow modelling of window-oriented and text user interfaces.
Anything close to this, I would still like to hear about.

If someone out there is carrying out research in this or a similar area, then I
would be very interested in talking further about this.

I can be contacted at:

	Royal Melbourne Institute of Technology
	C/-Department of Computer Science
	GPO BOX 2476V
	Melbourne, Vic 3001
	Australia

	Phone: +61-3-660-3216  
	ACSnet: rds@goanna.rmit.oz

Much appreciated!

Regards --> Rowan Stevens

mark@sunquest.UUCP (Mark McCourt) (02/07/90)

In article <6271@inco.UUCP>, pauls@inco.UUCP (Paul Stygar) writes:
> In article <2797@goanna.oz.au> rds@goanna.oz.au (Rowan D. Stevens) writes:
> >
> > ----  HELP!  ----
> >
> >I am looking for information about either a user interface methodology, a
> >name of a research paper, an actual CASE tool or development environment, or
> >anything which might help me to locate the following:-
> >
> At the January UNIFORUM in Washington DC we saw a demonstration of a
> pleasant tool based on the Motif widget set.  The product was EXOC
> and will be available soon (March 1990?) from
> 
> 	Expert Object Corporation
> 	7250 Cicero Avenue
> 	Suite 201
> 	Lincolnwood,  Illinois 60646
> 
> Phone:	(312) 676-5555
> 
> In a few minutes one could easily complete a few days worth of manual
> coding.  Cost was approx $1300 for a single workstation,  and appeared
> to be a bargain.  Not a CASE tool,  rather, an actual productivity tool.
> 
> The interface was about as user friendly as we could imagine.  Your
> mileage may vary.  We saw some other products with similar capabilities
> at the show,  but on a cost/friendliness perspective the choice was too
> easy.
> 
> We have no connection with the above product except as prospective customers.

I called EXOC about its products and found they weren't for me.  Their UIMS
runs on top of the "native" toolkit of a platform.  i.e. on Suns it sits on
OpenLook, on DECs it sits on Motif, etc.  I need Motif on Suns which they 
said they don't plan on supporting for a while, if at all.  This may be 
ok depending on your environment.

I received some info from a proponent of TeleUSE from TeleSoft:

> I know of some more UIMS tools and I also want to give you some information
> about TeleUSE.
>
> Other UIMS tools are:
>        XBuild from Nixdorf
>        VUIT from DEC
>        TAE+ from NASA
>        Sherryl Lubinsky from ?
>        Xcessory from ICS
>        WINTERP from ?
>        Serpent from Carnegie Mellon
>        (GUIDE comes from Sun)

There is also UIMX from Visual Edge.  I have only looked at specifics for UIMX,
TeleUSE and the EXOC products (AutoCODE and ExoCODE).  TeleUSE is available now
while UIMX is still in Beta but due out shortly. 

Addresses:

 The TeleUSE Group
 TELESOFT
 5959 Cornerstone Court West
 San Diego, Ca 921921-9891
 tel: 619-457-2700
 fax: 619-452-1334


For UIMX

 Visual Edge Software Limited
 3870 Cote Vertu
 St. Laurent, Quebec
 Canada
 H4R 1V4

I have seen UIMX run.  It seems to be a really powerful tool that should really
boost productivity by orders of magnitude.

Good Luck.

Mark McCourt

manu@ORC.OLIVETTI.COM (Manu Das) (09/01/90)

I have this simple client: 


#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Command.h>

void Quit(w,client_data,call_data)
Widget w;
caddr_t client_data,call_data;

{
	printf("client_data=%s,call_data=%s\n",client_data,call_data);
	exit(0);
}

MyNotify(w,event,params,num_params)
Widget w;
XButtonEvent event;
char *params[];
Cardinal *num_params;
{
	printf("params=%s num_params=%d\n",params[0],*num_params);
	XtCallCallbacks((CommandWidget)w,XtNcallback,(caddr_t)"anything");
}

main(argc,argv)
int argc;
char **argv;
{
	Widget top,cmd;
	static XtActionsRec actions[] = {
			{"myNotify", (XtActionProc)MyNotify},
					 };
	top = XtInitialize( argv[0], "Sample", NULL, 0, &argc, argv);
	cmd = XtCreateManagedWidget("bye",commandWidgetClass,top,NULL,0);
	XtAddActions(actions,XtNumber(actions));
	XtAddCallback(cmd,XtNcallback,Quit,"CLNT DATA");
	XtRealizeWidget(top);
	XtMainLoop();
}

The resource file has this line:
--------------------------------
Sample*bye.translations: #override \n\
	<Btn1Down>: myNotify(Btn1)

=>>THE PROBLEM is, in the function MyNotify(),
printf("params=%s num_params=%d\n",params[0],*num_params);
is not printing anything, because params and the num_params aren't defined!
Why is that? 

I am using X11R3.

Thank you for your help.

Manu Das (manu@orc.olivetti.com)

tchen@mr-pibb.cs.wisc.edu (Tung Chen) (10/17/90)

I'm currently looking for papers on X protocol.  The paper I need 
would present or discuss X protocol on a higher level of abstraction ( instead
of protocol specifications).  Also any paper on X protocol performance 
study would be very helpful, too.  Do any one remember seeing such papers?? 
Any pointer is greatly appreciated. 

Tung C. (tchen@cs.wisc.edu)

schulenb@aero.aero.org (10/17/90)

i'm one of the everpresent novices asking the experts for help.

i'm using the clx interface to x, trying to use a modified font.
i modify the font via something called sfonted.  i cannot seem to
get it recognized by list-fonts.  list-font-names, however, does
seem to be able to find it (or rather at least its name).  i've changed
font-path and created something called font.dir in that path to
contain the font file.  i've also tried using something called
font.alias.  (note that these file names may be plural.)  all of
this has been done just by trying to emulate what already exists
but to no avail.  my guess is that the problem lies with the
edited version of the font but i have no idea how i can get around
the problem.  please help if you can.

TiA,

,dave

ps, if there is a forum specifically for clx users, please let
me know.

mouse@LARRY.MCRCIM.MCGILL.EDU (10/18/90)

> i'm using the clx interface to x, trying to use a modified font.  i
> modify the font via something called sfonted.  i cannot seem to get
> it recognized by list-fonts.  list-font-names, however, does seem to
> be able to find it (or rather at least its name).  i've changed
> font-path and created something called font.dir in that path to
> contain the font file.

You should not create fonts.dir (not font.dir) yourself; you should run
mkfontdir on the directory in question.  (Run mkfontdir; give it one
argument, that being a pathname of the directory.  For example, cd to
the directory and run "mkfontdir .".)

Does your sfonted edit the .snf file or the .bdf file?  If the latter,
you need to use bdftosnf to convert it to a .snf file so the server can
use it.  (If you use bdftosnf, run it *before* mkfontdir.)

You need to run mkfontdir only when you add or delete fonts.  Editing a
font does not necessitate rerunning mkfontdir.  bdftosnf, on the other
hand, needs to be run whenever you've changed the .bdf file and want
the changes to be reflected in the font as seen by the X server.  (You
may have to resort to some trickery to get the server to reread the
.snf file.  If "xset fp rehash" doesn't do it I don't know what to
suggest.)

At least, that's for an MIT server.  You don't say whose server you're
running; if it's not the MIT sample server you may need to change the
above instructions (your X distribution documentation should describe
the appropriate incantations).

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu