Module: Tk::TkDND::Shape

Extended by:
TkCore
Defined in:
lib/tkextlib/tkDND/shape.rb

Constant Summary collapse

PACKAGE_NAME =
'shape'.freeze

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 TkUtil

TkUtil::None, TkUtil::RELEASE_DATE

Class Method Summary collapse

Instance Method Summary collapse

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, #bind, #bind_all, #bind_append, #bind_append_all, #bind_remove, #bind_remove_all, #bindinfo, #bindinfo_all, #image_obj, #install_cmd, #subst, #uninstall_cmd

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

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

Class Method Details

.package_nameObject



23
24
25
# File 'lib/tkextlib/tkDND/shape.rb', line 23

def self.package_name
  PACKAGE_NAME
end

.package_patchlevelObject



41
42
43
# File 'lib/tkextlib/tkDND/shape.rb', line 41

def self.package_patchlevel
  Tk.tk_call('set', 'shape_patchlevel')
end

.package_versionObject

def self.package_version

  begin
    TkPackage.require('shape')
  rescue
    ''
  end
end


36
37
38
# File 'lib/tkextlib/tkDND/shape.rb', line 36

def self.package_version
  Tk.tk_call('set', 'shape_version')
end

.versionObject



46
47
48
# File 'lib/tkextlib/tkDND/shape.rb', line 46

def self.version
  tk_call('shape', 'version')
end

Instance Method Details

#shape_bounds(kind = nil) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/tkextlib/tkDND/shape.rb', line 53

def shape_bounds(kind=nil)
  if kind
    ret = tk_call('shape', 'bounds', @path, "-#{kind}")
  else
    ret = tk_call('shape', 'bounds', @path)
  end
  if ret == ""
    nil
  else
    list(ret)
  end
end

#shape_get(kind = nil) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/tkextlib/tkDND/shape.rb', line 66

def shape_get(kind=nil)
  if kind
    list(tk_call('shape', 'get', @path, "-#{kind}"))
  else
    list(tk_call('shape', 'get', @path))
  end
end

#shape_offset(x, y, kind = nil) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/tkextlib/tkDND/shape.rb', line 74

def shape_offset(x, y, kind=nil)
  if kind
    tk_call('shape', 'get', @path, "-#{kind}", x, y)
  else
    tk_call('shape', 'get', @path, x, y)
  end
  self
end

#shape_set(*args) ⇒ Object

?kind? ?offset <x> <y>? srckind ?arg ...?



108
109
110
111
# File 'lib/tkextlib/tkDND/shape.rb', line 108

def shape_set(*args) # ?kind? ?offset <x> <y>? srckind ?arg ...?
  tk_call('shape', 'set', @path, *(_parse_shapespec_param(args)))
  self
end

#shape_update(op, *args) ⇒ Object

?kind? ?offset <x> <y>? srckind ?arg ...?



113
114
115
116
# File 'lib/tkextlib/tkDND/shape.rb', line 113

def shape_update(op, *args) # ?kind? ?offset <x> <y>? srckind ?arg ...?
  tk_call('shape', 'update', @path, op, *(_parse_shapespec_param(args)))
  self
end