# File gtk/sample/gtk-demo/cairo-operator.rb, line 64 def operator_selector combo = Gtk::ComboBox.new operators = [] Cairo.constants.each do |name| operators << name if /^OPERATOR_/ =~ name end operators.sort.each_with_index do |name, i| combo.append_text(name) combo.set_active(i) if Cairo.const_get(name) == @operator end combo.signal_connect("changed") do |widget| text = widget.active_text @operator = Cairo.const_get(text) if text @drawing_area.queue_draw end combo end