logo

scripts

Unnamed repository; edit this file 'description' to name the repository.
commit: 53f887c32496628a1173daf3d4595c9ac4ca6a9c
parent: 008348ece09b4cf2aa1002d8f2297a8176d34fc6
Author: Haelwenn Monnier <lanodan.delta@free.fr>
Date:   Thu,  5 Sep 2013 08:14:45 +0200

Create image.py

Diffstat:

image.py | 31+++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+), 0 deletions(-)

diff --git a/image.py b/image.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import gtk + +class Image: + def __init__(self): + window = gtk.Window() + window.set_default_size(640, 480) + + vbox = gtk.VBox(False, 5) + + scrolledwindow = gtk.ScrolledWindow() + + self.image = gtk.Image() + self.button = gtk.FileChooserButton("Select Image", None) + + self.button.connect("file-set", self.load_image) + + window.add(vbox) + vbox.pack_start(self.button, False, False, 0) + vbox.pack_start(scrolledwindow, True, True, 0) + + scrolledwindow.add_with_viewport(self.image) + + window.show_all() + + def load_image(self, widget): + self.image.set_from_file(self.button.get_filename()) + +Image() +gtk.main()