Sha256: fa006be5e000a7776cbbe2f847ff37a656dff9989701bfaf9c923ed721182c3a

Contents?: true

Size: 814 Bytes

Versions: 8

Compression:

Stored size: 814 Bytes

Contents

#!/usr/bin/env ruby
# wxRuby2 Sample Code. Copyright (c) 2004-2006 Kevin B. Smith
# Freely reusable code: see SAMPLES-LICENSE.TXT for details

begin
  require 'wx'
rescue LoadError => no_wx_err
  begin
    require 'rubygems'
    require 'wx'
  rescue LoadError
    raise no_wx_err
  end
end

class MyFrame < Wx::Frame
  def initialize(title)
    super(nil, -1, title)
  end
end

class NothingApp < Wx::App
  def on_init
    puts("in on_init")
    $frame = MyFrame.new("Minimal wxRuby App")
    puts("about to call show")
	$frame.show
    puts("returning from on_init")
    return true
  end
  
  def on_fatal_exception
    puts("on_fatal_exception")
  end
  
  def on_exit
    puts("on_exit")
    return super
  end
end

a = NothingApp.new
a.main_loop()
puts("back from main_loop...")
GC.start
puts("survived gc")

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wxruby-1.9.1-powerpc-darwin8.3.0 samples/minimal/nothing.rb
wxruby-1.9.1-i686-linux samples/minimal/nothing.rb
wxruby-1.9.1-i686-darwin8.4.1 samples/minimal/nothing.rb
wxruby-1.9.0-powerpc-darwin8.10.0 samples/minimal/nothing.rb
wxruby-1.9.0-i686-linux samples/minimal/nothing.rb
wxruby-1.9.0-i686-darwin8.4.1 samples/minimal/nothing.rb
wxruby-1.9.0-i386-mswin32 samples/minimal/nothing.rb
wxruby-1.9.1-x86_64-linux samples/minimal/nothing.rb