Module: GtkAttributes

Instance Method Summary collapse

Instance Method Details

#default_attribute(gtk_attr) ⇒ Object



48
49
50
# File 'lib/GtkAttributes.rb', line 48

def default_attribute(gtk_attr)
	GtkAttributeStorage.instance.gtk_attribute(gtk_attr, "0", gtkobjecttype)
end

#gtk_attribute(gtk_attr) ⇒ Object



36
37
38
# File 'lib/GtkAttributes.rb', line 36

def gtk_attribute(gtk_attr)
	GtkAttributeStorage.instance.gtk_attribute(gtk_attr, gtkobjectid, gtkobjecttype) || GtkAttributeStorage.instance.gtk_attribute(gtk_attr, "0", gtkobjecttype)
end

#gtk_attribute_of_object(gtk_attr, gtkobject_id, gtkobject_type) ⇒ Object



40
41
42
# File 'lib/GtkAttributes.rb', line 40

def gtk_attribute_of_object(gtk_attr,gtkobject_id,gtkobject_type)
	GtkAttributeStorage.instance.gtk_attribute(gtk_attr, gtkobject_id, gtkobject_type)
end

#gtkobjectidObject



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/GtkAttributes.rb', line 52

def gtkobjectid
	case self.class.name
		when "MyEditableList" then list_id.to_s
		when "MyColumn" then header["id"].to_s
		when "Myform::MyForm" then get_id.to_s
		when "MyButton"	then properties["id"].to_s
		when "MyInputHolder","MyRendererList::List","MyRendererCombo","MyRendererConstCombo","FieldCombo" then item["id"].to_s
		else 
		edebug("unsupported class in gtk_attributes: #{self.class.name} for #{self}","main","error")
	end
end

#gtkobjecttypeObject



64
65
66
67
68
69
70
71
72
73
# File 'lib/GtkAttributes.rb', line 64

def gtkobjecttype
	case self.class.name
		when "MyEditableList" then "list"
		when "MyColumn" then "list_column"
		when "Myform::MyForm" then "form"
		when "MyButton" then "list-button"
		when "MyInputHolder","MyRendererList::List","MyRendererCombo","MyRendererConstCombo","FieldCombo" then "form-item"
		else edebug("unsupported class in gtk_attributes: #{self.class.name} for #{self}","main","error")
	end
end

#set_gtk_attribute(gtk_attr, gtk_attr_value) ⇒ Object



44
45
46
# File 'lib/GtkAttributes.rb', line 44

def set_gtk_attribute(gtk_attr,gtk_attr_value)
	GtkAttributeStorage.instance.set_gtk_attribute(gtk_attr,gtk_attr_value, gtkobjectid, gtkobjecttype)
end