Class: TkWindow

Inherits:
TkObject show all
Extended by:
TkBindCore
Includes:
Tk::Busy, Tk::TkDND::DND, Tk::TkDND::Shape, Tk::Wm_for_General, TkWinfo
Defined in:
lib/tkextlib/tkDND/shape.rb,
lib/tkextlib/tkDND/tkdnd.rb,
lib/tkextlib/tcllib/cursor.rb,
lib/tkextlib/tktrans/tktrans.rb,
lib/tk.rb

Constant Summary collapse

TkCommandNames =
[].freeze
WidgetClassName =

> If TkCommandNames is a string (not a null string),

assume the string is a Tcl/Tk's create command of the widget class.
''.freeze
@@WIDGET_INSPECT_FULL =
false

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

Tk::AUTO_PATH, Tk::Fontchooser, Tk::INTERP, Tk::JAPANIZED_TK, Tk::LIBRARY_PATH, Tk::MAINLOOP, Tk::PACKAGE_PATH, Tk::RELEASE_DATE, Tk::TCL_LIBRARY_PATH, Tk::TCL_MAJOR_VERSION, Tk::TCL_MINOR_VERSION, Tk::TCL_PACKAGE_PATH, Tk::TCL_PATCHLEVEL, Tk::TCL_PRECISION, Tk::TCL_VERSION, Tk::TK_MAJOR_VERSION, Tk::TK_MINOR_VERSION, Tk::TK_PATCHLEVEL, Tk::TK_VERSION, Tk::Tkextlib_RELEASE_DATE, Tk::TreeCtrl_Widget, Tk::X_Scrollable, Tk::Y_Scrollable

Constants included from Tk::Encoding

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

Constants included from Tk::TkDND::Shape

Tk::TkDND::Shape::PACKAGE_NAME

Class Method Summary collapse

Instance Method Summary collapse

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

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 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 Tk::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 Tk::TkDND::DND

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

Methods included from Tk::TkDND::Shape

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

Methods inherited from TkObject

#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

#initialize(parent = nil, keys = nil) ⇒ TkWindow

Returns a new instance of TkWindow.



5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
# File 'lib/tk.rb', line 5075

def initialize(parent=nil, keys=nil)
  if parent.kind_of? Hash
    keys = _symbolkey2str(parent)
    parent = keys.delete('parent')
    widgetname = keys.delete('widgetname')
    install_win(if parent then parent.path end, widgetname)
    without_creating = keys.delete('without_creating')
    # if without_creating && !widgetname
    #   fail ArgumentError,
    #        "if set 'without_creating' to true, need to define 'widgetname'"
    # end
  elsif keys
    keys = _symbolkey2str(keys)
    widgetname = keys.delete('widgetname')
    install_win(if parent then parent.path end, widgetname)
    without_creating = keys.delete('without_creating')
    # if without_creating && !widgetname
    #   fail ArgumentError,
    #        "if set 'without_creating' to true, need to define 'widgetname'"
    # end
  else
    install_win(if parent then parent.path end)
  end
  if self.method(:create_self).arity == 0
    p 'create_self has no arg' if $DEBUG
    create_self unless without_creating
    if keys
      # tk_call @path, 'configure', *hash_kv(keys)
      configure(keys)
    end
  else
    p 'create_self has args' if $DEBUG
    fontkeys = {}
    methodkeys = {}
    if keys
      #['font', 'kanjifont', 'latinfont', 'asciifont'].each{|key|
      #  fontkeys[key] = keys.delete(key) if keys.key?(key)
      #}
      __font_optkeys.each{|key|
        fkey = key.to_s
        fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)

        fkey = "kanji#{key}"
        fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)

        fkey = "latin#{key}"
        fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)

        fkey = "ascii#{key}"
        fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
      }

      __optkey_aliases.each{|alias_name, real_name|
        alias_name = alias_name.to_s
        if keys.has_key?(alias_name)
          keys[real_name.to_s] = keys.delete(alias_name)
        end
      }

      __methodcall_optkeys.each{|key|
        key = key.to_s
        methodkeys[key] = keys.delete(key) if keys.key?(key)
      }

      __ruby2val_optkeys.each{|key, method|
        key = key.to_s
        keys[key] = method.call(keys[key]) if keys.has_key?(key)
      }
    end
    if without_creating && keys
      #configure(keys)
      configure(__conv_keyonly_opts(keys))
    else
      #create_self(keys)
      create_self(__conv_keyonly_opts(keys))
    end
    font_configure(fontkeys) unless fontkeys.empty?
    configure(methodkeys) unless methodkeys.empty?
  end
