Sha256: 4511df469046c868de08e19f9eb15eef09d828353754b7bc0647eb1c9eb2a0c0

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8
require 'Context/Context'
require 'Context/Bridge'
require 'Context/View'

module JLDrill

	class ShowInfoContext < Context::Context
		
		def initialize(viewBridge)
			super(viewBridge)
		end

        class InfoView < Context::View

            def initialize(context)
                super(context)
            end

            # Destroy the info window
            def destroy
                # Please define in the concrete class
            end

            # Display the info to the user
            def run(info)
                @info = info
                # Please run super() and then define the rest
                # of the method in the concrete class
            end
        end

		def createViews
    		@mainView = @viewBridge.InfoView.new(self)
        end

        def destroyViews
            @mainView.destroy if !@mainView.nil?
            @mainView = nil
        end		    
		
		def enter(parent, info)
		    super(parent)
            @mainView.run(info)
    		self.exit
		end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.6.0.1 lib/jldrill/contexts/ShowInfoContext.rb