problem while calling DrawNow().

Login to reply to this topic.
Tue, 2008-04-29 12:26
Joined: 2008-02-12
Forum posts: 25

Hi to all,
I am using view and using DrawNow() to draw a text, but its not calling frameworks Draw() method in which i have written my own code. Can anyone please tell why this is so...
Thank you


Tue, 2008-04-29 12:56
Joined: 2004-11-29
Forum posts: 1134
Re: problem while calling DrawNow().

my first guess is that you have declared it a bit wrong, so you have in fact not overloaded the draw function, but created a new one.

make sure it really is

void Draw(const TRect &aRect) const;

and nothing else.
Its very common to forget the last "const"

Tue, 2008-04-29 13:27
Joined: 2008-02-12
Forum posts: 25
Re: problem while calling DrawNow().

Thanks for reply,yes I have checked it also, Draw() method is correctly written,still it doesnt get called.
thanks once again.

Tue, 2008-04-29 13:41
Joined: 2004-11-29
Forum posts: 1134
Re: problem while calling DrawNow().

Have you called SetParent() on the CCoeControl, specifying some other control as parent?
If you have, you must make sure your control also is a child of that control through CountComponentControls and ComponentControl calls

If you havn't used SetParent, the only way I know of that could make DrawNow fail to call Draw is a wrongly defined Draw function.
And I'm quite familiar with the inner workings of CCoeControls...

That is, if you call DrawNow directly on the control you want to redraw.

If you are calling it on some parent control of the control you want to redraw, then you must make sure that the framework can find its way to the control through CountComponentControls and ComponentControl calls.

Thu, 2008-05-08 10:38
Joined: 2006-11-23
Forum posts: 15
Re: problem while calling DrawNow().

Hi sandesh,

Will you plz share some of the troubled code.. so that we can trace the exact problem... without it we can only guess the problem... and not able to give exact solution..

br,
Pankaj


Pankaj Dubey

  • Login to reply to this topic.