end

Dynamic Method Handling

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

Class Method Details

._widget_inspect_full_=(mode) ⇒ Object



5061
5062
5063
# File 'lib/tk.rb', line 5061

def TkWindow._widget_inspect_full_=(mode)
  @@WIDGET_INSPECT_FULL = (mode && true) || false
end

._widget_inspect_full_?Boolean

Returns:

  • (Boolean)


5058
5059
5060
# File 'lib/tk.rb', line 5058

def TkWindow._widget_inspect_full_?
  @@WIDGET_INSPECT_FULL
end

.database_classObject



5232
5233
5234
# File 'lib/tk.rb', line 5232

def self.database_class
  WidgetClassNames[self::WidgetClassName]
end

.database_classnameObject



5229
5230
5231
# File 'lib/tk.rb', line 5229

def self.database_classname
  self::WidgetClassName
end

.to_evalObject

WidgetClassNames = self

> If self is a widget class, entry to the WidgetClassNames table.



5071
5072
5073
# File 'lib/tk.rb', line 5071

def self.to_eval
  self::WidgetClassName
end

Instance Method Details

#bind_classObject



5214
5215
5216
# File 'lib/tk.rb', line 5214

def bind_class
  @db_class || self.class()
end

#bindtags(taglist = nil) ⇒ Object



5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
# File 'lib/tk.rb', line 5708

def bindtags(taglist=nil)
  if taglist
    fail ArgumentError, "taglist must be Array" unless taglist.kind_of? Array
    tk_call('bindtags', path, taglist)
    taglist
  else
    list(tk_call('bindtags', path)).collect{|tag|
      if tag.kind_of?(String)
        if cls = WidgetClassNames[tag]
          cls
        elsif btag = TkBindTag.id2obj(tag)
          btag
        else
          tag
        end
      else
        tag
      end
    }
  end
end

#bindtags=(taglist) ⇒ Object



5730
5731
5732
5733
# File 'lib/tk.rb', line 5730

def bindtags=(taglist)
  bindtags(taglist)
  taglist
end

#bindtags_shiftObject



5735
5736
5737
5738
5739
5740
# File 'lib/tk.rb', line 5735

def bindtags_shift
  taglist = bindtags
  tag = taglist.shift
  bindtags(taglist)
  tag
end

#bindtags_unshift(tag) ⇒ Object



5742
5743
5744
# File 'lib/tk.rb', line 5742

def bindtags_unshift(tag)
  bindtags(bindtags().unshift(tag))
end

#caret(keys = nil) ⇒ Object



5617
5618
5619
# File 'lib/tk.rb', line 5617

def caret(keys=nil)
  TkXIM.caret(path, keys)
end

#colormodel(model = None) ⇒ Object



5612
5613
5614
5615
# File 'lib/tk.rb', line 5612

def colormodel(model=None)
  tk_call('tk', 'colormodel', path, model)
  self
end

#command(cmd = nil, &b) ⇒ Object



5602
5603
5604
5605
5606
5607
5608
5609
5610
# File 'lib/tk.rb', line 5602

def command(cmd=nil, &b)
  if cmd
    configure_cmd('command', cmd)
  elsif b
    configure_cmd('command', Proc.new(&b))
  else
    cget('command')
  end
end

#cursor_propagate(cursor) ⇒ Object



56
57
58
59
60
# File 'lib/tkextlib/tcllib/cursor.rb', line 56

def cursor_propagate(cursor)
  # Sets the cursor for self and all its descendants to cursor.
  #tk_call_without_enc('::cursor::propagate', @path, cursor)
  Tk::Tcllib::Cursor.cursor_propagate(self, cursor)
end

#cursor_restore(cursor = None) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/tkextlib/tcllib/cursor.rb', line 61

def cursor_restore(cursor = None)
  # Restore the original or previously set cursor for self and all its
  # descendants. If cursor is specified, that will be used if on any
  # widget that did not have a preset cursor (set by a previous call
  # to TkWindow#cursor_propagate).
  #tk_call_without_enc('::cursor::restore', @path, cursor)
  Tk::Tcllib::Cursor.cursor_restore(self, cursor)
end

#database_classObject



5221
5222
5223
5224
5225
5226
5227
5228
# File 'lib/tk.rb', line 5221

