Problem Activating the graphics Context.
| Thu, 2007-11-01 06:27 | |
|
|
I am working on Series60 2nd edition. I want to draw some text in my own class (i.e other than AppView) But when I try to activate the graphics context it panics with Kern-Exec 3. void Cxyz::MyDrawFunction() ... gc.Deactivate(); I have extended my class from CCoecontrol. |






Forum posts: 51
CWindowGc::Activate causes painc in two cases:
first, a draw function is called before calling this activate function
secons, this function is called twice in succession without calling Deactivate
Forum posts: 61
Thanks mickey,
let me explain the scenario. The issue is that I have a AppView class in who's constructL() I am creating an object of my "Cxyz" class. And the "Cxyz" class has another function who will display some data (the function shown above). But for that I am using an asynchronous function, so the issue is, by the time, the asynchronous function returns the control have already called Activate() in the AppView and then also executed the Draw() function of AppView().
And If I use this function in AppView then the function works pretty fine without any error.
Hope I have made my point clear. Any pointers on that.
Forum posts: 1156
None of the cases mickeyfirst mention will result in a Kern-Exec 3 though.
Your problem must be something else... Maybe some problem with the window?
Also, be adviced this is not the right way to handle redraws. You might get it to work, but it might end up being more work then just sticking to the standard.
You should implement the CCoeControls Draw() function to draw the control.
After that, you can call "DrawNow" on it to draw it at once, or DrawDeferred to just invalidate it and draw it on an redraw event the next time the thread goes idle.