# what the fuck, GTK
import gtk
-import hildon
+try:
+ import hildon
+ _using_helldon = False
+except:
+ import helldon as hildon
+ _using_helldon = True
class ListBox(gtk.TreeView):
def __init__(self):
class ListDialog(gtk.Dialog):
def __init__(self, title, parent=None):
- gtk.Dialog.__init__(self, title, parent)
+ gtk.Dialog.__init__(self, title, parent if not _using_helldon else None)
self.listbox = ListBox()
panarea = hildon.PannableArea()
panarea.add(self.listbox)
- panarea.set_size_request(800, 300)
+ panarea.set_size_request_policy(hildon.SIZE_REQUEST_CHILDREN)
self.vbox.pack_start(panarea, True, True, 0)
self.selected = None
class ButtonListDialog(gtk.Dialog):
def __init__(self, title, parent=None):
- gtk.Dialog.__init__(self, title, parent)
+ gtk.Dialog.__init__(self, title, parent if not _using_helldon else None)
self.panarea = hildon.PannableArea()
self.panarea.set_size_request(800, 400)
self.buttons = gtk.VBox(False, 0)
self.vbox.pack_start(self.panarea, True, True, 0)
def add_button(self, label, clickcb, *args):
- btn = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH|gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
+ btn = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH|gtk.HILDON_SIZE_FINGER_HEIGHT,
+ hildon.BUTTON_ARRANGEMENT_VERTICAL)
btn.set_label(label)
btn.connect('clicked', clickcb, *args)
- self.buttons.pack_end(btn, False, False, 0)
+ self.buttons.pack_start(btn, False, False, 0)