def database_class
  name = database_classname()
  if WidgetClassNames[name]
    WidgetClassNames[name]
  else
    TkDatabaseClass.new(name)
  end
end

#database_classnameObject



5218
5219
5220
# File 'lib/tk.rb', line 5218

def database_classname
  TkWinfo.classname(self)
end

#destroyObject



5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
# File 'lib/tk.rb', line 5621

def destroy
  super
  children = []
  rexp = /^#{self.path}\.[^.]+$/
  TkCore::INTERP.tk_windows.each{|path, obj|
    children << [path, obj] if path =~ rexp
  }
  if defined?(@cmdtbl)
    for id in @cmdtbl
      uninstall_cmd id
    end
  end

  children.each{|path, obj|
    obj.instance_eval{
      if defined?(@cmdtbl)
        for id in @cmdtbl
          uninstall_cmd id
        end
      end
    }
    TkCore::INTERP.tk_windows.delete(path)
  }

  begin
    tk_call_without_enc('destroy', epath)
  rescue
  end
  uninstall_win
end

#eventloop_wait_destroyObject Also known as: eventloop_wait_window, eventloop_tkwait_destroy, eventloop_tkwait_window



5690
5691
5692
# File 'lib/tk.rb', line 5690

def eventloop_wait_destroy
  wait_destroy(false)
end

#eventloop_wait_visibilityObject Also known as: eventloop_wait, eventloop_tkwait, eventloop_tkwait_visibility



5663
5664
5665
# File 'lib/tk.rb', line 5663

def eventloop_wait_visibility
  wait_visibility(false)
end

#exist?Boolean

Returns:

  • (Boolean)


5208
5209
5210
# File 'lib/tk.rb', line 5208

def exist?
  TkWinfo.exist?(self)
end

#grab(opt = nil) ⇒ Object



5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
# File 'lib/tk.rb', line 5540

def grab(opt = nil)
  unless opt
    tk_call_without_enc('grab', 'set', path)
    return self
  end

  case opt
  when 'set', :set
    tk_call_without_enc('grab', 'set', path)
    return self
  when 'global', :global
    #return(tk_call('grab', 'set', '-global', path))
    tk_call_without_enc('grab', 'set', '-global', path)
    return self
  when 'release', :release
    #return tk_call('grab', 'release', path)
    tk_call_without_enc('grab', 'release', path)
    return self
  when 'current', :current
    return window(tk_call_without_enc('grab', 'current', path))
  when 'status', :status
    return tk_call_without_enc('grab', 'status', path)
  else
    return tk_call_without_enc('grab', opt, path)
  end
end

#grab_currentObject Also known as: current_grab



5567
5568
5569
# File 'lib/tk.rb', line 5567

def grab_current
  grab('current')
end

#grab_releaseObject Also known as: release_grab



5571
5572
5573
# File 'lib/tk.rb', line 5571

def grab_release
  grab('release')
end

#grab_setObject Also known as: set_grab



5575
5576
5577
# File 'lib/tk.rb', line 5575

def grab_set
  grab('set')
end

#grab_set_globalObject Also known as: set_global_grab



5579
5580
5581
# File 'lib/tk.rb', line 5579

def grab_set_global
  grab('global')
end

#grab_statusObject



5583
5584
5585
# File 'lib/tk.rb', line 5583

def grab_status
  grab('status')
end

#grid(keys = nil) ⇒ Object



5309
5310
5311
5312
5313
5314
5315
5316
5317
# File 'lib/tk.rb', line 5309

def grid(keys = nil)
  #tk_call 'grid', epath, *hash_kv(keys)
  if keys
    TkGrid.configure(self, keys)
  else
    TkGrid.configure(self)
  end
  self
end

#grid_anchor(anchor = None) ⇒ Object



5331
5332
5333
5334
5335
5336
5337
5338
# File 'lib/tk.rb', line 5331

def grid_anchor(anchor=None)
  if anchor == None
    TkGrid.anchor(self)
  else
    TkGrid.anchor(self, anchor)
    self
  end
end

#grid_bbox(*args) ⇒ Object



5347
5348
5349
5350
# File 'lib/tk.rb', line 5347

def grid_bbox(*args)
  #list(tk_call('grid', 'bbox', epath, *args))
  TkGrid.bbox(self, *args)
end

#grid_column(index, keys = nil) ⇒ Object



5406
5407
5408
5409
5410
5411
5412
# File 'lib/tk.rb', line 5406

