Sha256: 2fefc3e168453b101837cfadaee9caec2f3402a026365f5b36cbcd31f56a096a
Contents?: true
Size: 1.53 KB
Versions: 6
Compression:
Stored size: 1.53 KB
Contents
# Copyright (c) 2023 M.J.N. Corino, The Netherlands # # This software is released under the MIT license. # Wx::PG::PGProperty module Wx::PG NullProperty = nil PGChoicesEmptyData = nil PG_LABEL_STRING = '@!' unless self.const_defined?(:PG_LABEL_STRING) # disappeared >= wxWidgets 3.3.0 PG_LABEL = Wx::PG::PG_LABEL_STRING PG_DEFAULT_IMAGE_SIZE = Wx::DEFAULT_SIZE class PGProperty wx_each_attribute = instance_method :each_attribute define_method :each_attribute do if block_given? wx_each_attribute.bind(self).call else ::Enumerator.new { |y| wx_each_attribute.bind(self).call { |variant| y << variant } } end end def get_attributes each_attribute.inject({}) { |map, v| map[v.name] = v; map } end alias :attributes :get_attributes def set_attributes(map) raise ArgumentError, 'Expected Hash' unless map.is_a?(::Hash) map.each_pair { |nm, v| set_attribute(nm, v) } end alias :attributes= :set_attributes end class PGChoices wx_each_label = instance_method :each_label define_method :each_label do if block_given? wx_each_label.bind(self).call else ::Enumerator.new { |y| wx_each_label.bind(self).call { |lbl| y << lbl } } end end wx_each_entry = instance_method :each_entry define_method :each_entry do if block_given? wx_each_entry.bind(self).call else ::Enumerator.new { |y| wx_each_entry.bind(self).call { |entry| y << entry } } end end end end
Version data entries
6 entries across 6 versions & 1 rubygems