bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X and ncurses / getch() and X-keyevents


From: Thomas Zauner
Subject: Re: X and ncurses / getch() and X-keyevents
Date: 15 Feb 2003 22:00:11 +0100

On Sat, 2003-02-15 at 21:36, Thomas Dickey wrote:
> On Sat, Feb 15, 2003 at 09:06:43PM +0100, Thomas Zauner wrote:
> > On Sat, 2003-02-15 at 20:42, Thomas Dickey wrote:
> > > 
> > > what window are you getting the X events from?  (that's probably not the
> > > problem, but I'm curious).  More likely the problem is interfering select
> > > calls in ncurses and the X library.
> > > 
> > > -- 
> > > Thomas E. Dickey <address@hidden>
> > > http://invisible-island.net
> > > ftp://invisible-island.net
> > > 
> > > 
> > 
> > well that's really sth. i would like not  to tell (LOL) because i think 
> > it's very poor. 
> > 
> > i start an xterm and my program within the xterm with a exec call like 
> > execl("/usr/bin/xterm","-e","/PATH/MYPROG",NULL);  
> > that way i make shure MYROG is really within an xterm.
> > 
> > then i connect to the X server and then get the window id from the 
> > environement like  win_id=getenv("WINDOWID")  , i know i should not
> > trust that and instead check the tree of all windows starting from the root 
> > window but it's a lot more work.  
> > 
> > 
> > i think it might be the event propagation that is in someway and only
> > sometimes "wrong" but these thing are really hard to trace. 
> 
> well - I'm not sure what you are trying to accomplish.  But I think the
> problem is that both ncurses and X's library perform blocking select
> calls.  So depending on which one is active at any given instant, that
> determines whether the event is detected immediately.  If it's only
> the resizing that is needed, it's not needed to call X to find this.
> 


hmm, i was just starting to use ncurses+xterm for some tools i used on a
pure text console. i went throught the NCURSES-HOWTO and tried to get
the mouse working but it didn't work. well then i decided that i could
use X to handle all the events and just use ncurses for the actual
printing of chars.
but it looks like its generally not a good plan to mix X-events and
ncurse-events and handlers. would you agree? 
i ll try again to get the mouse working with pure ncurses tomorrow.  
and go though the ncurses doc's again to check if i really need X.

thx,
tom






reply via email to

[Prev in Thread] Current Thread [Next in Thread]