def grid_column(index, keys=nil)
  if keys.kind_of?(Hash)
    grid_columnconfigure(index, keys)
  else
    grid_columnconfiginfo(index, keys)
  end
end

#grid_columnconfig(index, keys) ⇒ Object Also known as: grid_columnconfigure



5366
5367
5368
5369
# File 'lib/tk.rb', line 5366

def grid_columnconfig(index, keys)
  #tk_call('grid', 'columnconfigure', epath, index, *hash_kv(keys))
  TkGrid.columnconfigure(self, index, keys)
end

#grid_columnconfiginfo(index, slot = nil) ⇒ Object



5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
# File 'lib/tk.rb', line 5378

def grid_columnconfiginfo(index, slot=nil)
  #if slot
  #  tk_call('grid', 'columnconfigure', epath, index, "-#{slot}").to_i
  #else
  #  ilist = list(tk_call('grid', 'columnconfigure', epath, index))
  #  info = {}
  #  while key = ilist.shift
  #   info[key[1..-1]] = ilist.shift
  #  end
  #  info
  #end
  TkGrid.columnconfiginfo(self, index, slot)
end

#grid_config(slot, value = None) ⇒ Object Also known as: grid_configure



5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
# File 'lib/tk.rb', line 5352

def grid_config(slot, value=None)
  #if slot.kind_of? Hash
  #  tk_call 'grid', 'configure', epath, *hash_kv(slot)
  #else
  #  tk_call 'grid', 'configure', epath, "-#{slot}", value
  #end
  if slot.kind_of? Hash
    TkGrid.configure(self, slot)
  else
    TkGrid.configure(self, slot=>value)
  end
end

#grid_forgetObject Also known as: ungrid



5340
5341
5342
5343
5344
# File 'lib/tk.rb', line 5340

def grid_forget
  #tk_call('grid', 'forget', epath)
  TkGrid.forget(self)
  self
end

#grid_in(target, keys = nil) ⇒ Object



5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
# File 'lib/tk.rb', line 5319

def grid_in(target, keys = nil)
  if keys
    keys = keys.dup
    keys['in'] = target
  else
    keys = {'in'=>target}
  end
  #tk_call 'grid', epath, *hash_kv(keys)
  TkGrid.configure(self, keys)
  self
end

#grid_infoObject



5422
5423
5424
5425
# File 'lib/tk.rb', line 5422

def grid_info()
  #list(tk_call('grid', 'info', epath))
  TkGrid.info(self)
end

#grid_location(x, y) ⇒ Object



5427
5428
5429
5430
# File 'lib/tk.rb', line 5427

def grid_location(x, y)
  #list(tk_call('grid', 'location', epath, x, y))
  TkGrid.location(self, x, y)
end

#grid_propagate(mode = None) ⇒ Object



5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
# File 'lib/tk.rb', line 5432

def grid_propagate(mode=None)
  #if mode == None
  #  bool(tk_call('grid', 'propagate', epath))
  #else
  #  tk_call('grid', 'propagate', epath, mode)
  #  self
  #end
  if mode == None
    TkGrid.propagate(self)
  else
    TkGrid.propagate(self, mode)
    self
  end
end

#grid_removeObject



5447
5448
5449
5450
5451
# File 'lib/tk.rb', line 5447

def grid_remove()
  #tk_call 'grid', 'remove', epath
  TkGrid.remove(self)
  self
end

#grid_row(index, keys = nil) ⇒ Object



5414
5415
5416
5417
5418
5419
5420
# File 'lib/tk.rb', line 5414

def grid_row(index, keys=nil)
  if keys.kind_of?(Hash)
    grid_rowconfigure(index, keys)
  else
    grid_rowconfiginfo(index, keys)
  end
end

#grid_rowconfig(index, keys) ⇒ Object Also known as: grid_rowconfigure



5372
5373
5374
5375
# File 'lib/tk.rb', line 5372

def grid_rowconfig(index, keys)
  #tk_call('grid', 'rowconfigure', epath, index, *hash_kv(keys))
  TkGrid.rowconfigure(self, index, keys)
end

#grid_rowconfiginfo(index, slot = nil) ⇒ Object



5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
# File 'lib/tk.rb', line 5392

def grid_rowconfiginfo(index, slot=nil)
  #if slot
  #  tk_call('grid', 'rowconfigure', epath, index, "-#{slot}").to_i
  #else
  #  ilist = list(tk_call('grid', 'rowconfigure', epath, index))
  #  info = {}
  #  while key = ilist.shift
  #   info[key[1..-1]] = ilist.shift
  #  end
  #  info
  #end
  TkGrid.rowconfiginfo(self, index, slot)
