1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
# essais.py
import pygtk
pygtk.require('2.0')
import gtk
# Un truc
class Truc(gtk.Image):
def __init__(self):
gtk.Image.__init__(self)
self.set_from_file("ic1.png")
self.show()
#Fenêtre principale
class PyApp(gtk.Window):
def __init__(self):
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
self.maximize()
self.set_title("essais")
truc=Truc()
boiteV=gtk.VBox(homogeneous=False, spacing=0)
boiteV.pack_start(truc, expand=False, fill=True, padding=0)
self.add(boiteV)
self.connect('destroy', gtk.main_quit)
self.show_all()
def boucle(self):
gtk.main()
if __name__ == "__main__":
pyApp=PyApp()
pyApp.boucle() |