### In Files

- wx/classes/app.rb

### Parent

Wx::Object

### Methods

- gc_stress
- is_main_loop_running
- run

### Files

- wxruby2.lib

### Class Index

Quicksearch

- Wx
- Wx::AcceleratorTable
- Wx::Animation
- Wx::App
- Wx::ArtProvider
- Wx::AuiNotebook
- Wx::Bitmap
- Wx::BusyCursor
- Wx::CheckListBox
- Wx::Choice
- Wx::ClientDC
- Wx::Clipboard
- Wx::Colour
- Wx::ComboBox
- Wx::CommandEvent
- Wx::ControlWithItems
- Wx::DC
- Wx::Event
- Wx::EvtHandler
- Wx::Font
- Wx::Grid
- Wx::HelpController
- Wx::HelpControllerHelpProvider
- Wx::HelpProvider
- Wx::HtmlHelpController
- Wx::HtmlWindow
- Wx::Icon
- Wx::IconBundle
- Wx::Image
- Wx::ImageList
- Wx::KeywordConstructor
- Wx::KeywordConstructor::ClassMethods
- Wx::ListBox
- Wx::ListCtrl
- Wx::Locale
- Wx::MediaCtrl
- Wx::Menu
- Wx::MenuItem
- Wx::Notebook
- Wx::Object
- Wx::PaintDC
- Wx::Point
- Wx::PreviewFrame
- Wx::Rect
- Wx::RichTextCtrl
- Wx::SimpleHelpProvider
- Wx::Size
- Wx::Sizer
- Wx::Sound
- Wx::StandardPaths
- Wx::TextCtrl
- Wx::TextUrlEvent
- Wx::Timer
- Wx::ToolBar
- Wx::ToolBarTool
- Wx::TreeCtrl
- Wx::Window
- Wx::XmlResource
- Rumix
- Rumix::Application
- Rumix::Config
- Rumix::Registry
- Rumix::Widget
- Rumix::Widget::CheckOptionPanel
- Rumix::Widget::OptionItem
- Rumix::Widget::OptionPanel
- Rumix::Widget::RadioOptionPanel
- Rumix::Widget::TitleText
- ROpt
- ROpt::ArgumentParser
- ROpt::ParseResult
- Uconv
- Uconv::Error
- Enumerable
- File
- Ini
- Kernel
- Module
- Object
- Pathname
- WxConstructor
- WxRubyStyleAccessors

No matching classes.

# Wx::App

Controller class which creates and manages all windows.

### Public Class Methods

run(&block) click to toggle source

Convenience class method to create simple apps. Starts an application main_loop, setting up initial windows etc as specified in the passed block. block

    # File wx/classes/app.rb, line 10
      def self.run(&block)
        app_klass = Class.new(self)
        app_klass.class_eval do
          define_method(:on_init, &block)
        end
        the_app = app_klass.new
        the_app.main_loop
      end

### Public Instance Methods

gc_stress(interval = 1) click to toggle source

For use in development only, of no practical use in production code. This method causes Ruby’s garbage collection to run (roughly) at interval `interval` (seconds) - the default is 1, i.e. every second. This should help ferret out bugs in memory management more quickly.

    # File wx/classes/app.rb, line 39
      def gc_stress(interval = 1)
        # Ruby 1.9 provides this built-in version, but doesn't like the 1.8
        # version at all - results in frequent segfaults.
        if RUBY_VERSION >= "1.9.0"
          GC.stress
        else # Ruby 1.8
          t = Wx::Timer.new(self, 9999)
          evt_timer(9999) { Thread.pass }
          Thread.new { loop { sleep interval; GC.start } }
          t.start(100)
        end
      end

is_main_loop_running() click to toggle source

This is a class method in Wx, but permit it to be an instance method in wxRuby

    # File wx/classes/app.rb, line 21
      def is_main_loop_running
        Wx::App.is_main_loop_running
      end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.