bug-ncurses
[Top][All Lists]
Advanced

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

Recommended way to distinguish between pads and windows?


From: Mark Dickinson
Subject: Recommended way to distinguish between pads and windows?
Date: Sun, 6 Sep 2009 06:30:01 -0700 (PDT)

Hi all,

I'm trying to fix Python's interface to ncurses (the 'curses' module), which
seems to be broken with ncurses 5.7, and I wanted to ask your advice:

The problem is that Python's source repeatedly uses C code like the
following to distinguish windows and pads (where self->win has
type WINDOW):

  if (self->win->_flags & _ISPAD)
    /* use pechochar here */
  else
    /* use wechochar instead */

but with ncurses 5.7, the internals of WINDOW are hidden, so the
attempted access to _flags fails with a gcc 'dereferencing pointer
to incomplete type' error.  What's the recommended solution for
this type of problem?  We could just #define NCURSES_OPAQUE
to 0, but that seems risky:  presumably these internals are hidden
for a good reason.  Is there some public method of determining
whether something of type WINDOW is actually a pad,
or should Python try to keep track independently of which objects
are windows and which are pads?

Thanks,

Mark Dickinson

-- 
View this message in context: 
http://www.nabble.com/Recommended-way-to-distinguish-between-pads-and-windows--tp25317825p25317825.html
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.





reply via email to

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