Class: MyTouchWindow::TouchButton
- Inherits:
-
Gtk::Button
- Object
- Gtk::Button
- MyTouchWindow::TouchButton
- Defined in:
- lib/mytouchwindow.rb
Instance Method Summary collapse
-
#initialize(label, left, right, top, bottom, parent) ⇒ TouchButton
constructor
A new instance of TouchButton.
Constructor Details
#initialize(label, left, right, top, bottom, parent) ⇒ TouchButton
Returns a new instance of TouchButton.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mytouchwindow.rb', line 13 def initialize(label,left,right,top,bottom,parent) super(label) parent.attach(self,left,right,top,bottom,Gtk::FILL|Gtk::EXPAND,Gtk::FILL|Gtk::EXPAND,1,1) set_name("TouchButton") set_focus_on_click(false).set_can_focus(false) signal_connect('clicked'){|me| focused=me.get_ancestor(MyTouchWindow).focus if focused.class.name=="MyRendererText" case label when "<-" focused.text=focused.text.chop else focused.text=focused.text+label end end } end |