note
simonflk
<p><blockquote><i> I have no idea which widgets have a getDC() method</i></blockquote></p>
<p>Afaik, none of them do. A quick grep of the docs suggest that the following have a GetDC(): Wx::EraseEvent, Wx::HtmlWinParser, Wx::Printout. I think there are two ways of achieving what your're after (maybe more) - either use a Wx::ClientDC:</p>
<code>
my $dc = new Wx::ClientDC($frame);
$dc->DrawLine(...);
</code>
<p>or set up a Wx::PaintEvent for your frame:</p>
<code>
use Wx::Event 'EVT_PAINT';
EVT_PAINT($frame, \&OnPaint);
sub OnPaint {
my ($frame, $event) = @_;
my $dc = new Wx::PaintDC($frame);
$dc->DrawLine(...);
}
</code>
<p>See [cpan://Wx::Perl::Throbber] for an example of the latter.</p>
<p>The [http://wiki.wxpython.org|wxPython wiki] has lots of useful examples. They're in Python obviously, but it's trivial to do the translation in your head.</p>
<div class="pmsig"><div class="pmsig-153880">
<p>-- simonflk</p>
</div></div>
433222
433222