set image value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
         as u can see what does the code do here,I had created a label and pass the string num one to it, as the button Anotherdown there is clicked,the function random.randinit, sets another value at the label .Did u get my point.Now i want to create a simillar function for the image widget .I want to set a random value or pass an array value of image  in a container widget.i did this but once the images are set in the container widget they are not replaced by another value.Is there any way i can do this like its done in label widget .


self.numOne = random.randint(1,10)
self.wTree.get_widget("label3").set_label(str(self.numOne))


def buttonAnother_clicked(self, widget):
        print "Another here..."
        self.numOne = random.randint(1,10)
        print "Number One:", self.numOne




.............................................................................................................
here is the code for image



        self.fixed=self.wTree.get_widget("fixed2")
        self.eb=self.wTree.get_widget("eventbox6")
        self.eb.modify_bg(gtk.STATE_NORMAL, self.eb.get_colormap().alloc_color("white"))
        self.fixed.show()

        for i in range(0, 10):
           
            self.image = gtk.Image()
            self.image.set_from_file("./Red-Flower-32x32.png")
            self.fixed.put(self.image, self.i*15, 0)
            self.image.show()
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux