<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - Unable to use CWindowGC::Drawtext API - Comments</title>
 <link>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api</link>
 <description>Comments for &quot;Unable to use CWindowGC::Drawtext API&quot;</description>
 <language>en</language>
<item>
 <title>Re: Unable to use CWindowGC::Drawtext API</title>
 <link>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api#comment-44322</link>
 <description>&lt;p&gt;No. Don&#039;t use that code.&lt;/p&gt;

&lt;p&gt;Its much better to just implement the draw function of a CCoeControl, and display this one.&lt;/p&gt;

&lt;p&gt;Yogesh code will work to output some text on the screen, but it is a very hacky way to do it, and will produce errors whenever your view gets a redraw event.&lt;br /&gt;
(parts or all of the text will disappear from the screen, and not be redrawn until this code is called again)&lt;/p&gt;

&lt;p&gt;If you implement the Draw function, the framework will do all those BeginRedraw/EndRedraw and such for you, so you wont have to write that code yourself, plus any redraws of the view will also work.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
 <pubDate>Mon, 04 Feb 2008 09:50:15 +0100</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 44322 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Unable to use CWindowGC::Drawtext API</title>
 <link>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api#comment-44299</link>
 <description>&lt;p&gt;Hi KamalPreet,&lt;/p&gt;

&lt;p&gt;Use following cade : &lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Window().Invalidate();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivateGc();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Window().BeginRedraw();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CWindowGc&amp;amp; gc = SystemGc();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gc.UseFont(iEikonEnv-&amp;gt;TitleFont());&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gc.DrawText(aText, Rect().Center());&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Window().EndRedraw();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DeactivateGc();&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;This code may be solve your problem.&lt;/p&gt;

&lt;p&gt;Thanks And Regards,&lt;br /&gt;
Yogesh&lt;/p&gt;</description>
 <pubDate>Sat, 02 Feb 2008 09:25:27 +0100</pubDate>
 <dc:creator>yogesh.bhople</dc:creator>
 <guid isPermaLink="false">comment 44299 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Unable to use CWindowGC::Drawtext API</title>
 <link>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api#comment-44290</link>
 <description>&lt;p&gt;  Wheneve you want to update screen please call DrawNow or DrawDeferred.&lt;/p&gt;</description>
 <pubDate>Sat, 02 Feb 2008 02:50:26 +0100</pubDate>
 <dc:creator>runforu</dc:creator>
 <guid isPermaLink="false">comment 44290 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Unable to use CWindowGC::Drawtext API</title>
 <link>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api#comment-42256</link>
 <description>&lt;p&gt;You shouldn&#039;t just draw to the gc anytime as you try to do now.&lt;/p&gt;

&lt;p&gt;The right way is to implement the Draw() method of a CCoeControl or view to draw the text.&lt;/p&gt;

&lt;p&gt;This method will be called by the framework each time the control needs to be drawn, (for example when closing a menu that covered it, or when telling it to be visible) and you can, if needed, initiate a redraw by calling DrawNow().&lt;/p&gt;

&lt;p&gt;It will take care of activation and deactivation for you, which might be your problem now (hard to say since you don&#039;t say how your app &quot;crash&quot;. Try find out the panic error code to get more information on why your app dies.)&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Fri, 12 Oct 2007 14:53:21 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 42256 at http://www.newlc.com</guid>
</item>
<item>
 <title>Unable to use CWindowGC::Drawtext API</title>
 <link>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api</link>
 <description>&lt;p&gt;Hi Friends,&lt;br /&gt;
I am new to symbian, I am using CWindowGC::DrawText API but as soon as I am calling that API..... my emulator is crashing.&lt;/p&gt;

&lt;p&gt;below is my function:&lt;/p&gt;

&lt;p&gt;CSampleAppUIView class is derived from CCoeControl.&lt;/p&gt;

&lt;p&gt;void CSampleAppUIView::TextDraw(const TDesC&amp; aText, const TPoint&amp; aPoint)&lt;br /&gt;
{&lt;br /&gt;
	CWindowGc&amp; gc = SystemGc();&lt;br /&gt;
	&lt;br /&gt;
	gc.UseFont(iEikonEnv-&gt;TitleFont());&lt;br /&gt;
	&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/forum/unable-use-cwindowgc-drawtext-api#comments</comments>
 <category domain="http://www.newlc.com/forums/2d-3d-graphics">Bitmaps and Graphics</category>
 <pubDate>Fri, 12 Oct 2007 13:37:39 +0200</pubDate>
 <dc:creator>kamalpreet</dc:creator>
 <guid isPermaLink="false">19276 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
