1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #!/usr/bin/env ruby
require 'gtk2'
store=Gtk::ListStore.new(String,FalseClass)
child=store.append
child[0]='Texte normal'
child[1]=false
child=store.append
child[0]='Texte en gras'
child[1]=true
listview=Gtk::TreeView.new(store)
renderer=Gtk::CellRendererText.new
renderer.weight=Pango::WEIGHT_BOLD
col=Gtk::TreeViewColumn.new("Texte", renderer, :text => 0, :weight_set => 1)
listview.append_column(col)
window=Gtk::Window.new
window.signal_connect("destroy") {Gtk.main_quit}
window.add(listview)
window.show_all
Gtk.main |
Partager