Class: Tk::BLT::Treeview

Inherits:
TkWindow show all
Includes:
ConfigMethod, ItemValidateConfigure, Scrollable, ValidateConfigure
Defined in:
ext/lib/tkextlib/blt/treeview.rb,
ext/lib/tkextlib/blt/treeview.rb

Direct Known Subclasses

Hiertable

Defined Under Namespace

Modules: ConfigMethod, TagOrID_Methods Classes: FindExecFlagValue, Node, OpenCloseCommand, Tag

Constant Summary collapse

TkCommandNames =
['::blt::treeview'.freeze].freeze
WidgetClassName =
'TreeView'.freeze

Constants included from TkUtil

TkUtil::None, TkUtil::RELEASE_DATE

Constants included from Tk

AUTO_PATH, Checkbutton, CloneMenu, JAPANIZED_TK, LIBRARY_PATH, Labelframe, MenuButton, OptionMenuButton, PACKAGE_PATH, Panedwindow, RELEASE_DATE, Radiobutton, TCL_LIBRARY_PATH, TCL_MAJOR_VERSION, TCL_MINOR_VERSION, TCL_PACKAGE_PATH, TCL_PATCHLEVEL, TCL_PRECISION, TCL_VERSION, TK_MAJOR_VERSION, TK_MINOR_VERSION, TK_PATCHLEVEL, TK_VERSION, Tkextlib_RELEASE_DATE, TreeCtrl_Widget, X_Scrollable, Y_Scrollable

Constants included from Encoding

Encoding::BINARY, Encoding::BINARY_NAME, Encoding::DEFAULT_EXTERNAL_NAME, Encoding::DEFAULT_INTERNAL_NAME, Encoding::ENCODING_TABLE, Encoding::RubyEncoding, Encoding::UNKNOWN, Encoding::UTF8_NAME

Constants included from TkCore

TkCore::EventFlag, TkCore::INTERP, TkCore::INTERP_MUTEX, TkCore::INTERP_ROOT_CHECK, TkCore::INTERP_THREAD, TkCore::INTERP_THREAD_STATUS, TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD, TkCore::WIDGET_DESTROY_HOOK, TkCore::WITH_ENCODING, TkCore::WITH_RUBY_VM

Constants included from TkComm

TkComm::GET_CONFIGINFO_AS_ARRAY, TkComm::GET_CONFIGINFOwoRES_AS_ARRAY, TkComm::TkExtlibAutoloadModule, TkComm::Tk_CMDTBL, TkComm::Tk_IDs, TkComm::Tk_WINDOWS, TkComm::USE_TCLs_LIST_FUNCTIONS, TkComm::WidgetClassNames

Constants included from TkDND::Shape

TkDND::Shape::PACKAGE_NAME

Instance Method Summary collapse

Methods included from ConfigMethod

#button_cget, #button_cget_strict, #button_configinfo, #button_configure, #column_cget, #column_cget_strict, #column_configinfo, #column_configure, #current_button_configinfo, #current_column_configinfo, #current_entry_configinfo, #current_sort_configinfo, #current_text_configinfo, #entry_cget, #entry_cget_strict, #entry_configinfo, #entry_configure, #sort_cget, #sort_cget_strict, #sort_configinfo, #sort_configure, #text_cget, #text_cget_strict, #text_configinfo, #text_configure

Methods included from TkItemConfigMethod

__IGNORE_UNKNOWN_CONFIGURE_OPTION__, #__check_available_itemconfigure_options, #__current_itemconfiginfo, __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!, #current_itemconfiginfo, #itemcget, #itemcget_strict, #itemconfiginfo, #itemconfigure

Methods included from TkItemConfigOptkeys

#__conv_item_keyonly_opts, #itemconfig_hash_kv

Methods included from TkUtil

_conv_args, #_conv_args, #_fromUTF8, _get_eval_enc_str, #_get_eval_enc_str, #_get_eval_string, _get_eval_string, _symbolkey2str, #_symbolkey2str, #_toUTF8, bool, #bool, callback, eval_cmd, #hash_kv, hash_kv, install_cmd, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd

Methods included from TkTreatItemFont

#kanjifont_copy, #kanjitagfont_configure, #latintagfont_configure, #latintagfont_copy, #tagfont_configinfo, #tagfont_configure, #tagfont_copy

Methods included from ItemValidateConfigure

#__conv_item_vcmd_on_hash_kv, __def_validcmd, #__get_item_validate_key2class, #__item_validcmd_call, #itemconfigure

Methods included from ValidateConfigure

#__conv_vcmd_on_hash_kv, __def_validcmd, #__get_validate_key2class, #__validcmd_call, #configure

Methods included from Scrollable

#autoscroll, #unautoscroll

Methods included from YScrollable