end

#grid_sizeObject



5453
5454
5455
5456
# File 'lib/tk.rb', line 5453

def grid_size()
  #list(tk_call('grid', 'size', epath))
  TkGrid.size(self)
end

#grid_slaves(keys = nil) ⇒ Object



5458
5459
5460
5461
# File 'lib/tk.rb', line 5458

def grid_slaves(keys = nil)
  #list(tk_call('grid', 'slaves', epath, *hash_kv(args)))
  TkGrid.slaves(self, keys)
end

#inspectObject



5199
5200
5201
5202
5203
5204
5205
5206
# File 'lib/tk.rb', line 5199

def inspect
  if @@WIDGET_INSPECT_FULL
    super
  else
    str = super
    str[0..(str.index(' '))] << '@path=' << @path.inspect << '>'
  end
end

#lower(below = None) ⇒ Object Also known as: lower_window



5587
5588
5589
5590
5591
5592
# File 'lib/tk.rb', line 5587

def lower(below=None)
  # below = below.epath if below.kind_of?(TkObject)
  below = _epath(below)
  tk_call 'lower', epath, below
  self
end

#pack(keys = nil) ⇒ Object



5236
5237
5238
5239
5240
5241
5242
5243
5244
# File 'lib/tk.rb', line 5236

def pack(keys = nil)
  #tk_call_without_enc('pack', epath, *hash_kv(keys, true))
  if keys
    TkPack.configure(self, keys)
  else
    TkPack.configure(self)
  end
  self
end

#pack_config(slot, value = None) ⇒ Object Also known as: pack_configure



5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
# File 'lib/tk.rb', line 5265

def pack_config(slot, value=None)
  #if slot.kind_of? Hash
  #  tk_call 'pack', 'configure', epath, *hash_kv(slot)
  #else
  #  tk_call 'pack', 'configure', epath, "-#{slot}", value
  #end
  if slot.kind_of? Hash
    TkPack.configure(self, slot)
  else
    TkPack.configure(self, slot=>value)
  end
end

#pack_forgetObject Also known as: unpack



5258
5259
5260
5261
5262
# File 'lib/tk.rb', line 5258

def pack_forget
  #tk_call_without_enc('pack', 'forget', epath)
  TkPack.forget(self)
  self
end

#pack_in(target, keys = nil) ⇒ Object



5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
# File 'lib/tk.rb', line 5246

def pack_in(target, keys = nil)
  if keys
    keys = keys.dup
    keys['in'] = target
  else
    keys = {'in'=>target}
  end
  #tk_call 'pack', epath, *hash_kv(keys)
  TkPack.configure(self, keys)
  self
end

#pack_infoObject



5279
5280
5281
5282
5283
5284
5285
5286
5287
# File 'lib/tk.rb', line 5279

def pack_info()
  #ilist = list(tk_call('pack', 'info', epath))
  #info = {}
  #while key = ilist.shift
  #  info[key[1..-1]] = ilist.shift
  #end
  #return info
  TkPack.info(self)
end

#pack_propagate(mode = None) ⇒ Object



5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
# File 'lib/tk.rb', line 5289

def pack_propagate(mode=None)
  #if mode == None
  #  bool(tk_call('pack', 'propagate', epath))
  #else
  #  tk_call('pack', 'propagate', epath, mode)
  #  self
  #end
  if mode == None
    TkPack.propagate(self)
  else
    TkPack.propagate(self, mode)
    self
  end
end

#pack_slavesObject



5304
5305
5306
5307
# File 'lib/tk.rb', line 5304

def pack_slaves()
  #list(tk_call('pack', 'slaves', epath))
  TkPack.slaves(self)
end

#place(keys) ⇒ Object



5463
5464
5465
5466
5467
# File 'lib/tk.rb', line 5463

def place(keys)
  #tk_call 'place', epath, *hash_kv(keys)
  TkPlace.configure(self, keys)
  self
end

#place_config(slot, value = None) ⇒ Object Also known as: place_configure



5488
5489
5490
5491
5492
5493
5494
5495
# File 'lib/tk.rb', line 5488

def place_config(slot, value=None)
  #if slot.kind_of? Hash
  #  tk_call 'place', 'configure', epath, *hash_kv(slot)
  #else
  #  tk_call 'place', 'configure', epath, "-#{slot}", value
  #end
  TkPlace.configure(self, slot, value)
