seemex を Ubuntu 11.04 で動かすテスト。
あらら色々問題が。
まず前回書いた StyleContext は GTK+ 2 では使えない。
# Toolbar Style
toolbar = self.uimanager.get_widget('/ToolBar')
toolbar.set_style(gtk.ToolbarStyle.ICONS)
try:
style = toolbar.get_style_context()
gtk.StyleContext.add_class(style, gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
except Exception, s:
pass # GTK+ 2
コレでいいや、GNOME 3 に合わせたいだけの処理なのだし。
AboutDialog の get_major_version() メソッドも使えなかった。
MAJOR_VERSION とかの定数はどちらでも使えるからコッチに変更しよう。
更に GtkTreeView 順番を上に移動する iter_previous もダメか。
GtkTreePath には確か prev メソッドがあったよな。
def on_item_up(self, widget, event=None):
selection = self.custome_treeview.get_selection()
model, it = selection.get_selected()
p = model.get_path(it)
if it:
path = model.get_path(it)
if path.prev():
itprev = model.get_iter(path)
model.swap(it, itprev)
self.change()
""" GTK+ 3
itprev = it.copy()
if model.iter_previous(itprev):
model.swap(it, itprev)
self.change()"""
else:
self.messagebox(MESSAGE_NON_SELECT)
せっかく簡単になったけど GTK+ 2 のままの Ubuntu を考慮しなきゃとは…
しかし Fedora の VirtualBox ose アップデートはまだか。
右 Ctrl+F でもそのまんま XGA サイズだし \ は打てないし辛い。






