Sha256: 7ac4fdc5c5f4920599f6f8bc78479b9a146b697a2dc970ca42222eaa716d4345

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

# encoding: utf-8
require 'jldrill/contexts/DisplayProblemContext'
require 'jldrill/views/gtk/widgets/VocabularyHintBox'
require 'gtk2'

module JLDrill::Gtk

	class ItemHintView < JLDrill::DisplayProblemContext::ProblemView::ItemHintView

        attr_reader :hintBox
        	
		def initialize(context)
            super(context)
            @hintBox = VocabularyHintBox.new
        end

        def getWidget
            @hintBox
        end

        def mainWindow
            getWidget.gtkWidgetMainWindow
        end

        # Update the indicators
        def update(problem)
            if !problem.nil?  && !problem.item.nil?
                hintBox.set(problem.item.to_o, @context.differs?(problem))
            else
                hintBox.clear
            end
        end

        def newProblem(problem)
            super(problem)
            update(problem)
        end

        def updateProblem(problem)
            super(problem)
            update(problem)
        end

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.6.0.1 lib/jldrill/views/gtk/ItemHintView.rb