end

#place_configinfo(slot = nil) ⇒ Object



5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
# File 'lib/tk.rb', line 5498

def place_configinfo(slot = nil)
  # for >= Tk8.4a2 ?
  #if slot
  #  conf = tk_split_list(tk_call('place', 'configure', epath, "-#{slot}") )
  #  conf[0] = conf[0][1..-1]
  #  conf
  #else
  #  tk_split_simplelist(tk_call('place',
  #                             'configure', epath)).collect{|conflist|
  #   conf = tk_split_simplelist(conflist)
  #   conf[0] = conf[0][1..-1]
  #   conf
  #  }
  #end
  TkPlace.configinfo(self, slot)
end

#place_forgetObject Also known as: unplace



5481
5482
5483
5484
5485
# File 'lib/tk.rb', line 5481

def  place_forget
  #tk_call 'place', 'forget', epath
  TkPlace.forget(self)
  self
end

#place_in(target, keys = nil) ⇒ Object



5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
# File 'lib/tk.rb', line 5469

def place_in(target, keys = nil)
  if keys
    keys = keys.dup
    keys['in'] = target
  else
    keys = {'in'=>target}
  end
  #tk_call 'place', epath, *hash_kv(keys)
  TkPlace.configure(self, keys)
  self
end

#place_infoObject



5515
5516
5517
5518
5519
5520
5521
5522
5523
# File 'lib/tk.rb', line 5515

def place_info()
  #ilist = list(tk_call('place', 'info', epath))
  #info = {}
  #while key = ilist.shift
  #  info[key[1..-1]] = ilist.shift
  #end
  #return info
  TkPlace.info(self)
end

#place_slavesObject



5525
5526
5527
5528
# File 'lib/tk.rb', line 5525

def place_slaves()
  #list(tk_call('place', 'slaves', epath))
  TkPlace.slaves(self)
end

#raise(above = None) ⇒ Object Also known as: raise_window



5594
5595
5596
5597
5598
5599
# File 'lib/tk.rb', line 5594

def raise(above=None)
  #above = above.epath if above.kind_of?(TkObject)
  above = _epath(above)
  tk_call 'raise', epath, above
  self
end

#set_focus(force = false) ⇒ Object Also known as: focus



5530
5531
5532
5533
5534
5535
5536
5537
# File 'lib/tk.rb', line 5530

def set_focus(force=false)
  if force
    tk_call_without_enc('focus', '-force', path)
  else
    tk_call_without_enc('focus', path)
  end
  self
end

#thread_wait_destroyObject Also known as: thread_wait_window, thread_tkwait_destroy, thread_tkwait_window



5694
5695
5696
# File 'lib/tk.rb', line 5694

def thread_wait_destroy
  wait_destroy(true)
end

#thread_wait_visibilityObject Also known as: thread_wait, thread_tkwait, thread_tkwait_visibility



5666
5667
5668
# File 'lib/tk.rb', line 5666

def thread_wait_visibility
  wait_visibility(true)
end

#tktrans_get_imageObject



37
38
39
# File 'lib/tkextlib/tktrans/tktrans.rb', line 37

def tktrans_get_image()
  tk_send('tktrans::setwidget', @path)
end

#tktrans_set_image(img) ⇒ Object



33
34
35
36
# File 'lib/tkextlib/tktrans/tktrans.rb', line 33

def tktrans_set_image(img)
  tk_send('tktrans::setwidget', @path, img)
  self
end

#wait_destroy(on_thread = true) ⇒ Object Also known as: wait_window, tkwait_destroy, tkwait_window



5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
# File 'lib/tk.rb', line 5678

def wait_destroy(on_thread = true)
  if $SAFE >= 4
    fail SecurityError, "can't wait destroy at $SAFE >= 4"
  end
  on_thread &= (Thread.list.size != 1)
  if on_thread
    INTERP._thread_tkwait('window', epath)
  else
    INTERP._invoke('tkwait', 'window', epath)
  end
end

#wait_visibility(on_thread = true) ⇒ Object Also known as: wait, tkwait



5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
# File 'lib/tk.rb', line 5652

def wait_visibility(on_thread = true)
  if $SAFE >= 4
    fail SecurityError, "can't wait visibility at $SAFE >= 4"
  end
  on_thread &= (Thread.list.size != 1)
  if on_thread
    INTERP._thread_tkwait('visibility', path)
  else
    INTERP._invoke('tkwait', 'visibility', path)
  end
end