Sha256: 6ab8354d45e685cf66662e69539c9d46b3e5e4d2dcb944990a3e756b379c6f62

Contents?: true

Size: 696 Bytes

Versions: 21

Compression:

Stored size: 696 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

21 entries across 21 versions & 1 rubygems

Version Path
wxruby3-1.5.1 tests/testapp.rb
wxruby3-1.5.0 tests/testapp.rb
wxruby3-1.4.2 tests/testapp.rb
wxruby3-1.4.1 tests/testapp.rb
wxruby3-1.4.0 tests/testapp.rb
wxruby3-1.3.1 tests/testapp.rb
wxruby3-1.3.0 tests/testapp.rb
wxruby3-1.2.1 tests/testapp.rb
wxruby3-1.2.0 tests/testapp.rb
wxruby3-1.1.2 tests/testapp.rb
wxruby3-1.1.1 tests/testapp.rb
wxruby3-1.1.0 tests/testapp.rb
wxruby3-1.0.1 tests/testapp.rb
wxruby3-0.9.8 tests/testapp.rb
wxruby3-0.9.7 tests/testapp.rb
wxruby3-0.9.5 tests/testapp.rb
wxruby3-0.9.4 tests/testapp.rb
wxruby3-0.9.3 tests/testapp.rb
wxruby3-0.9.2 tests/testapp.rb
wxruby3-0.9.1 tests/testapp.rb