#yscrollbar, #yscrollcommand, #yview, #yview_moveto, #yview_scroll

Methods included from XScrollable

#xscrollbar, #xscrollcommand, #xview, #xview_moveto, #xview_scroll

Methods inherited from TkWindow

_widget_inspect_full_=, _widget_inspect_full_?, #bind_class, #bindtags, #bindtags=, #bindtags_shift, #bindtags_unshift, #caret, #colormodel, #command, #cursor_propagate, #cursor_restore, database_class, #database_class, #database_classname, database_classname, #destroy, #eventloop_wait_destroy, #eventloop_wait_visibility, #exist?, #grab, #grab_current, #grab_release, #grab_set, #grab_set_global, #grab_status, #grid, #grid_anchor, #grid_bbox, #grid_column, #grid_columnconfig, #grid_columnconfiginfo, #grid_config, #grid_forget, #grid_in, #grid_info, #grid_location, #grid_propagate, #grid_remove, #grid_row, #grid_rowconfig, #grid_rowconfiginfo, #grid_size, #grid_slaves, #initialize, #inspect, #lower, #pack, #pack_config, #pack_forget, #pack_in, #pack_info, #pack_propagate, #pack_slaves, #place, #place_config, #place_configinfo, #place_forget, #place_in, #place_info, #place_slaves, #raise, #set_focus, #thread_wait_destroy, #thread_wait_visibility, #tktrans_get_image, #tktrans_set_image, to_eval, #wait_destroy, #wait_visibility

Methods included from TkBindCore

#bind, #bind_append, #bind_remove, #bindinfo

Methods included from TkWinfo

appname, atom, atomname, cells, children, classname, colormapfull, containing, depth, exist?, fpixels, geometry, height, id, interps, manager, mapped?, parent, pixels, pointerx, pointerxy, pointery, reqheight, reqwidth, rgb, rootx, rooty, screen, screencells, screendepth, screenheight, screenmmheight, screenmmwidth, screenvisual, screenwidth, server, toplevel, viewable, visual, visualid, visualsavailable, vrootheight, vrootwidth, vrootx, vrooty, widget, width, #winfo_appname, #winfo_atom, #winfo_atomname, #winfo_cells, #winfo_children, #winfo_classname, #winfo_colormapfull, #winfo_containing, #winfo_depth, #winfo_exist?, #winfo_fpixels, #winfo_geometry, #winfo_height, #winfo_id, #winfo_interps, #winfo_manager, #winfo_mapped?, #winfo_parent, #winfo_pixels, #winfo_pointerx, #winfo_pointerxy, #winfo_pointery, #winfo_reqheight, #winfo_reqwidth, #winfo_rgb, #winfo_rootx, #winfo_rooty, #winfo_screen, #winfo_screencells, #winfo_screendepth, #winfo_screenheight, #winfo_screenmmheight, #winfo_screenmmwidth, #winfo_screenvisual, #winfo_screenwidth, #winfo_server, #winfo_toplevel, #winfo_viewable, #winfo_visual, #winfo_visualid, #winfo_visualsavailable, #winfo_vrootheight, #winfo_vrootwidth, #winfo_vrootx, #winfo_vrooty, #winfo_widget, #winfo_width, #winfo_x, #winfo_y, x, y

Methods included from Tk

BinaryString, EncodedString, #Grid, #Pack, #Place, UTF8_String, __set_toplevel_aliases__, add_kinsoku, bell, bell_on_display, const_missing, current_grabs, cursor_display, default_widget_set, default_widget_set=, delete_kinsoku, destroy, errorCode, errorInfo, exit, focus, focus_lastfor, focus_next, focus_prev, focus_to, fromUTF8, grid, grid_forget, has_mainwindow?, load_tcllibrary, load_tclscript, load_tclscript_rsrc, load_tclscript_rsrcid, lower_window, pack, pack_forget, pkgconfig_get, pkgconfig_list, place, place_forget, raise_window, #root, show_kinsoku, sleep, strictMotif, subst_tk_backslash, subst_utf_backslash, tcl_pkgconfig_get, tcl_pkgconfig_list, thread_update, thread_update_idletasks, tk_pkgconfig_get, tk_pkgconfig_list, toUTF8, to_backslash_sequence, ungrid, unload_tcllibrary, unpack, unplace, #update, update, update_idletasks, utf_to_backslash, utf_to_backslash_sequence, wakeup

Methods included from Encoding

#default_encoding=, #encoding=, #encoding_convertfrom, #encoding_convertto, #encoding_dirs, #encoding_dirs=, #encoding_name, #encoding_names, #encoding_obj, #encoding_objs, #encoding_system=, #encoding_system_name, #encoding_system_obj, #force_default_encoding, #force_default_encoding=, #force_default_encoding?, #tk_encoding_names

