Class: Tk::BLT::Treeview

Inherits:
TkWindow show all
Includes:
ConfigMethod, ItemValidateConfigure, Scrollable, ValidateConfigure
Defined in:
lib/tkextlib/blt/treeview.rb,
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 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 Tk

AUTO_PATH, INTERP, JAPANIZED_TK, LIBRARY_PATH, MAINLOOP, PACKAGE_PATH, RELEASE_DATE, 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 TkDND::Shape

TkDND::Shape::PACKAGE_NAME

Instance Method Summary collapse

Methods included from ConfigMethod

#button_cget, #button_cget_strict, #button_cget_tkstring, #button_configinfo, #button_configure, #column_cget, #column_cget_strict, #column_cget_tkstring, #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_cget_tkstring, #entry_configinfo, #entry_configure, #sort_cget, #sort_cget_strict, #sort_cget_tkstring, #sort_configinfo, #sort_configure, #text_cget, #text_cget_strict, #text_cget_tkstring, #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, #itemcget_tkstring, #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_nil, num_or_nil, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd, untrust

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 Tk::Busy

#busy, #busy_cget, #busy_configinfo, #busy_configure, #busy_current?, #busy_current_configinfo, #busy_forget, #busy_status, current, forget, hold, method_missing, status

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_nil, num_or_str, number, procedure, simplelist, slice_ary, string, #subst, tk_tcl2ruby, uninstall_cmd, #uninstall_cmd, window

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

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, __create_widget_set__, __disable_toplevel_control__, __import_toplevel_aliases__, __regist_toplevel_aliases__, __remove_toplevel_aliases__, __reset_toplevel_owner__, __set_loaded_toplevel_aliases__, __set_toplevel_aliases__, __toplevel_alias_setup_proc__, add_kinsoku, bell, bell_on_display, const_missing, current_grabs, cursor_display, default_widget_set, default_widget_set=, delete_kinsoku, destroy, #encoding, #encoding=, 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, toplevel_aliases_on_widget_set, ungrid, unload_tcllibrary, unpack, unplace, update, #update, update_idletasks, utf_to_backslash, utf_to_backslash_sequence, wakeup, widget_set_symbols

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 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, #cget_tkstring, #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



328
329
330
331
332
333
334
335
# File 'lib/tkextlib/blt/treeview.rb', line 328

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



315
316
317
318
319
320
321
322
# File 'lib/tkextlib/blt/treeview.rb', line 315

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

#__validation_class_listObject



307
308
309
# File 'lib/tkextlib/blt/treeview.rb', line 307

def __validation_class_list
  super() << OpenCloseCommand
end

#_find_exec_flag_value(val) ⇒ Object



562
563
564
565
566
567
568
569
570
571
572
# File 'lib/tkextlib/blt/treeview.rb', line 562

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



361
362
363
# File 'lib/tkextlib/blt/treeview.rb', line 361

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

#button_activate(tag) ⇒ Object



395
396
397
398
# File 'lib/tkextlib/blt/treeview.rb', line 395

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

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



400
401
402
403
404
405
406
407
408
# File 'lib/tkextlib/blt/treeview.rb', line 400

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



409
410
411
412
413
414
415
416
417
# File 'lib/tkextlib/blt/treeview.rb', line 409

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



418
419
420
421
# File 'lib/tkextlib/blt/treeview.rb', line 418

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

#button_bindinfo(tag, seq = nil) ⇒ Object



422
423
424
# File 'lib/tkextlib/blt/treeview.rb', line 422

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

#close(*tags) ⇒ Object



426
427
428
429
# File 'lib/tkextlib/blt/treeview.rb', line 426

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

#close_recurse(*tags) ⇒ Object



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

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

#column_activate(column = None) ⇒ Object



435
436
437
438
439
440
441
442
# File 'lib/tkextlib/blt/treeview.rb', line 435

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



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

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

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



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

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

