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, Fontchooser, 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

__item_cget_cmd, __item_config_cmd, __item_confinfo_cmd, #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__, _replace_toplevel_aliases, add_kinsoku, backup_current_topdef, bell, bell_on_display, const_missing, current_grabs, cursor_display, default_widget_set, default_widget_set=, define_topalias, define_topobj, 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, regist_sym_for_loaded_file, replace_topalias, replace_topobj, #root, set_topalias, 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, topalias_defined?, toplevel_aliases_on_widget_set, topobj_defined?, 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



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

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



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

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

#__validation_class_listObject



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

def __validation_class_list
  super() << OpenCloseCommand
end

#_find_exec_flag_value(val) ⇒ Object



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

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



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

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

#button_activate(tag) ⇒ Object



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

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

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



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

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



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

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



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

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

#button_bindinfo(tag, seq = nil) ⇒ Object



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

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

#close(*tags) ⇒ Object



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

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

#close_recurse(*tags) ⇒ Object



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

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

#column_activate(column = None) ⇒ Object



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

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



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

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

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



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

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

#column_invoke(field) ⇒ Object



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

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

#column_move(name, dest) ⇒ Object



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

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

#column_namesObject



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

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

#column_nearest(x, y = None) ⇒ Object



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

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

#curselectionObject



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

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

#delete(*tags) ⇒ Object



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

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

#entry_activate(tag) ⇒ Object



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

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

#entry_before?(tag1, tag2) ⇒ Boolean

Returns:

  • (Boolean)


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

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

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



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

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



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

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

#entry_hidden?(tag) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#entry_open?(tag) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#entry_size(tag) ⇒ Object



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

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

#entry_size_recurse(tag) ⇒ Object



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

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

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



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

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



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

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

#get_full(*tags) ⇒ Object



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

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

#hide(*tags) ⇒ Object



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

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



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

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

#index_at(tag, str) ⇒ Object



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

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

#index_at_path(tag, str) ⇒ Object



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

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

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



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

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

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



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

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



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

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

#move_before(tag, dest) ⇒ Object



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

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

#move_into(tag, dest) ⇒ Object



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

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

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



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

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

#open(*tags) ⇒ Object



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

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

#open_recurse(*tags) ⇒ Object



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

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

#range(first, last) ⇒ Object



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

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

#range_open(first, last) ⇒ Object



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

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

#scan_dragto(x, y) ⇒ Object



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

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

#scan_mark(x, y) ⇒ Object



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

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

#screen_bbox(*tags) ⇒ Object



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

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

#see(tag) ⇒ Object



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

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

#see_anchor(anchor, tag) ⇒ Object



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

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

#selection_anchor(tag) ⇒ Object



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

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

#selection_cancelObject



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

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

#selection_clear(first, last = None) ⇒ Object



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

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

#selection_clear_allObject



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

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

#selection_include?(tag) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#selection_mark(tag) ⇒ Object



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

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

#selection_present?Boolean

Returns:

  • (Boolean)


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

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

#selection_set(first, last = None) ⇒ Object



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

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

#selection_toggle(first, last = None) ⇒ Object



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

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

#show(*tags) ⇒ Object



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

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



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

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

#sort_auto=(mode) ⇒ Object



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

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

#sort_auto?Boolean

Returns:

  • (Boolean)


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

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

#sort_once(*tags) ⇒ Object



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

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

#sort_once_recurse(*tags) ⇒ Object



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

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

#tag_add(tag, *ids) ⇒ Object



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

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

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



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

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



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

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



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

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

#tag_bindinfo(tag, seq = nil) ⇒ Object



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

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

#tag_delete(tag, *ids) ⇒ Object



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

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

#tag_focus(tag) ⇒ Object



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

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

#tag_forget(tag) ⇒ Object



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

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

#tag_names(id = nil) ⇒ Object



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

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



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

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

#tagid2obj(tagid) ⇒ Object



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

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



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

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

#text_cancelObject



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

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

#text_delete(first, last) ⇒ Object



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

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

#text_get(x, y) ⇒ Object



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

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

#text_get_root(x, y) ⇒ Object



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

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

#text_icursor(idx) ⇒ Object



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

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

#text_index(idx) ⇒ Object



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

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

#text_insert(idx, str) ⇒ Object



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

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

#text_selection_adjust(idx) ⇒ Object



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

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

#text_selection_clearObject



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

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

#text_selection_from(idx) ⇒ Object



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

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

#text_selection_presentObject



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

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

#text_selection_range(start, last) ⇒ Object



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

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

#text_selection_to(idx) ⇒ Object



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

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

#toggle(tag) ⇒ Object



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

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