Get graphic context in a mouse call?


#1

Hi,

I’m trying to get the same “Graphic &g” as in paint() call, but inside my mousedown call , via some ‘get context’ function. How is that possible ?

Nicolas


#2

my guess is that you are going about this a little backwards…

don’t try to paint in a mouse event as you are unnecessarily locking up the message thread.

Rather, set some kind of flag, IE:

_userClickedSomewhereICareAbout = true;

then call repaint().

In your paint() override, just check for the state flag and paint accordingly.


#3

This answered my question !

Thanks,

Nicolas


#4