#column_invoke(field) ⇒ Object



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

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

#column_move(name, dest) ⇒ Object



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

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

#column_namesObject



460
461
462
# File 'lib/tkextlib/blt/treeview.rb', line 460

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

#column_nearest(x, y = None) ⇒ Object



463
464
465
# File 'lib/tkextlib/blt/treeview.rb', line 463

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

#curselectionObject



467
468
469
# File 'lib/tkextlib/blt/treeview.rb', line 467

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

#delete(*tags) ⇒ Object



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

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

#entry_activate(tag) ⇒ Object



476
477
478
479
# File 'lib/tkextlib/blt/treeview.rb', line 476

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

#entry_before?(tag1, tag2) ⇒ Boolean

Returns:

  • (Boolean)


487
488
489
# File 'lib/tkextlib/blt/treeview.rb', line 487

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

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



480
481
482
483
# File 'lib/tkextlib/blt/treeview.rb', line 480

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



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

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

#entry_hidden?(tag) ⇒ Boolean

Returns:

  • (Boolean)


490
491
492
# File 'lib/tkextlib/blt/treeview.rb', line 490

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

#entry_open?(tag) ⇒ Boolean

Returns:

  • (Boolean)


493
494
495
# File 'lib/tkextlib/blt/treeview.rb', line 493

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

#entry_size(tag) ⇒ Object



497
498
499
# File 'lib/tkextlib/blt/treeview.rb', line 497

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

#entry_size_recurse(tag) ⇒ Object



500
501
502
# File 'lib/tkextlib/blt/treeview.rb', line 500

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

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



576
577
578
579
580
581
# File 'lib/tkextlib/blt/treeview.rb', line 576

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



587
588
589
# File 'lib/tkextlib/blt/treeview.rb', line 587

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

#get_full(*tags) ⇒ Object



590
591
592
# File 'lib/tkextlib/blt/treeview.rb', line 590

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

#hide(*tags) ⇒ Object



594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/tkextlib/blt/treeview.rb', line 594

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



607
608
609
# File 'lib/tkextlib/blt/treeview.rb', line 607

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

#index_at(tag, str) ⇒ Object



610
611
612
# File 'lib/tkextlib/blt/treeview.rb', line 610

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

#index_at_path(tag, str) ⇒ Object



613
614
615
# File 'lib/tkextlib/blt/treeview.rb', line 613

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

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



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

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

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



620
621
622
623
624
625
626
627
628
629
630
# File 'lib/tkextlib/blt/treeview.rb', line 620

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



636
637
638
639
# File 'lib/tkextlib/blt/treeview.rb', line 636

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

#move_before(tag, dest) ⇒ Object



632
633
634
635
# File 'lib/tkextlib/blt/treeview.rb', line 632

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

#move_into(tag, dest) ⇒ Object



640
641
642
643
# File 'lib/tkextlib/blt/treeview.rb', line 640

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

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



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

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

#open(*tags) ⇒ Object



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

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

#open_recurse(*tags) ⇒ Object



653
654
655
656
# File 'lib/tkextlib/blt/treeview.rb', line 653

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

#range(first, last) ⇒ Object



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

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

#range_open(first, last) ⇒ Object



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

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

#scan_dragto(x, y) ⇒ Object



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

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

#scan_mark(x, y) ⇒ Object



670
671
672
673
# File 'lib/tkextlib/blt/treeview.rb', line 670

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

#screen_bbox(*tags) ⇒ Object



365
366
367
# File 'lib/tkextlib/blt/treeview.rb', line 365

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

#see(tag) ⇒ Object



679
680
681
682
# File 'lib/tkextlib/blt/treeview.rb', line 679

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

#see_anchor(anchor, tag) ⇒ Object



683
684
685
686
# File 'lib/tkextlib/blt/treeview.rb', line 683

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

#selection_anchor(tag) ⇒ Object



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

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

