34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/jldrill/views/gtk/widgets/ToolBarWidget.rb', line 34
def initialize(view)
@view = view
@context = @view.context
super()
@reviewModeButton = ReviewModeButton.new(@view)
checkImage = Gtk::Image.new(Gtk::Stock::SPELL_CHECK,
Gtk::IconSize::SMALL_TOOLBAR)
incorrectImage = Gtk::Image.new(Gtk::Stock::NO,
Gtk::IconSize::SMALL_TOOLBAR)
correctImage = Gtk::Image.new(Gtk::Stock::YES,
Gtk::IconSize::SMALL_TOOLBAR)
refreshImage = Gtk::Image.new(Gtk::Stock::REFRESH,
Gtk::IconSize::SMALL_TOOLBAR)
self.append(Gtk::Stock::SAVE,
"Save a Drill file"
) do @context.save end
self.append(Gtk::Stock::OPEN,
"Open a Edict file"
) do @context.open end
self.append(Gtk::Stock::QUIT,
"Quit GTK LDrill"
) do @context.quit end
self.append_space
self.append("Check (Z)", "Check",
"Check the result", checkImage
) do @context.check end
self.append("Incorrect (X)", "Incorrect",
"Answer was incorrect", incorrectImage
) do @context.incorrect end
self.append("Correct (C)", "Correct",
"Answer was correct", correctImage
) do @context.correct end
self.append("Next (N)", "Next Problem",
"Go to a new problem without answering the current one", refreshImage
) do @context.drill end
self.append_space
self.append(@reviewModeButton)
end
|