Methods included from TkCore

#_tk_call_to_list_core, #after, #after_cancel, #after_idle, #appname, #appsend, #appsend_deny, #appsend_displayof, callback, #callback_break, #callback_continue, #callback_return, #chooseColor, #chooseDirectory, #do_one_event, #event_generate, #getMultipleOpenFile, #getMultipleSaveFile, #getOpenFile, #getSaveFile, #get_eventloop_tick, #get_eventloop_weight, #get_no_event_wait, #inactive, #inactive_displayof, #info, #ip_eval, #ip_eval_with_enc, #ip_eval_without_enc, #ip_invoke, #ip_invoke_with_enc, #ip_invoke_without_enc, #is_mainloop?, #load_cmd_on_ip, #mainloop, #mainloop_exist?, #mainloop_thread?, #mainloop_watchdog, #messageBox, #rb_appsend, #rb_appsend_displayof, #reset_inactive, #reset_inactive_displayof, #restart, #scaling, #scaling_displayof, #set_eventloop_tick, #set_eventloop_weight, #set_no_event_wait, #tk_call, #tk_call_to_list, #tk_call_to_list_with_enc, #tk_call_to_list_without_enc, #tk_call_to_simplelist, #tk_call_to_simplelist_with_enc, #tk_call_to_simplelist_without_enc, #tk_call_with_enc, #tk_call_without_enc, #windowingsystem

Methods included from TkComm

_at, _callback_entry?, _callback_entry_class?, _curr_cmd_id, _fromUTF8, _genobj_for_tkwidget, _next_cmd_id, _toUTF8, array2tk_list, #bind, #bind_all, #bind_append, #bind_append_all, #bind_remove, #bind_remove_all, #bindinfo, #bindinfo_all, bool, image_obj, install_cmd, #install_cmd, list, num_or_str, number, procedure, simplelist, string, #subst, tk_tcl2ruby, uninstall_cmd, #uninstall_cmd, window

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

Methods included from TkDND::DND

#dnd_bindsource, #dnd_bindsource_info, #dnd_bindtarget, #dnd_bindtarget_info, #dnd_clearsource, #dnd_cleartarget, #dnd_drag, version

Methods included from TkDND::Shape

package_name, package_patchlevel, package_version, #shape_bounds, #shape_get, #shape_offset, #shape_set, #shape_update, version

Methods inherited from TkObject

#destroy, #epath, #event_generate, #method_missing, #path, #tk_send, #tk_send_to_list, #tk_send_to_list_with_enc, #tk_send_to_list_without_enc, #tk_send_to_simplelist, #tk_send_to_simplelist_with_enc, #tk_send_to_simplelist_without_enc, #tk_send_with_enc, #tk_send_without_enc, #to_eval

Methods included from TkConfigMethod

#[], #[]=, __IGNORE_UNKNOWN_CONFIGURE_OPTION__, #__check_available_configure_options, __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!, #cget, #cget_strict, #config_hash_kv, #configinfo, #configure, #configure_cmd, #current_configinfo

Methods included from TkTreatFont

#font_configinfo, #font_configure, #font_copy, #kanjifont_configure, #kanjifont_copy, #latinfont_configure, #latinfont_copy

Methods inherited from TkKernel

new

Constructor Details

This class inherits a constructor from TkWindow

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TkObject

Instance Method Details

#__destroy_hook__Object



313
314
315
316
317
318
319
320
# File 'ext/lib/tkextlib/blt/treeview.rb', line 313

def __destroy_hook__
  Tk::BLT::Treeview::Node::TreeNodeID_TBL.mutex.synchronize{
    Tk::BLT::Treeview::Node::TreeNodeID_TBL.delete(@path)
  }
  Tk::BLT::Treeview::Tag::TreeTagID_TBL.mutex.synchronize{
    Tk::BLT::Treeview::Tag::TreeTagID_TBL.delete(@path)
  }
end

#__item_validation_class_list(id) ⇒ Object



300
301
302
303
304
305
306
307
# File 'ext/lib/tkextlib/blt/treeview.rb', line 300

def __item_validation_class_list(id)
  case id
  when 'entry'
    super(id) << OpenCloseCommand
  else
    super(id)
  end
end

#__validation_class_listObject



292
293
294
# File 'ext/lib/tkextlib/blt/treeview.rb', line 292

def __validation_class_list
  super() << OpenCloseCommand
end

#_find_exec_flag_value(val) ⇒ Object



547
548
549
550
551
552
553
554
555
556
557
# File 'ext/lib/tkextlib/blt/treeview.rb', line 547

def _find_exec_flag_value(val)
  if val.kind_of?(Array)
    cmd, *args = val
    #FindExecFlagValue.new(cmd, args.join(' '))
    FindExecFlagValue.new(cmd, *args)
  elsif TkComm._callback_entry?(val)
    FindExecFlagValue.new(val)
  else
    val
  end
