class Tk::BLT::Tabset
Constants
- TkCommandNames
- WidgetClassName
Public Instance Methods
__boolval_optkeys()
click to toggle source
Calls superclass method
TkConfigMethod#__boolval_optkeys
# File lib/tkextlib/blt/tabset.rb, line 218 def __boolval_optkeys super() << 'samewidth' << 'tearoff' end
__destroy_hook__()
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 210 def __destroy_hook__ Tk::BLT::Tabset::Tab::TabID_TBL.mutex.synchronize{ Tk::BLT::Tabset::Tab::TabID_TBL.delete(@path) } end
activate(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 277 def activate(index) tk_send('activate', tagindex(index)) self end
Also aliased as: highlight
delete(first, last=None)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 312 def delete(first, last=None) tk_send('delete', tagindex(first), tagindex(last)) if first.kind_of?(Tk::BLT::Tabset::Tab) TabID_TBL.mutex.synchronize{ TabID_TBL[@path].delete(first.id) } end # middle tabs of the range are unknown if last.kind_of?(Tk::BLT::Tabset::Tab) TabID_TBL.mutex.synchronize{ TabID_TBL[@path].delete(last.id) } end self end
focus(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 328 def focus(index) tk_send('focus', tagindex(index)) self end
get_tab(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 333 def get_tab(index) if (idx = tk_send_without_enc('get', tagindex(index))).empty? nil else Tk::BLT::Tabset::Tab.id2obj(self, idx) end end
get_tabobj(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 340 def get_tabobj(index) if (idx = tk_send_without_enc('get', tagindex(index))).empty? nil else Tk::BLT::Tabset::Tab.new(self, nil, name, {}) end end
index(str)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 348 def index(str) num_or_str(tk_send('index', str)) end
index_name(tab)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 351 def index_name(tab) num_or_str(tk_send('index', '-name', tagid(tab))) end
insert(pos, tab, keys={})
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 355 def insert(pos, tab, keys={}) pos = 'end' if pos.nil? Tk::BLT::Tabset::Tab.new(self, tagindex(pos), tagid(tab), keys) end
insert_tabs(pos, *tabs)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 359 def insert_tabs(pos, *tabs) pos = 'end' if pos.nil? if tabs[-1].kind_of?(Hash) keys = tabs.pop else keys = {} end fail ArgumentError, 'no tabs is given' if tabs.empty? tabs.map!{|tab| tagid(tab)} tk_send('insert', tagindex(pos), *(tabs + [keys])) tabs.collect{|tab| Tk::BLT::Tabset::Tab.new(self, nil, tagid(tab))} end
invoke(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 372 def invoke(index) tk_send('invoke', tagindex(index)) end
move_after(index, base_idx)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 380 def move_after(index, base_idx) tk_send('move', tagindex(index), 'after', tagindex(base_idx)) self end
move_before(index, base_idx)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 376 def move_before(index, base_idx) tk_send('move', tagindex(index), 'before', tagindex(base_idx)) self end
nearest(x, y)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 385 def nearest(x, y) Tk::BLT::Tabset::Tab.id2obj(self, num_or_str(tk_send_without_enc('nearest', x, y))) end
perforation_activate(mode)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 389 def perforation_activate(mode) tk_send('perforation', 'activate', mode) self end
perforation_highlight(index, *args)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 393 def perforation_highlight(index, *args) if args.empty? # index --> mode tk_send('perforation', 'highlight', index) elsif args.size == 1 # args[0] --> mode tk_send('perforation', 'highlight', tagindex(index), args[0]) else # Error: call to get Tcl's error message tk_send('perforation', 'highlight', tagindex(index), *args) end self end
perforation_invoke(index=nil)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 405 def perforation_invoke(index=nil) if index tk_send('perforation', 'invoke', tagindex(index)) else tk_send('perforation', 'invoke') end end
scan_dragto(x, y)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 417 def scan_dragto(x, y) tk_send_without_enc('scan', 'dragto', x, y) self end
scan_mark(x, y)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 413 def scan_mark(x, y) tk_send_without_enc('scan', 'mark', x, y) self end
see(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 422 def see(index) tk_send('see', tagindex(index)) self end
select(index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 431 def select(index) tk_send('select', tagindex(index)) self end
size()
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 427 def size() number(tk_send_without_enc('size')) end
tab_dockall()
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 436 def tab_dockall tk_send('tab', 'dockall') self end
tab_ids(pat=None)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 453 def tab_ids(pat=None) simplelist(tk_send('tab', 'names', pat)) end
tab_names(pat=None)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 441 def tab_names(pat=None) simplelist(tk_send('tab', 'names', pat)).collect{|name| Tk::BLT::Tabset::Tab.id2obj(self, name) } end
tab_objs(pat=None)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 447 def tab_objs(pat=None) simplelist(tk_send('tab', 'names', pat)).collect{|name| Tk::BLT::Tabset::Tab.new(self, nil, name, {}) } end
tab_pageheight()
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 457 def tab_pageheight number(tk_send('tab', 'pageheight')) end
tab_pagewidth()
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 461 def tab_pagewidth number(tk_send('tab', 'pagewidth')) end
tab_tearoff(index, parent=None)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 465 def tab_tearoff(index, parent=None) window(tk_send('tab', 'tearoff', tagindex(index), parent)) end
tabbind(tag, context, *args, &block)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 283 def tabbind(tag, context, *args, &block) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) if TkComm._callback_entry?(args[0]) || !block cmd = args.shift else cmd = block end _bind([path, "bind", tagid(tag)], context, cmd, *args) self end
tabbind_append(tag, context, *args, &block)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 294 def tabbind_append(tag, context, *args, &block) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) if TkComm._callback_entry?(args[0]) || !block cmd = args.shift else cmd = block end _bind_append([path, "bind", tagid(tag)], context, cmd, *args) self end
tabbind_remove(tag, context)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 304 def tabbind_remove(tag, context) _bind_remove([path, "bind", tagid(tag)], context) self end
tabbindinfo(tag, context=nil)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 308 def tabbindinfo(tag, context=nil) _bindinfo([path, "bind", tagid(tag)], context) end
tagid(tab)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 259 def tagid(tab) if tab.kind_of?(Tk::BLT::Tabset::Tab) tab.id else tab end end
tagindex(tab)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 267 def tagindex(tab) if tab.kind_of?(Tk::BLT::Tabset::Tab) tab.index else tab end end
xscrollcommand(cmd=nil, &block)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 469 def xscrollcommand(cmd=nil, &block) configure_cmd('scrollcommand', cmd || block) self end
Also aliased as: scrollcommand
xview(*index)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 475 def xview(*index) if index.empty? list(tk_send_without_enc('view')) else tk_send_without_enc('view', *index) self end end
Also aliased as: view
Private Instance Methods
__item_cget_cmd(id)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 228 def __item_cget_cmd(id) [self.path, 'tab', 'cget', id] end
__item_config_cmd(id)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 233 def __item_config_cmd(id) [self.path, 'tab', 'configure', id] end
__item_pathname(tagOrId)
click to toggle source
# File lib/tkextlib/blt/tabset.rb, line 238 def __item_pathname(tagOrId) if tagOrId.kind_of?(Tk::BLT::Tabset::Tab) self.path + ';' + tagOrId.id.to_s else self.path + ';' + tagOrId.to_s end end
__item_strval_optkeys(id)
click to toggle source
Calls superclass method
# File lib/tkextlib/blt/tabset.rb, line 254 def __item_strval_optkeys(id) super(id) << 'shadow' end
__strval_optkeys()
click to toggle source
Calls superclass method
TkConfigMethod#__strval_optkeys
# File lib/tkextlib/blt/tabset.rb, line 223 def __strval_optkeys super() << 'tabbackground' << 'tabforeground' end