Sha256: 75ebda901159080c2946837b4602be1cec94212353cbba4d988a251188d90112

Contents?: true

Size: 735 Bytes

Versions: 7

Compression:

Stored size: 735 Bytes

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

require 'test/unit'
require 'wx'

class TestingFrame < Wx::Frame
    def initialize
        super(nil, -1, '')
        evt_paint { on_paint }
    end

    def on_paint
        paint {}
        close
    end
end

class AppWithSimpleFrame < Wx::App
    attr_reader(:did_call_on_exit)

    def on_init
        TestingFrame.new.show
    end

    def on_exit
        @did_call_on_exit = true
        return 0
    end
end

class TestApp < Test::Unit::TestCase
  def test_self_closing_frame
    o = AppWithSimpleFrame.new
    o.run
    assert(o.did_call_on_exit, "didn't call on_exit?")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wxruby3-0.9.7-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.5-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.4-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.3-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.2-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.1-x64-mingw-ucrt tests/testapp.rb
wxruby3-0.9.0-x64-mingw-ucrt tests/testapp.rb