[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 10 Aug 2015 10:30:37 -0400
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>
Description: Digital signature