class Tk::Iwidgets::Notebook
Constants
- TkCommandNames
- WidgetClassName
Public Instance Methods
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 62 def add(keys={}) window(tk_call(@path, 'add', *hash_kv(keys))) end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 70 def child_site(idx) if (new_idx = self.index(idx)) < 0 new_idx = tagid(idx) end window(tk_call(@path, 'childsite', new_idx)) end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 66 def child_site_list list(tk_call(@path, 'childsite')) end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 77 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
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 92 def index(idx) number(tk_call(@path, 'index', tagid(idx))) end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 96 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
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 103 def next tk_call(@path, 'next') self end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 108 def prev tk_call(@path, 'prev') self end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 121 def scrollcommand(cmd=nil, &block) configure_cmd('scrollcommand', cmd || block) self end
Also aliased as: xscrollcommand, yscrollcommand
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 113 def select(idx) if (new_idx = self.index(idx)) < 0 new_idx = tagid(idx) end tk_call(@path, 'select', new_idx) self end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 36 def tagid(tagOrId) if tagOrId.kind_of?(Tk::Itk::Component) tagOrId.name else #_get_eval_string(tagOrId) tagOrId end end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 150 def view(*idxs) if idxs.size == 0 idx = num_or_str(tk_send_without_enc('view')) if idx.kind_of?(Fixnum) && idx < 0 nil else idx end else tk_send_without_enc('view', *idxs) self end end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 166 def view_moveto(*idxs) view('moveto', *idxs) end
Also aliased as: xview_moveto, yview_moveto
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 171 def view_scroll(index, what='pages') view('scroll', index, what) end
Also aliased as: xview_scroll, yview_scroll
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 128 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
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 138 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
Also aliased as: scrollbar
Private Instance Methods
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 57 def __boolval_optkeys super() << 'auto' end
Calls superclass method
TkConfigMethod#__boolval_optkeys
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 26 def __item_cget_cmd(id) [self.path, 'pagecget', id] end
Source
# File lib/tkextlib/iwidgets/notebook.rb, line 31 def __item_config_cmd(id) [self.path, 'pageconfigure', id] end