public Method

Window.evt_paint(meth = nil, &block)

This modified version of evt_paint sets a variable indicating that a paint event is being handled just before running the event handler. This ensures that any call to Window#paint within the handler will supply a Wx::PaintDC (see swig/Window.i).

Source Code

# File wx/classes/window.rb, line 40
def evt_paint(meth = nil, &block)
  paint_proc = acquire_handler(meth, block)
  wrapped_block = proc do | event |
    instance_variable_set("@__painting__", true)
    paint_proc.call(event)
    remove_instance_variable("@__painting__")
  end
  __old_evt_paint(&wrapped_block)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.