#selection_cancelObject



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

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

#selection_clear(first, last = None) ⇒ Object



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

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

#selection_clear_allObject



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

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

#selection_include?(tag) ⇒ Boolean

Returns:

  • (Boolean)


708
709
710
# File 'lib/tkextlib/blt/treeview.rb', line 708

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

#selection_mark(tag) ⇒ Object



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

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

#selection_present?Boolean

Returns:

  • (Boolean)


711
712
713
# File 'lib/tkextlib/blt/treeview.rb', line 711

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

#selection_set(first, last = None) ⇒ Object



714
715
716
717
# File 'lib/tkextlib/blt/treeview.rb', line 714

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

#selection_toggle(first, last = None) ⇒ Object



718
719
720
721
# File 'lib/tkextlib/blt/treeview.rb', line 718

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

#show(*tags) ⇒ Object



723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/tkextlib/blt/treeview.rb', line 723

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



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

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

#sort_auto=(mode) ⇒ Object



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

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

#sort_auto?Boolean

Returns:

  • (Boolean)


744
745
746
# File 'lib/tkextlib/blt/treeview.rb', line 744

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

#sort_once(*tags) ⇒ Object



747
748
749
750
# File 'lib/tkextlib/blt/treeview.rb', line 747

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

#sort_once_recurse(*tags) ⇒ Object



751
752
753
754
# File 'lib/tkextlib/blt/treeview.rb', line 751

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

#tag_add(tag, *ids) ⇒ Object



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

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

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



369
370
371
372
373
374
375
376
377
# File 'lib/tkextlib/blt/treeview.rb', line 369

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



378
379
380
381
382
383
384
385
386
# File 'lib/tkextlib/blt/treeview.rb', line 378

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



387
388
389
390
# File 'lib/tkextlib/blt/treeview.rb', line 387

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

#tag_bindinfo(tag, seq = nil) ⇒ Object



391
392
393
# File 'lib/tkextlib/blt/treeview.rb', line 391

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

#tag_delete(tag, *ids) ⇒ Object



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

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

#tag_focus(tag) ⇒ Object



583
584
585
586
# File 'lib/tkextlib/blt/treeview.rb', line 583

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

#tag_forget(tag) ⇒ Object



764
765
766
767
# File 'lib/tkextlib/blt/treeview.rb', line 764

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

#tag_names(id = nil) ⇒ Object



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

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



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

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

#tagid2obj(tagid) ⇒ Object



347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/tkextlib/blt/treeview.rb', line 347

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



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

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

#text_cancelObject



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

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

#text_delete(first, last) ⇒ Object



790
791
792
793
# File 'lib/tkextlib/blt/treeview.rb', line 790

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

#text_get(x, y) ⇒ Object



794
795
796
# File 'lib/tkextlib/blt/treeview.rb', line 794

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

#text_get_root(x, y) ⇒ Object



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

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

#text_icursor(idx) ⇒ Object



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

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

#text_index(idx) ⇒ Object



804
805
806
# File 'lib/tkextlib/blt/treeview.rb', line 804

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

#text_insert(idx, str) ⇒ Object



807
808
809
810
# File 'lib/tkextlib/blt/treeview.rb', line 807

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

#text_selection_adjust(idx) ⇒ Object



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

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

#text_selection_clearObject



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

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

#text_selection_from(idx) ⇒ Object



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

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

#text_selection_presentObject



824
825
826
# File 'lib/tkextlib/blt/treeview.rb', line 824

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

#text_selection_range(start, last) ⇒ Object



827
828
829
830
# File 'lib/tkextlib/blt/treeview.rb', line 827

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

#text_selection_to(idx) ⇒ Object



831
832
833
834
# File 'lib/tkextlib/blt/treeview.rb', line 831

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

#toggle(tag) ⇒ Object



836
837
838
839
# File 'lib/tkextlib/blt/treeview.rb', line 836

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