Class: JLDrill::Gtk::ItemHintView

Inherits:
DisplayProblemContext::ProblemView::ItemHintView show all
Defined in:
lib/jldrill/views/gtk/ItemHintView.rb

Instance Attribute Summary collapse

Attributes inherited from Context::View

#context

Instance Method Summary collapse

Methods inherited from DisplayProblemContext::ProblemView::ItemHintView

#differs?

Methods inherited from Context::View

#addView, #removeView, #removingViewFrom, #viewAddedTo

Constructor Details

#initialize(context) ⇒ ItemHintView

Returns a new instance of ItemHintView.



12
13
14
15
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 12

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

Instance Attribute Details

#hintBoxObject (readonly)

Returns the value of attribute hintBox.



10
11
12
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 10

def hintBox
  @hintBox
end

Instance Method Details

#getWidgetObject



17
18
19
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 17

def getWidget
    @hintBox
end

#mainWindowObject



21
22
23
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 21

def mainWindow
    getWidget.gtkWidgetMainWindow
end

#newProblem(problem) ⇒ Object



34
35
36
37
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 34

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

#update(problem) ⇒ Object

Update the indicators



26
27
28
29
30
31
32
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 26

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

#updateProblem(problem) ⇒ Object



39
40
41
42
# File 'lib/jldrill/views/gtk/ItemHintView.rb', line 39

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