Hello Bass Guitar,<br><br>Unfortunately, you cannot instantiate the DC (Device Context) directly from the DC Class.&nbsp; You need to utilize Window#draw or Window#paint to create a DC.&nbsp; The difference between these two methods, is that when you are in a paint event (EG: evt_paint), you utilize the Window#paint method to acquire a Device Context.&nbsp; When your outside of the paint event, you utilize Window#draw to acquire the Device Context.
<br><br>An Example of inside an paint event would be this:<br><br>evt_paint() do<br>&nbsp; self.paint do |dc|<br>&nbsp;&nbsp;&nbsp; dc.draw_line(50, 50, 100, 100)<br>&nbsp; end<br>end<br><br>And an example of how to draw outside of a paint event:
<br><br>def run_draw()<br>&nbsp; self.draw do |dc|<br>&nbsp;&nbsp;&nbsp; dc.draw_line(50, 50, 100, 100)<br>&nbsp; end<br>end<br><br>Once you implement this, it will work.<br><br>L8ers,<br><br>Mario Steele<br><br><div><span class="gmail_quote">On 1/2/08, 
<b class="gmail_sendername">Bass Guitar</b> &lt;<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I use<br><br>dc = DC.new()<br>dc.draw_line(50,&nbsp;&nbsp;50,&nbsp;&nbsp;100, 100)<br><br>but it can&#39;t be compiled<br>I don&#39;t know how to declare DC variable??<br>in <a href="http://wxruby.rubyforge.org/doc/dc.html">http://wxruby.rubyforge.org/doc/dc.html
</a><br>it don&#39;t tell me how to declare now variable<br>plese tell me :&#39;(<br>--<br>Posted via <a href="http://www.ruby-forum.com/">http://www.ruby-forum.com/</a>.<br>_______________________________________________
<br>wxruby-users mailing list<br><a href="mailto:wxruby-users@rubyforge.org">wxruby-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/wxruby-users">http://rubyforge.org/mailman/listinfo/wxruby-users
</a><br></blockquote></div><br>