Class: Tool
- Inherits:
-
Object
- Object
- Tool
- Defined in:
- lib/midinous/style/ui.rb
Instance Attribute Summary collapse
-
#tool_id ⇒ Object
readonly
Returns the value of attribute tool_id.
Instance Method Summary collapse
-
#initialize ⇒ Tool
constructor
A new instance of Tool.
- #set_tool(id) ⇒ Object
Constructor Details
#initialize ⇒ Tool
Returns a new instance of Tool.
711 712 713 |
# File 'lib/midinous/style/ui.rb', line 711 def initialize @tool_id = 1 end |
Instance Attribute Details
#tool_id ⇒ Object (readonly)
Returns the value of attribute tool_id.
710 711 712 |
# File 'lib/midinous/style/ui.rb', line 710 def tool_id @tool_id end |
Instance Method Details
#set_tool(id) ⇒ Object
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
# File 'lib/midinous/style/ui.rb', line 714 def set_tool(id) @tool_id = id unless @tool_id == 4 UI::path_builder.sensitive = false end case when @tool_id == 1 UI::main_tool_1.active = true UI::tool_descrip.text = "Select" UI::canvas.queue_draw when @tool_id == 2 UI::main_tool_2.active = true UI::tool_descrip.text = "Place" UI::canvas.queue_draw when @tool_id == 3 UI::main_tool_3.active = true UI::tool_descrip.text = "Move" UI::canvas.queue_draw when @tool_id == 4 UI::main_tool_4.active = true UI::path_builder.sensitive = true UI::tool_descrip.text = "Path" UI::canvas.queue_draw end end |