Hello Omar,<br><br><div class="gmail_quote">On Wed, Dec 3, 2008 at 3:52 PM, Omar Hernandez <span dir="ltr"><<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
wel, I'm back with another newbee question.</blockquote><div><br>Not a problem <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
the problem i'm having and that i coldn't find it on the internet is how<br>
to refresh a window, but someting more explained, maybe a tutorial or<br>
some doc?<br>
<br>
when i put muy window behind another one the contents is 'deleted',<br>
still there but not visible until i click again (for example in a<br>
textbox), in most cases.<br>
<br>
ok, first i'll explain what I'm Doing (wrong)<br>
<br>
first i call class Minimalapp<br>
<br>
Minumalapp calls a Frame class<br>
<br>
Within the frame class, on process initialize, I declare the menus, tool<br>
bars, panels, and a book. After the book i call both update() and<br>
refresh() (in that order), but when i run the program and put the window<br>
behind another one it doesn't update.<br>
<br>
the code (abstract) is this:<br>
<br>
-class Aframe< WX::Frame<br>
--def initialize<br>
---menu bars and toolbars<br>
---NoteBook<br>
----panel<br>
----textbox<br>
----combobox<br>
----etc<br>
---update()<br>
---refresh()<br>
--end<br>
-end</blockquote><div><br>First off, update() and refresh() is only executed once, when you initialize your Frame. It doesn't do any subsiquent repainting, as initialize is never executed again in the lifetime of your Frame that you just created. To put it into simpler terms, you do this:<br>
<br>myframe = Aframe.new<br><br>myframe will call the initialize method on Aframe to get everything setup. Where your update() and refresh() are. After this point, initialize is never called again, nor should it be, least your creating a new instance of Aframe.<br>
<br>Secondly, the frame should be doing it's own updates and refreshes, unless you are intercepting a evt_paint() on the frame itself. If your doing that, then it will not repaint the frame itself, till you pass along the ok for wxRuby to repaint the window itself.<br>
<br>Unless your doing some specialized graphics, you shouldn't need to intercept the evt_paint(), and even then, if your doing specialized graphics, in a certian area of your frame, I would strongly suggest that you create an instance of panel, to do all of your drawing. <br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">-class Minimalapp< wx::App<br>
-- on_init #calls Aframe<br>
-end<br>
<br>
#call minimallapp.main_loop<br>
<br>
any help for this newbee would be good.<br>
thanks<br>
<font color="#888888">--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">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" target="_blank">http://rubyforge.org/mailman/listinfo/wxruby-users</a><br>
</font></blockquote></div><br>If you could, post an absolute minimal example of the app replicating this problem, full code, we can look at why this is occuring. Also, could you please state if your on Mac, Windows, or Linux?<br>
<br>Thanks<br clear="all"><br>-- <br>Mario Steele<br><a href="http://www.trilake.net">http://www.trilake.net</a><br><a href="http://www.ruby-im.net">http://www.ruby-im.net</a><br><a href="http://rubyforge.org/projects/wxruby/">http://rubyforge.org/projects/wxruby/</a><br>
<a href="http://rubyforge.org/projects/wxride/">http://rubyforge.org/projects/wxride/</a><br>