[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MEVENT
From: |
Thomas Dickey |
Subject: |
Re: MEVENT |
Date: |
Mon, 10 Aug 2015 10:30:37 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, Aug 10, 2015 at 09:14:29AM -0400, Patrick wrote:
> On 08/10/2015 08:55 AM, Thomas Dickey wrote:
> >----- Original Message -----
> >| From: "Patrick" <address@hidden>
> >| To: "Ncurses Mailing List" <address@hidden>
> >| Sent: Monday, August 10, 2015 8:31:58 AM
> >| Subject: MEVENT
> >|
> >| Hi Guys
> >|
> >| Probably a silly question coming up.....
> >|
> >| WINDOW is used though pointers but MEVENT is not, why is that?
> >
> >I see only pointers for MEVENT, as well.
> >
> Hi Thomas :)
>
> Maybe I just have the wrong examples. From Dan Gookin's Programmer's
> guide to ncurses page 161 it says:
> Unlike the WINDOW type of pointer you do not specify a * when
> declaring a mouse event variable. But you do use the & when
> specifying the variable name in the getmouse() function.
> MEVENT musevent ;
> getmouse(&musevent) ;
oh. I don't really distinguish between those, as I might.
The reason why MEVENT is not returned as a pointer from ncurses is
essentially because it is a simple structure which doesn't require
(as does WINDOW) ncurses to allocate any extra memory. The same is
true of cchar_t
> Can this be safely ignored and can I just use MEVENT as WINDOW like so?
> MEVENT * mevent_via_ptr ;
> getmouse(mevent_via_ptr) ;
no - the function isn't declared that way:
int getmouse(MEVENT *event);
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature