バグ #1177 » gtk_form_dsl_select.patch
core/mui/gtk_form_dsl_select.rb | ||
---|---|---|
88 | 88 |
# すべてテキストなら、コンボボックスで要素を描画する |
89 | 89 |
def build_combobox(config_key) |
90 | 90 |
input = Gtk::ComboBox.new(true) |
91 |
sorted = @options.map{ |o| o.first }.sort_by(&:to_s).freeze |
|
92 |
sorted.each{ |x| |
|
93 |
input.append_text(@options.assoc(x).last) } |
|
94 |
input.active = (sorted.index{ |i| i.to_s == @parent_dslobj[config_key].to_s } || 0) |
|
95 |
@parent_dslobj[config_key] = sorted[input.active] |
|
91 |
@options.each{ |t| |
|
92 |
input.append_text(t.last) } |
|
93 |
input.active = (@options.index{ |i| i.first.to_s == @parent_dslobj[config_key].to_s } || 0) |
|
94 |
@parent_dslobj[config_key] = @options[input.active].first |
|
96 | 95 |
input.ssc(:changed){ |widget| |
97 |
@parent_dslobj[config_key] = sorted[widget.active]
|
|
96 |
@parent_dslobj[config_key] = @options[widget.active].first
|
|
98 | 97 |
false } |
99 | 98 |
input |
100 | 99 |
end |