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 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 TkCore

TkCore::EventFlag, TkCore::INTERP, TkCore::WIDGET_DESTROY_HOOK

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_configinfo, #button_configure, #column_cget, #column_configinfo, #column_configure, #current_button_configinfo, #current_column_configinfo, #current_entry_configinfo, #current_sort_configinfo, #current_text_configinfo, #entry_cget, #entry_configinfo, #entry_configure, #sort_cget, #sort_configinfo, #sort_configure, #text_cget, #text_configinfo, #text_configure

Methods included from TkItemConfigMethod

#current_itemconfiginfo, #itemcget, #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

#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_bbox, #grid_columnconfig, #grid_columnconfiginfo, #grid_config, #grid_forget, #grid_in, #grid_info, #grid_location, #grid_propagate, #grid_remove, #grid_rowconfig, #grid_rowconfiginfo, #grid_size, #grid_slaves, #initialize, #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, UTF8_String, add_kinsoku, bell, bell_on_display, const_missing, current_grabs, cursor_display, 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, 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

Methods included from Encoding

#encoding, #encoding=, #encoding_convertfrom, #encoding_convertto, #encoding_dirs, #encoding_dirs=, #encoding_names, #encoding_system, #encoding_system=

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, list, num_or_str, number, procedure, simplelist, string, #subst, tk_tcl2ruby, 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

#[], #[]=, #cget, #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



275
276
277
278
# File 'lib/tkextlib/blt/treeview.rb', line 275

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

#__item_validation_class_list(id) ⇒ Object



262
263
264
265
266
267
268
269
# File 'lib/tkextlib/blt/treeview.rb', line 262

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

#__validation_class_listObject



254
255
256
# File 'lib/tkextlib/blt/treeview.rb', line 254

def __validation_class_list
  super() << OpenCloseCommand
end

#_find_exec_flag_value(val) ⇒ Object



487
488
489
490
491
492
493
494
495
496
# File 'lib/tkextlib/blt/treeview.rb', line 487

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

#bbox(*tags) ⇒ Object



304
305
306
# File 'lib/tkextlib/blt/treeview.rb', line 304

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

#button_activate(tag) ⇒ Object



338
339
340
341
# File 'lib/tkextlib/blt/treeview.rb', line 338

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

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



343
344
345
346
347
348
349
350
351
# File 'lib/tkextlib/blt/treeview.rb', line 343

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



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

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



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

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

#button_bindinfo(tag, seq = nil) ⇒ Object



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

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

#close(*tags) ⇒ Object



369
370
371
372
# File 'lib/tkextlib/blt/treeview.rb', line 369

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

#close_recurse(*tags) ⇒ Object



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

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

#column_activate(column = None) ⇒ Object



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

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



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

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

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



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

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

#column_invoke(field) ⇒ Object



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

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

#column_move(name, dest) ⇒ Object



399
400
401
402
# File 'lib/tkextlib/blt/treeview.rb', line 399

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

#column_namesObject



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

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

#column_nearest(x, y = None) ⇒ Object



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

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

#curselectionObject



410
411
412
# File 'lib/tkextlib/blt/treeview.rb', line 410

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

#delete(*tags) ⇒ Object



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

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

#entry_activate(tag) ⇒ Object



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

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

#entry_before?(tag1, tag2) ⇒ Boolean

Returns:



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

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

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



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

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



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

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

#entry_hidden?(tag) ⇒ Boolean

Returns:



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

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

#entry_open?(tag) ⇒ Boolean

Returns:



436
437
438
# File 'lib/tkextlib/blt/treeview.rb', line 436

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

#entry_size(tag) ⇒ Object



440
441
442
# File 'lib/tkextlib/blt/treeview.rb', line 440

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

#entry_size_recurse(tag) ⇒ Object



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

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

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



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

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



511
512
513
# File 'lib/tkextlib/blt/treeview.rb', line 511

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

#get_full(*tags) ⇒ Object



514
515
516
# File 'lib/tkextlib/blt/treeview.rb', line 514

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

#hide(*tags) ⇒ Object



518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/tkextlib/blt/treeview.rb', line 518

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



