Sha256: 62985bf4de1b167e55a7a3df457fcfb3bd47e960ead8bf0b43d116a5173cf72e
Contents?: true
Size: 1.21 KB
Versions: 19
Compression:
Stored size: 1.21 KB
Contents
--- :wxColourDialog: :detail: :pre: :programlisting: - :pattern: !ruby/regexp /.*/ :replace: | ```ruby # Some function for redrawing using the given colour. Ideally, it # shouldn't do anything if the colour is the same as the one used # before. # def redraw(colour) ... end data = Wx::ColourData.new data.set_colour(initialColourToUse) Wx::ColourDialog(self, data) do |dlg| dlg.evt_colour_changed { |event| redraw(event.get_colour) } if dlg.show_modal == Wx::ID_OK # Colour did change. else # Colour didn't change. end end # This call is unnecessary under platforms generating # Wx::EVT_COLOUR_CHANGED if the dialog was accepted and unnecessary # under the platforms not generating this event if it was cancelled, # so we could check for the different cases explicitly to avoid it, # but it's simpler to just always call it. redraw(data.get_colour) ```
Version data entries
19 entries across 19 versions & 1 rubygems