# File tk/lib/tkextlib/blt/component.rb, line 1219
def self.create(chart, keys={})
unless self::MarkerTypeName
fail RuntimeError, "#{self} is an abstract class"
end
args, fontkeys = _parse_create_args(keys)
idnum = tk_call_without_enc(chart.path, 'marker', 'create',
self::MarkerTypeName, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
idnum.to_i # 'item id' is an integer number
end
# File tk/lib/tkextlib/blt/component.rb, line 1230
def self.create_type(chart, type, keys={})
args, fontkeys = _parse_create_args(keys)
idnum = tk_call_without_enc(chart.path, 'marker', 'create',
type, *args)
chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
id = idnum.to_i # 'item id' is an integer number
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
# File tk/lib/tkextlib/blt/component.rb, line 1162
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
# File tk/lib/tkextlib/blt/component.rb, line 1249
def initialize(parent, *args)
@parent = @chart = parent
@cpath = parent.path
@path = @id = create_self(*args) # an integer number as 'item 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
}
end
# File tk/lib/tkextlib/blt/component.rb, line 1289
def after(target=None)
@chart.marker_after(@id, target)
end
# File tk/lib/tkextlib/blt/component.rb, line 1293
def before(target=None)
@chart.marker_before(@id, target)
end
# File tk/lib/tkextlib/blt/component.rb, line 1272
def cget(option)
@chart.marker_cget(@id, option)
end
# File tk/lib/tkextlib/blt/component.rb, line 1275
def cget_strict(option)
@chart.marker_cget_strict(@id, option)
end
# File tk/lib/tkextlib/blt/component.rb, line 1282
def configinfo(key=nil)
@chart.marker_configinfo(@id, key)
end
# File tk/lib/tkextlib/blt/component.rb, line 1278
def configure(key, value=None)
@chart.marker_configure(@id, key, value)
self
end
# File tk/lib/tkextlib/blt/component.rb, line 1285
def current_configinfo(key=nil)
@chart.current_marker_configinfo(@id, key)
end
# File tk/lib/tkextlib/blt/component.rb, line 1297
def delete
@chart.marker_delete(@id)
end
# File tk/lib/tkextlib/blt/component.rb, line 1301
def exist?
@chart.marker_exist(@id)
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.