Sha256: 4febbb301f833feea543b7dc3e5b4d6d20c9e6e671b7fd053f7c10e50a0cfa45

Contents?: true

Size: 868 Bytes

Versions: 1

Compression:

Stored size: 868 Bytes

Contents

require 'jldrill/views/gtk/widgets/StatisticsWindow'
require 'jldrill/contexts/ShowStatisticsContext'
require 'jldrill/model/Quiz/Quiz'
require 'gtk2'

module JLDrill::Gtk
	class StatisticsView < JLDrill::ShowStatisticsContext::StatisticsView
        attr_reader :statisticsWindow
        	
		def initialize(context)
			super(context)
			@statisticsWindow = StatisticsWindow.new(self)
		end
		
		def getWidget
			@statisticsWindow
		end
		
        def destroy
            @statisticsWindow.explicitDestroy
        end
		
		def emitDestroyEvent
			@statisticsWindow.signal_emit("destroy")
		end
		
		def update(quiz)
		    super(quiz)
            table = quiz.strategy.stats.statsTable
		    @statisticsWindow.updateDuration(table)
		    @statisticsWindow.updateAccuracy(quiz.strategy.stats)
		    @statisticsWindow.updateRate(quiz.strategy.stats)
		end
    end   
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.5.1.7 lib/jldrill/views/gtk/StatisticsView.rb