Class: OrderingButton

Inherits:
Gtk::Button
  • Object
show all
Includes:
Conf
Defined in:
lib/ListHolder/ListButtonHolder/OrderingButton.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Instance Method Summary collapse

Methods included from Conf

#get_conf, #load_conf, #save_conf, #set_conf

Constructor Details

#initialize(list_holder, orientation) ⇒ OrderingButton

Returns a new instance of OrderingButton.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ListHolder/ListButtonHolder/OrderingButton.rb', line 7

def initialize(list_holder,orientation)
	@list_holder=list_holder
	@orientation=orientation
	super()
	set_relief(Gtk::ReliefStyle::NONE)
	set_image(Gtk::Image.new(@orientation,Gtk::IconSize.from_name(get_conf(0,0,"button-size"))))
	signal_connect('clicked'){|me|
		@list_holder.list.list_model.move_up_id(@list_holder.list.get_cursor_id) if @orientation == Gtk::Stock::GO_UP
		@list_holder.list.list_model.move_down_id(@list_holder.list.get_cursor_id) if @orientation == Gtk::Stock::GO_DOWN
	}
end

Instance Method Details

#to_sObject



22
23
24
# File 'lib/ListHolder/ListButtonHolder/OrderingButton.rb', line 22

def to_s
	"OrderingButton of #{@list_holder}"
end

#updateObject



18
19
20
21
# File 'lib/ListHolder/ListButtonHolder/OrderingButton.rb', line 18

def update
	set_no_show_all(@list_holder.list.gtk_attribute("ordering").nil?)
	set_visible(!@list_holder.list.gtk_attribute("ordering").nil?)
end