end

#bbox(*tags) ⇒ Object



346
347
348
# File 'ext/lib/tkextlib/blt/treeview.rb', line 346

def bbox(*tags)
  list(tk_send('bbox', *(tags.collect{|tag| tagid(tag)})))
end

#button_activate(tag) ⇒ Object



380
381
382
383
# File 'ext/lib/tkextlib/blt/treeview.rb', line 380

def button_activate(tag)
  tk_send('button', 'activate', tagid(tag))
  self
end

#button_bind(tag, seq, *args) ⇒ Object



385
386
387
388
389
390
391
392
393
# File 'ext/lib/tkextlib/blt/treeview.rb', line 385

def button_bind(tag, seq, *args)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  _bind([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
  self
end

#button_bind_append(tag, seq, *args) ⇒ Object



394
395
396
397
398
399
400
401
402
# File 'ext/lib/tkextlib/blt/treeview.rb', line 394

def button_bind_append(tag, seq, *args)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  _bind_append([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
  self
end

#button_bind_remove(tag, seq) ⇒ Object



403
404
405
406
# File 'ext/lib/tkextlib/blt/treeview.rb', line 403

def button_bind_remove(tag, seq)
  _bind_remove([@path, 'button', 'bind', tagid(tag)], seq)
  self
end

#button_bindinfo(tag, seq = nil) ⇒ Object



407
408
409
# File 'ext/lib/tkextlib/blt/treeview.rb', line 407

def button_bindinfo(tag, seq=nil)
  _bindinfo([@path, 'button', 'bind', tagid(tag)], seq)
end

#close(*tags) ⇒ Object



411
412
413
414
# File 'ext/lib/tkextlib/blt/treeview.rb', line 411

def close(*tags)
  tk_send('close', *(tags.collect{|tag| tagid(tag)}))
  self
end

#close_recurse(*tags) ⇒ Object



415
416
417
418
# File 'ext/lib/tkextlib/blt/treeview.rb', line 415

def close_recurse(*tags)
  tk_send('close', '-recurse', *(tags.collect{|tag| tagid(tag)}))
  self
end

#column_activate(column = None) ⇒ Object



420
421
422
423
424
425
426
427
# File 'ext/lib/tkextlib/blt/treeview.rb', line 420

def column_activate(column=None)
  if column == None
    tk_send('column', 'activate')
  else
    tk_send('column', 'activate', column)
    self
  end
end

#column_delete(*fields) ⇒ Object



429
430
431
432
# File 'ext/lib/tkextlib/blt/treeview.rb', line 429

def column_delete(*fields)
  tk_send('column', 'delete', *fields)
  self
end

#column_insert(pos, field, *opts) ⇒ Object



433
434
435
436
# File 'ext/lib/tkextlib/blt/treeview.rb', line 433

def column_insert(pos, field, *opts)
  tk_send('column', 'insert', pos, field, *opts)
  self
end

#column_invoke(field) ⇒ Object



437
438
439
440
# File 'ext/lib/tkextlib/blt/treeview.rb', line 437

def column_invoke(field)
  tk_send('column', 'invoke', field)
  self
end

#column_move(name, dest) ⇒ Object



441
442
443
444
# File 'ext/lib/tkextlib/blt/treeview.rb', line 441

def column_move(name, dest)
  tk_send('column', 'move', name, dest)
  self
end

#column_namesObject



445
446
447
# File 'ext/lib/tkextlib/blt/treeview.rb', line 445

def column_names()
  simplelist(tk_send('column', 'names'))
end

#column_nearest(x, y = None) ⇒ Object



448
449
450
# File 'ext/lib/tkextlib/blt/treeview.rb', line 448

def column_nearest(x, y=None)
  tk_send('column', 'nearest', x, y)
end

#curselectionObject



452
453
454
# File 'ext/lib/tkextlib/blt/treeview.rb', line 452

def curselection
  simplelist(tk_send('curselection')).collect{|id| tagid2obj(id)}
end

#delete(*tags) ⇒ Object



456
457
458
459
# File 'ext/lib/tkextlib/blt/treeview.rb', line 456

def delete(*tags)
  tk_send('delete', *(tags.collect{|tag| tagid(tag)}))
  self
end

#entry_activate(tag) ⇒ Object



461
462
463
464
# File 'ext/lib/tkextlib/blt/treeview.rb', line 461

def entry_activate(tag)
  tk_send('entry', 'activate', tagid(tag))
  self
end

#entry_before?(tag1, tag2) ⇒ Boolean

Returns:

  • (Boolean)


472
473
474
# File 'ext/lib/tkextlib/blt/treeview.rb', line 472

def entry_before?(tag1, tag2)
  bool(tk_send('entry', 'isbefore', tagid(tag1), tagid(tag2)))
end

#entry_children(tag, first = None, last = None) ⇒ Object



465
466
467
468
# File 'ext/lib/tkextlib/blt/treeview.rb', line 465

def entry_children(tag, first=None, last=None)
  simplelist(tk_send('entry', 'children', tagid(tag), 
                     first, last)).collect{|id| tagid2obj(id)}
end

#entry_delete(tag, first = None, last = None) ⇒ Object



469
470
471
# File 'ext/lib/tkextlib/blt/treeview.rb', line 469

def entry_delete(tag, first=None, last=None)
  tk_send('entry', 'delete', tagid(tag), first, last)
end

#entry_hidden?(tag) ⇒ Boolean

Returns:

  • (Boolean)


475
476
477
# File 'ext/lib/tkextlib/blt/treeview.rb', line 475

def entry_hidden?(tag)
  bool(tk_send('entry', 'ishidden', tagid(tag)))
end

#entry_open?(tag) ⇒ Boolean

Returns:

  • (Boolean)


478
479
480
# File 'ext/lib/tkextlib/blt/treeview.rb', line 478

def entry_open?(tag)
  bool(tk_send('entry', 'isopen', tagid(tag)))
end

#entry_size(tag) ⇒ Object



482
483
484
# File 'ext/lib/tkextlib/blt/treeview.rb', line 482

def entry_size(tag)
  number(tk_send('entry', 'size', tagid(tag)))
end

#entry_size_recurse(tag) ⇒ Object



485
486
487
# File 'ext/lib/tkextlib/blt/treeview.rb', line 485

def entry_size_recurse(tag)
  number(tk_send('entry', 'size', '-recurse', tagid(tag)))
end

#find(first, last, keys = {}) ⇒ Object



561
562
563
564
565
566
# File 'ext/lib/tkextlib/blt/treeview.rb', line 561

def find(first, last, keys={})
  keys = _search_flags(keys)
  keys['exec'] = _find_exec_flag_value(keys['exec']) if keys.key?('exec')
  args = hash_kv(keys) << '--' << tagid(first) << tagid(last)
  simplelist(tk_send('find', *args)).collect{|id| tagid2obj(id)}
end

#get(*tags) ⇒ Object



572
573
574
# File 'ext/lib/tkextlib/blt/treeview.rb', line 572

def get(*tags)
  simplelist(tk_send('get', *(tags.collect{|tag| tagid(tag)})))
end

#get_full(*tags) ⇒ Object



575
576
577
# File 'ext/lib/tkextlib/blt/treeview.rb', line 575

def get_full(*tags)
  simplelist(tk_send('get', '-full', *(tags.collect{|tag| tagid(tag)})))
end

#hide(*tags) ⇒ Object



579
580
581
582
583
584
585
586
587
588
589
590
# File 'ext/lib/tkextlib/blt/treeview.rb', line 579

def hide(*tags)
  if tags[-1].kind_of?(Hash)
    keys = tags.pop
  else
    keys = {}
  end
  keys = _search_flags(keys)
  args = hash_kv(keys) << '--'
  args.concat(tags.collect{|t| tagid(t)})
  tk_send('hide', *args)
  self
end

#index(str) ⇒ Object



592
593
594
# File 'ext/lib/tkextlib/blt/treeview.rb', line 592

def index(str)
  tagid2obj(tk_send('index', str))
end

#index_at(tag, str) ⇒ Object



595
596
597
# File 'ext/lib/tkextlib/blt/treeview.rb', line 595

def index_at(tag, str)
  tagid2obj(tk_send('index', '-at', tagid(tag), str))
end

#index_at_path(tag, str) ⇒ Object



598
599
600
# File 'ext/lib/tkextlib/blt/treeview.rb', line 598

def index_at_path(tag, str)
  tagid2obj(tk_send('index', '-at', tagid(tag), '-path', str))
end

#insert(pos, parent = nil, keys = {}) ⇒ Object



602
603
604
# File 'ext/lib/tkextlib/blt/treeview.rb', line 602

def insert(pos, parent=nil, keys={})
  Tk::BLT::Treeview::Node.new(pos, parent, keys)
end

#insert_at(tag, pos, parent = nil, keys = {}) ⇒ Object



605
606
607
608
609
610
611
612
613
614
615
# File 'ext/lib/tkextlib/blt/treeview.rb', line 605

def insert_at(tag, pos, parent=nil, keys={})
  if parent.kind_of?(Hash)
    keys = parent
    parent = nil
  end

  keys = _symbolkey2str(keys)
  keys['at'] = tagid(tag)

  Tk::BLT::Treeview::Node.new(pos, parent, keys)
end

#move_after(tag, dest) ⇒ Object



621
622
623
624
# File 'ext/lib/tkextlib/blt/treeview.rb', line 621

def move_after(tag, dest)
  tk_send('move', tagid(tag), 'after', tagid(dest))
  self
end

#move_before(tag, dest) ⇒ Object



617
618
619
620
# File 'ext/lib/tkextlib/blt/treeview.rb', line 617

def move_before(tag, dest)
  tk_send('move', tagid(tag), 'before', tagid(dest))
  self
end

#move_into(tag, dest) ⇒ Object



625
626
627
628
# File 'ext/lib/tkextlib/blt/treeview.rb', line 625

def move_into(tag, dest)
  tk_send('move', tagid(tag), 'into', tagid(dest))
  self
end

#nearest(x, y, var = None) ⇒ Object



630
631
632
# File 'ext/lib/tkextlib/blt/treeview.rb', line 630

def nearest(x, y, var=None)
  tagid2obj(tk_send('nearest', x, y, var))
end

#open(*tags) ⇒ Object



634
635
636
637
# File 'ext/lib/tkextlib/blt/treeview.rb', line 634

def open(*tags)
  tk_send('open', *(tags.collect{|tag| tagid(tag)}))
  self
end

#open_recurse(*tags) ⇒ Object



638
639
640
641
# File 'ext/lib/tkextlib/blt/treeview.rb', line 638

def open_recurse(*tags)
  tk_send('open', '-recurse', *(tags.collect{|tag| tagid(tag)}))
  self
end

#range(first, last) ⇒ Object



643
644
645
646
647
# File 'ext/lib/tkextlib/blt/treeview.rb', line 643

def range(first, last)
  simplelist(tk_send('range', tagid(first), tagid(last))).collect{|id|
    tagid2obj(id)
  }
end

#range_open(first, last) ⇒ Object



648
649
650
651
652
653
# File 'ext/lib/tkextlib/blt/treeview.rb', line 648

def range_open(first, last)
  simplelist(tk_send('range', '-open', 
                     tagid(first), tagid(last))).collect{|id|
    tagid2obj(id)
  }
end

#scan_dragto(x, y) ⇒ Object



659
660
661
662
# File 'ext/lib/tkextlib/blt/treeview.rb', line 659

def scan_dragto(x, y)
  tk_send_without_enc('scan', 'dragto', x, y)
  self
end

#scan_mark(x, y) ⇒ Object



655
656
657
658
# File 'ext/lib/tkextlib/blt/treeview.rb', line 655

def scan_mark(x, y)
  tk_send_without_enc('scan', 'mark', x, y)
  self
end

#screen_bbox(*tags) ⇒ Object



350
351
352
# File 'ext/lib/tkextlib/blt/treeview.rb', line 350

def screen_bbox(*tags)
  list(tk_send('bbox', '-screen', *(tags.collect{|tag| tagid(tag)})))
end

#see(tag) ⇒ Object



664
665
666
667
# File 'ext/lib/tkextlib/blt/treeview.rb', line 664

def see(tag)
  tk_send_without_enc('see', tagid(tag))
  self
end

#see_anchor(anchor, tag) ⇒ Object



668
669
670
671
# File 'ext/lib/tkextlib/blt/treeview.rb', line 668

def see_anchor(anchor, tag)
  tk_send_without_enc('see', '-anchor', anchor, tagid(tag))
  self
end

#selection_anchor(tag) ⇒ Object



673
674
675
676
# File 'ext/lib/tkextlib/blt/treeview.rb', line 673

def selection_anchor(tag)
  tk_send_without_enc('selection', 'anchor', tagid(tag))
  self
end

#selection_cancelObject



677
678
679
680
# File 'ext/lib/tkextlib/blt/treeview.rb', line 677

def selection_cancel()
  tk_send_without_enc('selection', 'cancel')
  self
end

#selection_clear(first, last = None) ⇒ Object



681
682
683
684
# File 'ext/lib/tkextlib/blt/treeview.rb', line 681

def selection_clear(first, last=None)
  tk_send_without_enc('selection', 'clear', tagid(first), tagid(last))
  self
end

#selection_clear_allObject



685
686
687
688
# File 'ext/lib/tkextlib/blt/treeview.rb', line 685

def selection_clear_all()
  tk_send_without_enc('selection', 'clearall')
  self
end

#selection_include?(tag) ⇒ Boolean

Returns:

  • (Boolean)


693
694
695
# File 'ext/lib/tkextlib/blt/treeview.rb', line 693

def selection_include?(tag)
  bool(tk_send('selection', 'include', tagid(tag)))
end

#selection_mark(tag) ⇒ Object



689
690
691
692
# File 'ext/lib/tkextlib/blt/treeview.rb', line 689

def selection_mark(tag)
  tk_send_without_enc('selection', 'mark', tagid(tag))
  self
end

#selection_present?Boolean

Returns:

  • (Boolean)


696
697
698
# File 'ext/lib/tkextlib/blt/treeview.rb', line 696

def selection_present?()
  bool(tk_send('selection', 'present'))
end

#selection_set(first, last = None) ⇒ Object



699
700
701
702
# File 'ext/lib/tkextlib/blt/treeview.rb', line 699

def selection_set(first, last=None)
  tk_send_without_enc('selection', 'set', tagid(first), tagid(last))
  self
end

#selection_toggle(first, last = None) ⇒ Object



703
704
705
706
# File 'ext/lib/tkextlib/blt/treeview.rb', line 703

def selection_toggle(first, last=None)
  tk_send_without_enc('selection', 'toggle', tagid(first), tagid(last))
  self
end

#show(*tags) ⇒ Object



708
709
710
711
712
713
714
715
716
717
718
719
# File 'ext/lib/tkextlib/blt/treeview.rb', line 708

def show(*tags)
  if tags[-1].kind_of?(Hash)
    keys = tags.pop
  else
    keys = {}
  end
  keys = _search_flags(keys)
  args = hash_kv(keys) << '--'
  args.concat(tags.collect{|t| tagid(t)})
  tk_send('show', *args)
  self
end

#sort_auto(mode) ⇒ Object



721
722
723
724
# File 'ext/lib/tkextlib/blt/treeview.rb', line 721

def sort_auto(mode)
  tk_send('sort', 'auto', mode)
  self
end

#sort_auto=(mode) ⇒ Object



725
726
727
728
# File 'ext/lib/tkextlib/blt/treeview.rb', line 725

def sort_auto=(mode)
  tk_send('sort', 'auto', mode)
  mode
end

#sort_auto?Boolean

Returns:

  • (Boolean)


729
730
731
# File 'ext/lib/tkextlib/blt/treeview.rb', line 729

def sort_auto?
  bool(tk_send('sort', 'auto'))
end

#sort_once(*tags) ⇒ Object



732
733
734
735
# File 'ext/lib/tkextlib/blt/treeview.rb', line 732

def sort_once(*tags)
  tk_send('sort', 'once', *(tags.collect{|tag| tagid(tag)}))
  self
end

#sort_once_recurse(*tags) ⇒ Object



736
737
738
739
# File 'ext/lib/tkextlib/blt/treeview.rb', line 736

def sort_once_recurse(*tags)
  tk_send('sort', 'once', '-recurse', *(tags.collect{|tag| tagid(tag)}))
  self
end

#tag_add(tag, *ids) ⇒ Object



741
742
743
744
# File 'ext/lib/tkextlib/blt/treeview.rb', line 741

def tag_add(tag, *ids)
  tk_send('tag', 'add', tagid(tag), *ids)
  self
end

#tag_bind(tag, seq, *args) ⇒ Object



354
355
356
357
358
359
360
361
362
# File 'ext/lib/tkextlib/blt/treeview.rb', line 354

def tag_bind(tag, seq, *args)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  _bind([@path, 'bind', tagid(tag)], seq, cmd, *args)
  self
end

#tag_bind_append(tag, seq, *args) ⇒ Object



363
364
365
366
367
368
369
370
371
# File 'ext/lib/tkextlib/blt/treeview.rb', line 363

def tag_bind_append(tag, seq, *args)
  if TkComm._callback_entry?(args[0]) || !block_given?
    cmd = args.shift
  else
    cmd = Proc.new
  end
  _bind_append([@path, 'bind', tagid(tag)], seq, cmd, *args)
  self
end

#tag_bind_remove(tag, seq) ⇒ Object



372
373
374
375
# File 'ext/lib/tkextlib/blt/treeview.rb', line 372

def tag_bind_remove(tag, seq)
  _bind_remove([@path, 'bind', tagid(tag)], seq)
  self
end

#tag_bindinfo(tag, seq = nil) ⇒ Object



376
377
378
# File 'ext/lib/tkextlib/blt/treeview.rb', line 376

def tag_bindinfo(tag, seq=nil)
  _bindinfo([@path, 'bind', tagid(tag)], seq)
end

#tag_delete(tag, *ids) ⇒ Object



745
746
747
748
# File 'ext/lib/tkextlib/blt/treeview.rb', line 745

def tag_delete(tag, *ids)
  tk_send('tag', 'delete', tagid(tag), *ids)
  self
end

#tag_focus(tag) ⇒ Object



568
569
570
571
# File 'ext/lib/tkextlib/blt/treeview.rb', line 568

def tag_focus(tag)
  tk_send('focus', tagid(tag))
  self
end

#tag_forget(tag) ⇒ Object



749
750
751
752
# File 'ext/lib/tkextlib/blt/treeview.rb', line 749

def tag_forget(tag)
  tk_send('tag', 'forget', tagid(tag))
  self
end

#tag_names(id = nil) ⇒ Object



753
754
755
756
757
758
759
# File 'ext/lib/tkextlib/blt/treeview.rb', line 753

def tag_names(id=nil)
  id = (id)? tagid(id): None

  simplelist(tk_send('tag', 'nodes', id)).collect{|tag|
    Tk::BLT::Treeview::Tag.id2obj(self, tag)
  }
end

#tag_nodes(tag) ⇒ Object



760
761
762
763
764
# File 'ext/lib/tkextlib/blt/treeview.rb', line 760

def tag_nodes(tag)
  simplelist(tk_send('tag', 'nodes', tagid(tag))).collect{|id|
    Tk::BLT::Treeview::Node.id2obj(self, id)
  }
end

#tagid2obj(tagid) ⇒ Object



332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'ext/lib/tkextlib/blt/treeview.rb', line 332

def tagid2obj(tagid)
  if tagid.kind_of?(Integer)
    Tk::BLT::Treeview::Node.id2obj(self, tagid.to_s)
  elsif tagid.kind_of?(String)
    if tagid =~ /^\d+$/
      Tk::BLT::Treeview::Node.id2obj(self, tagid)
    else
      Tk::BLT::Treeview::Tag.id2obj(self, tagid)
    end
  else
    tagid
  end
end

#text_applyObject



766
767
768
769
# File 'ext/lib/tkextlib/blt/treeview.rb', line 766

def text_apply
  tk_send('text', 'apply')
  self
end

#text_cancelObject



770
771
772
773
# File 'ext/lib/tkextlib/blt/treeview.rb', line 770

def text_cancel
  tk_send('text', 'cancel')
  self
end

#text_delete(first, last) ⇒ Object



775
776
777
778
# File 'ext/lib/tkextlib/blt/treeview.rb', line 775

def text_delete(first, last)
  tk_send('text', 'delete', first, last)
  self
end

#text_get(x, y) ⇒ Object



779
780
781
# File 'ext/lib/tkextlib/blt/treeview.rb', line 779

def text_get(x, y)
  tk_send('text', 'get', x, y)
end

#text_get_root(x, y) ⇒ Object



782
783
784
# File 'ext/lib/tkextlib/blt/treeview.rb', line 782

def text_get_root(x, y)
  tk_send('text', 'get', '-root', x, y)
end

#text_icursor(idx) ⇒ Object



785
786
787
788
# File 'ext/lib/tkextlib/blt/treeview.rb', line 785

def text_icursor(idx)
  tk_send('text', 'icursor', idx)
  self
end

#text_index(idx) ⇒ Object



789
790
791
# File 'ext/lib/tkextlib/blt/treeview.rb', line 789

def text_index(idx)
  num_or_str(tk_send('text', 'index', idx))
end

#text_insert(idx, str) ⇒ Object



792
793
794
795
# File 'ext/lib/tkextlib/blt/treeview.rb', line 792

def text_insert(idx, str)
  tk_send('text', 'insert', idx, str)
  self
end

#text_selection_adjust(idx) ⇒ Object



797
798
799
800
# File 'ext/lib/tkextlib/blt/treeview.rb', line 797

def text_selection_adjust(idx)
  tk_send('text', 'selection', 'adjust', idx)
  self
end

#text_selection_clearObject



801
802
803
804
# File 'ext/lib/tkextlib/blt/treeview.rb', line 801

def text_selection_clear
  tk_send('text', 'selection', 'clear')
  self
end

#text_selection_from(idx) ⇒ Object



805
806
807
808
# File 'ext/lib/tkextlib/blt/treeview.rb', line 805

def text_selection_from(idx)
  tk_send('text', 'selection', 'from', idx)
  self
end

#text_selection_presentObject



809
810
811
# File 'ext/lib/tkextlib/blt/treeview.rb', line 809

def text_selection_present
  num_or_str(tk_send('text', 'selection', 'present'))
end

#text_selection_range(start, last) ⇒ Object



812
813
814
815
# File 'ext/lib/tkextlib/blt/treeview.rb', line 812

def text_selection_range(start, last)
  tk_send('text', 'selection', 'range', start, last)
  self
end

#text_selection_to(idx) ⇒ Object



816
817
818
819
# File 'ext/lib/tkextlib/blt/treeview.rb', line 816

def text_selection_to(idx)
  tk_send('text', 'selection', 'to', idx)
  self
end

#toggle(tag) ⇒ Object



821
822
823
824
# File 'ext/lib/tkextlib/blt/treeview.rb', line 821

def toggle(tag)
  tk_send('toggle', tagid(tag))
  self
end