[comp.windows.x] Executing X11 programs

satish@uhccux.uhcc.hawaii.edu (Satish Kumar) (06/22/89)

	I am new to the X programming(environment). I am programming using 
Xlib functions/features offered by X11 (Xlibraries). I am not using any sort 
of widgets or toolkits for my application. 
	I succesfully compiled and linked a program (program is a simple
one, i.e to write my name in a rectangle). The executable program is upto
date (i.e without any errors). When I execute the program, I can succesfully 
connect to the X server. But nothing will be displayed on the terminal
(in the window).the control returns to the unix shell ( in the default 
window, i.e the window started by 'xinit'). For executing any program,
I am not sure whether 'uwm','xterm' should be running at background mode
or not. But even if they are running in background and if I execute my
program, the response is same as mentioned.
	For any thing to be displayed, the corresponding window should be
mapped(even the parents). But before mapping a window, standard properties
are to be set using XSetStandardProperties(.......) function (of Xlib).
This function has Argc & Argv as two of the arguments to be passed/specified.
These arguments are to be passed while executing the program (i.e command
line arguments). But I do not know the arguments to be specified, the syntax
/format of the arguments. I am not able to conceive this concept from the
book (Xlib programming manual, by Adrian Nye, O'Reilly Associates, volume 1)
	The program I have written is almost similar to the one given in
the manual (Basicwin program, page 77). 
	Please send your replies/answers/suggestions to the e-mail address 
given below.
	I thank you in advance for the help.


						- Satish .


ADDRESS (e-mail)     : satish@uhccux.uhcc
ORGANIZATION         : INFORMATION AND COMPUTER SCIENCE DEPARTMENT,
		       UNIVERSITY OF HAWAII, HONOLULU, HAWAII, 96822,U.S.A
ADDRESS		     : 2920, SOUTH KING STREET, HONOLULU, HAWAII
		       96826, U.S.A
PHONE		     : (808) 941-9380.

converse@EXPO.LCS.MIT.EDU (Donna Converse) (06/22/89)

> For executing any program,
> I am not sure whether 'uwm','xterm' should be running at background mode
> or not.

You should have a window manager, such as uwm, running in the background.

> But even if they are running in background and if I execute my
> program, the response is ...  nothing will be displayed on the terminal
> (in the window).

It sounds as though your program will open a new window on the screen
and write your name in that new window.  If no new window appears, or
if a new window appears but nothing is written in it, then there is
some other problem with your program.  

> But before mapping a window, standard properties
> are to be set using XSetStandardProperties(.......) function (of Xlib).
> This function has Argc & Argv as two of the arguments to be passed/specified.
> These arguments are to be passed while executing the program (i.e command
> line arguments). But I do not know the arguments to be specified, the syntax
> /format of the arguments.

Don't worry about this; whatever arguments there are to your application,
if any, just pass them in.   Just pass in argv and argc as your program
received them from the command line.  It will be used to set the 
WM_COMMAND property.  The window manager will communicate this information
to the session manager, which uses this and other information to re-start
your programs at the point where you last stopped working, for example,
to allow to pick up work where you last left off, between login sessions.
Your X software may not have a session manager.


Donna Converse
converse@expo.lcs.mit.edu

stripes@wam.UMD.EDU (06/24/89)

In article <4162@uhccux.uhcc.hawaii.edu> satish@uhccux.uhcc.hawaii.edu (Satish Kumar) writes:
[stuff removed]
>	I succesfully compiled and linked a program (program is a simple
>one, i.e to write my name in a rectangle). The executable program is upto
>date (i.e without any errors). When I execute the program, I can succesfully 
>connect to the X server. But nothing will be displayed on the terminal
>(in the window).the control returns to the unix shell ( in the default 
>window, i.e the window started by 'xinit'). For executing any program,
This sounds like your program doesn't flush the output buffer, or doesn't wait
for any events (which automagicly flushes the output buffer).
A lot of people make this mastake (even after reading it in a X book).

>...But before mapping a window, standard properties
>are to be set using XSetStandardProperties(.......) function (of Xlib).
>line arguments). But I do not know the arguments to be specified, the syntax
>/format of the arguments. I am not able to conceive this concept from the
>book (Xlib programming manual, by Adrian Nye, O'Reilly Associates, volume 1)
Take it a litte at a time, you don't need to know all this untill next week
:-)
-- 
           stripes@wam.umd.edu          "Security for Unix is like
      Josh_Osborne@Real_World,The          Mutitasking for MS-DOS"
      "The dyslexic porgramer"                  - Kevin Lockwood
                "Dammit Jim, I'm a Doctor not an Excorsist"
                   - One of Bones' lines in a previous ST:V script...