531
532
533
# File 'lib/tkextlib/blt/treeview.rb', line 531

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

#index_at(tag, str) ⇒ Object



534
535
536
# File 'lib/tkextlib/blt/treeview.rb', line 534

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

#index_at_path(tag, str) ⇒ Object



537
538
539
# File 'lib/tkextlib/blt/treeview.rb', line 537

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

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



541
542
543
# File 'lib/tkextlib/blt/treeview.rb', line 541

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

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



544
545
546
547
548
549
550
551
552
553
554
# File 'lib/tkextlib/blt/treeview.rb', line 544

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



560
561
562
563
# File 'lib/tkextlib/blt/treeview.rb', line 560

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

#move_before(tag, dest) ⇒ Object



556
557
558
559
# File 'lib/tkextlib/blt/treeview.rb', line 556

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

#move_into(tag, dest) ⇒ Object



564
565
566
567
# File 'lib/tkextlib/blt/treeview.rb', line 564

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

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



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

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

#open(*tags) ⇒ Object



573
574
575
576
# File 'lib/tkextlib/blt/treeview.rb', line 573

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

#open_recurse(*tags) ⇒ Object



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

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

#range(first, last) ⇒ Object



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

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

#range_open(first, last) ⇒ Object



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

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

#scan_dragto(x, y) ⇒ Object



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

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

#scan_mark(x, y) ⇒ Object



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

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

#screen_bbox(*tags) ⇒ Object



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

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

#see(tag) ⇒ Object



603
604
605
606
# File 'lib/tkextlib/blt/treeview.rb', line 603

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

#see_anchor(anchor, tag) ⇒ Object



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

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

#selection_anchor(tag) ⇒ Object



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

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

#selection_cancelObject



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

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

#selection_clear(first, last = None) ⇒ Object



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

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

#selection_clear_allObject



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

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

#selection_include?(tag) ⇒ Boolean

Returns:



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

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

#selection_mark(tag) ⇒ Object



628
629
630
631
# File 'lib/tkextlib/blt/treeview.rb', line 628

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

#selection_present?Boolean

Returns:



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

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

#selection_set(first, last = None) ⇒ Object



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

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

#selection_toggle(first, last = None) ⇒ Object



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

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

#show(*tags) ⇒ Object



647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/tkextlib/blt/treeview.rb', line 647

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



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

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

#sort_auto=(mode) ⇒ Object



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

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

#sort_auto?Boolean

Returns:



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

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

#sort_once(*tags) ⇒ Object



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

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

#sort_once_recurse(*tags) ⇒ Object



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

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

#tag_add(tag, *ids) ⇒ Object



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

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

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



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

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



321
322
323
324
325
326
327
328
329
# File 'lib/tkextlib/blt/treeview.rb', line 321

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



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

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

#tag_bindinfo(tag, seq = nil) ⇒ Object



334
335
336
# File 'lib/tkextlib/blt/treeview.rb', line 334

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

#tag_delete(tag, *ids) ⇒ Object



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

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

#tag_focus(tag) ⇒ Object



507
508
509
510
# File 'lib/tkextlib/blt/treeview.rb', line 507

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

#tag_forget(tag) ⇒ Object



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

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

#tag_names(id = nil) ⇒ Object



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

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



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

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

#tagid2obj(tagid) ⇒ Object



290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/tkextlib/blt/treeview.rb', line 290

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



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

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

#text_cancelObject



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

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

#text_delete(first, last) ⇒ Object



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

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

#text_get(x, y) ⇒ Object



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

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

#text_get_root(x, y) ⇒ Object



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

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

#text_icursor(idx) ⇒ Object



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

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

#text_index(idx) ⇒ Object



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

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

#text_insert(idx, str) ⇒ Object



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

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

#text_selection_adjust(idx) ⇒ Object



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

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

#text_selection_clearObject



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

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

#text_selection_from(idx) ⇒ Object



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

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

#text_selection_presentObject



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

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

#text_selection_range(start, last) ⇒ Object



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

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

#text_selection_to(idx) ⇒ Object



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

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

#toggle(tag) ⇒ Object



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

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