# File tk/lib/tkextlib/iwidgets/notebook.rb, line 59
def add(keys={})
window(tk_call(@path, 'add', *hash_kv(keys)))
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 67
def child_site(idx)
if (new_idx = self.index(idx)) < 0
new_idx = tagid(idx)
end
window(tk_call(@path, 'childsite', new_idx))
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 63
def child_site_list
list(tk_call(@path, 'childsite'))
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 74
def delete(idx1, idx2=nil)
if (new_idx1 = self.index(idx1)) < 0
new_idx1 = tagid(idx1)
end
if idx2
if (new_idx2 = self.index(idx2)) < 0
new_idx2 = tagid(idx2)
end
tk_call(@path, 'delete', new_idx1, new_idx2)
else
tk_call(@path, 'delete', new_idx1)
end
self
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 89
def index(idx)
number(tk_call(@path, 'index', tagid(idx)))
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 93
def insert(idx, keys={})
if (new_idx = self.index(idx)) < 0
new_idx = tagid(idx)
end
window(tk_call(@path, 'insert', new_idx, *hash_kv(keys)))
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 100
def next
tk_call(@path, 'next')
self
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 105
def prev
tk_call(@path, 'prev')
self
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 118
def scrollcommand(cmd=Proc.new)
configure_cmd 'scrollcommand', cmd
self
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 110
def select(idx)
if (new_idx = self.index(idx)) < 0
new_idx = tagid(idx)
end
tk_call(@path, 'select', new_idx)
self
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 35
def tagid(tagOrId)
if tagOrId.kind_of?(Tk::Itk::Component)
tagOrId.name
else
#_get_eval_string(tagOrId)
tagOrId
end
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 147
def view(*idxs)
if idxs.size == 0
window(tk_send_without_enc('view'))
else
tk_send_without_enc('view', *idxs)
self
end
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 158
def view_moveto(*idxs)
view('moveto', *idxs)
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 163
def view_scroll(*idxs)
view('scroll', *idxs)
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 125
def xscrollbar(bar=nil)
if bar
@scrollbar = bar
@scrollbar.orient 'horizontal'
self.scrollcommand {|*arg| @scrollbar.set(*arg)}
@scrollbar.command {|*arg| self.xview(*arg)}
Tk.update # avoid scrollbar trouble
end
@scrollbar
end
# File tk/lib/tkextlib/iwidgets/notebook.rb, line 135
def yscrollbar(bar=nil)
if bar
@scrollbar = bar
@scrollbar.orient 'vertical'
self.scrollcommand {|*arg| @scrollbar.set(*arg)}
@scrollbar.command {|*arg| self.yview(*arg)}
Tk.update # avoid scrollbar trouble
end
@scrollbar
end