gtk2_treeview_settings 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gtk2_treeview_settings}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = %q{2012-08-22}
12
+ s.date = %q{2012-08-26}
13
13
  s.description = %q{A gem that helps with ordering of columns and more.}
14
14
  s.email = %q{k@spernj.org}
15
15
  s.extra_rdoc_files = [
@@ -1,9 +1,17 @@
1
+ #This class handels appending and reading data from a treeview with dynamic columns. It tracks the columns based on given symbol-IDs.
2
+ #===Examples
3
+ # @tv_settings = Gtk2_treeview_settings.new(
4
+ # :tv => @gui["tvTimelogs"],
5
+ # :col_ids => {
6
+ # 0 => :id,
7
+ # 1 => :name
8
+ # }
9
+ # )
1
10
  class Gtk2_treeview_settings
2
11
  attr_reader :tv
3
12
 
4
13
  def initialize(args)
5
14
  @args = args
6
-
7
15
  @tv = @args[:tv]
8
16
 
9
17
  #Set the initial order of the columns so we can recognize them later.
@@ -57,6 +65,9 @@ class Gtk2_treeview_settings
57
65
  raise "Could not find column number by that ID: '#{id}'."
58
66
  end
59
67
 
68
+ #Appends the given data to the treeview. Only works with Gtk::ListStore.
69
+ #===Examples
70
+ # gset.append(:id => 0, :name => "Kasper") #=> {:iter => Gtk::TreeIter-object}
60
71
  def append(data)
61
72
  if @tv.model.is_a?(Gtk::TreeStore)
62
73
  iter = @tv.model.append(nil)
@@ -84,6 +95,9 @@ class Gtk2_treeview_settings
84
95
  return {:iter => iter}
85
96
  end
86
97
 
98
+ #Appens the given data the the treeview in hash-form which gives the posibility for a parent element when using TreeStore.
99
+ #===Examples
100
+ # gset.append_adv(:parent => parent_iter, :data => {:id => 0, :name => "Kasper"}) #=> {:iter => Gtk::TreeIter-object}
87
101
  def append_adv(args)
88
102
  if @tv.model.is_a?(Gtk::TreeStore)
89
103
  iter = @tv.model.append(args[:parent])
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gtk2_treeview_settings
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-08-22 00:00:00 +02:00
13
+ date: 2012-08-26 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
- hash: -2671215643587821271
107
+ hash: 342797625950162940
108
108
  segments:
109
109
  - 0
110
110
  version: "0"