X Window not accepting input or input focus

X Window not accepting input or input focus

Post by Detlev D. Ansinn Jr » Sun, 10 Jan 1999 04:00:00



Platform: Redhat 5.1, XFree86, C Program, Athena Widgets

When I run the attached program, I am unable to give the X window focus
(title bar remains gray instead of blue).  This presents a problem when I
have asciitext widgets on screen.  As I type, my keyboard response is sent
to the terminal from which I launched the application.  Running xwininfo on
the window with the -all option tells me:

...
Window manager hints:
    Client accepts input or input focus: no
...

I believe that this is my problem, but I do not know how I can change this
(newbie).  I can compile sources for X apps provided with the Redhat
distribution and they run normally.

Thanks in advance for any assistance.
-DDA

//Very Simple Program demonstrating sequence of calls
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Box.h>
#include <X11/Xaw/Command.h>

XtAppContext context;
Widget toplevel, manager, exit_button;

void ExitCallback(Widget w, XtPointer client_data, XtPointer call_data){
 exit();

Quote:}

int main(int argc, char **argv){
 toplevel = XtAppInitialize( &context, "Hello",
   NULL, 0, &argc, argv, NULL, NULL, 0);

 manager = XtCreateManagedWidget("manager",  boxWidgetClass,
   toplevel, NULL, 0);

 exit_button = XtCreateManagedWidget("exitButton", commandWidgetClass,
   manager, NULL, 0);
 XtAddCallback(exit_button, XtNcallback, ExitCallback, NULL);

 XtRealizeWidget(toplevel);
 XtAppMainLoop(context);

 return 1;

Quote:}

 
 
 

X Window not accepting input or input focus

Post by George MacDonal » Sun, 10 Jan 1999 04:00:00



> Platform: Redhat 5.1, XFree86, C Program, Athena Widgets

> When I run the attached program, I am unable to give the X window focus
> (title bar remains gray instead of blue).  This presents a problem when I
> have asciitext widgets on screen.  As I type, my keyboard response is sent
> to the terminal from which I launched the application.  Running xwininfo on
> the window with the -all option tells me:

> ...
> Window manager hints:
>     Client accepts input or input focus: no
> ...

> I believe that this is my problem, but I do not know how I can change this
> (newbie).  I can compile sources for X apps provided with the Redhat
> distribution and they run normally.

> Thanks in advance for any assistance.
> -DDA

> //Very Simple Program demonstrating sequence of calls
> #include <X11/Intrinsic.h>
> #include <X11/Shell.h>
> #include <X11/StringDefs.h>
> #include <X11/Xaw/Box.h>
> #include <X11/Xaw/Command.h>

> XtAppContext context;
> Widget toplevel, manager, exit_button;

> void ExitCallback(Widget w, XtPointer client_data, XtPointer call_data){
>  exit();
> }

> int main(int argc, char **argv){
>  toplevel = XtAppInitialize( &context, "Hello",
>    NULL, 0, &argc, argv, NULL, NULL, 0);

>  manager = XtCreateManagedWidget("manager",  boxWidgetClass,
>    toplevel, NULL, 0);

>  exit_button = XtCreateManagedWidget("exitButton", commandWidgetClass,
>    manager, NULL, 0);
>  XtAddCallback(exit_button, XtNcallback, ExitCallback, NULL);

>  XtRealizeWidget(toplevel);
>  XtAppMainLoop(context);

>  return 1;
> }

Just compiled and ran it on Red Hat 5.1 with no problems. You might
want to check for a Resource file with the name "Hello".

On my system I get the following from xwininfo

 Window manager hints:
      Client accepts input or input focus: Yes

Here is the makefile I used
----------------------------

CFLAGS = -O -DSYSV

LIBS =  -L /usr/X11/lib -lXaw3d -lXt -lX11 -lm -lXext -lXp

BIN =  hello

all:    $(BIN)

hello:  hello.o $(LOCAL_LIBS)
        $(CC) $(CFLAGS) -o hello hello.o $(LOCAL_LIBS) $(LIBS)

hello.o: hello.c
        $(CC) $(CPPFLAGS) $(CFLAGS) -c hello.c

clean::
        rm -f $(BIN) *.o

--
We stand on the shoulders of those giants who coded before.
Build a good layer, stand strong, and prepare for the next wave.
Guide those who come after you, give them your shoulder, lend them your code.


 
 
 

X Window not accepting input or input focus

Post by Detlev D. Ansinn Jr » Sun, 10 Jan 1999 04:00:00



>> When I run the attached program, I am unable to give the X window focus
>> (title bar remains gray instead of blue).  This presents a problem when I
>> have asciitext widgets on screen.  As I type, my keyboard response is
sent
>> to the terminal from which I launched the application.

[snipped out "hello world"-like X source code]


>Just compiled and ran it on Red Hat 5.1 with no problems. You might
>want to check for a Resource file with the name "Hello".

>Here is the makefile I used
>----------------------------
>CFLAGS = -O -DSYSV
>LIBS =  -L /usr/X11/lib -lXaw3d -lXt -lX11 -lm -lXext -lXp

Yes, it was the makefile.   Specifying the above compiler flags and
libraries made it fly.  Thank you very much for your help.

Happy Computing,
-DDA

 
 
 

1. export `eval echo $"$INPUT"`=${input} not work on Sun Solaris 7

Hi all,

I wrote a function (run with ksh) to get the input and return a string using
the command eval in the function below:

get_input()
{
VAR_INPUT=$1

input=""

while test "${input}" = ""
do
     echo "Input: (q=quit) \c"
     read ${input}
     test "${input}" = "" && continue
     test "${input}" = "q" && exit 1
done

export `eval echo $"$VAR_INPUT"`=${input}

INPUT=""
get_input INPUT

It works with RedHat bash, Unixware 7 and HP-UX 10.20 but it failed with
Solaris 7.

export `eval echo $"${VAR_INPUT}"` = ${input}

it won't get:  export INPUT=${input} with Solaris 7 but
                      export =${input}  so error.

What is the right syntax of eval on Solaris 7 to get the same result on
other platforms or other way more portable to return a string from a
function (ksh/bash)?

Thanks in advance for any help.

DH.

2. RedHat 6.2 install problems

3. in SunOS 5.2, my console window doesn't accept input

4. Solved: Solaris x86 PPP -> WIN NT PPP

5. linux ppc not accepting keyboard input?

6. test

7. Console not accepting input..

8. Developing Systems Administrater Training

9. Netscape textfields not accept input

10. twm and keyboard input focus

11. OPENSTEP input focus

12. standard input instead of input file

13. Merging keyboard input with serial console input?