create(chart, keys={})
click to toggle source
def self.create(chart, keys={})
unless self::MarkerTypeName
fail RuntimeError, "#{self} is an abstract class"
end
args, fontkeys, methodkeys = _parse_create_args(keys)
idnum = tk_call_without_enc(chart.path, 'marker', 'create',
self::MarkerTypeName, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
chart.marker_configure(idnum, methodkeys) unless methodkeys.empty?
idnum.to_i
end
create_type(chart, type, keys={})
click to toggle source
def self.create_type(chart, type, keys={})
args, fontkeys, methodkeys = _parse_create_args(keys)
idnum = tk_call_without_enc(chart.path, 'marker', 'create',
type, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
chart.marker_configure(idnum, methodkeys) unless methodkeys.empty?
id = idnum.to_i
obj = self.allocate
obj.instance_eval{
@parent = @chart = chart
@cpath = chart.path
@id = id
Tk::BLT::PlotComponent::Marker::MarkerID_TBL.mutex.synchronize{
Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath] ||= {}
Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath][@id] = self
}
}
obj
end
id2obj(chart, id)
click to toggle source
def Marker.id2obj(chart, id)
cpath = chart.path
MarkerID_TBL.mutex.synchronize{
if MarkerID_TBL[cpath]
MarkerID_TBL[cpath][id]? MarkerID_TBL[cpath][id]: id
else
id
end
}
end
new(parent, *args)
click to toggle source
def initialize(parent, *args)
@parent = @chart = parent
@cpath = parent.path
@path = @id = create_self(*args)
Tk::BLT::PlotComponent::Marker::MarkerID_TBL.mutex.synchronize{
Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath] ||= {}
Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath][@id] = self
}
end
type2class(type)
click to toggle source
def Marker.type2class(type)
MarkerTypeToClass[type]
end
after(target=None)
click to toggle source
def after(target=None)
@chart.marker_after(@id, target)
end
before(target=None)
click to toggle source
def before(target=None)
@chart.marker_before(@id, target)
end
cget(option)
click to toggle source
def cget(option)
@chart.marker_cget(@id, option)
end
cget_strict(option)
click to toggle source
def cget_strict(option)
@chart.marker_cget_strict(@id, option)
end
cget_tkstring(option)
click to toggle source
def cget_tkstring(option)
@chart.marker_cget_tkstring(@id, option)
end
configinfo(key=nil)
click to toggle source
def configinfo(key=nil)
@chart.marker_configinfo(@id, key)
end
current_configinfo(key=nil)
click to toggle source
def current_configinfo(key=nil)
@chart.current_marker_configinfo(@id, key)
end
delete()
click to toggle source
def delete
@chart.marker_delete(@id)
end
exist?()
click to toggle source
def exist?
@chart.marker_exist(@id)
end
id()
click to toggle source
to_eval()
click to toggle source
type()
click to toggle source
def type
@chart.marker_type(@id)
end