Re: [pygtk] working with buttons and images...
A Qui, 2003-10-30 às 17:36, Ivan Hernandez escreveu: > Thanks You Gustavo! your info i helping me a lot and also is a good > point to check having now the reference manual from > > http://yang.inescn.pt/~gjc/pygtk2reference/ Oops, I pasted that link by mistake. That is *not* the official pygtk reference! :) Please use this link instead: http://www.moeraki.com/pygtkreference/pygtk2reference/index.html Thanks! > > ivan hernandez > > Gustavo J. A. M. Carneiro wrote: > > >A Qui, 2003-10-30 às 15:27, Ivan Hernandez escreveu: > > > > > >>hello. i had been working a little with pygtk, and i haven't found a way > >>to make a pixmap "scale" to an arbitrary size. > >>i mean this... i have my button with an image, let's say... > >> > >> > > > > Very roughly, the solution is among these lines. Look into > >http://yang.inescn.pt/~gjc/pygtk2reference/ for more info. > > > > > >pix_small = gtk.gdk.pixbuf_new_from_file("icon-small.png") > >pix_large = gtk.gdk.pixbuf_new_from_file("icon-small.png") > > > >image = gtk.Image() > >image.set_from_pixbuf(pix_small) > > > >image.show() > > > >button = gtk.Button() > >button.add(image) > >button.show() > > > >def button_enter(bt, ev): > > bt.child.set_from_pixbuf(pix_large) > >def button_enter(bt, ev): > > bt.child.set_from_pixbuf(pix_small) > > > >button.connect("enter-notify-event", button_enter) > >button.connect("leave-notify-event", button_leave) > > > > That's it. I could have misspelled some function names, be warned. > >Good luck. > > > > > > > > > ___ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ -- Gustavo João Alves Marques Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] working with buttons and images...
Thanks You Gustavo! your info i helping me a lot and also is a good point to check having now the reference manual from http://yang.inescn.pt/~gjc/pygtk2reference/ ivan hernandez Gustavo J. A. M. Carneiro wrote: A Qui, 2003-10-30 às 15:27, Ivan Hernandez escreveu: hello. i had been working a little with pygtk, and i haven't found a way to make a pixmap "scale" to an arbitrary size. i mean this... i have my button with an image, let's say... Very roughly, the solution is among these lines. Look into http://yang.inescn.pt/~gjc/pygtk2reference/ for more info. pix_small = gtk.gdk.pixbuf_new_from_file("icon-small.png") pix_large = gtk.gdk.pixbuf_new_from_file("icon-small.png") image = gtk.Image() image.set_from_pixbuf(pix_small) image.show() button = gtk.Button() button.add(image) button.show() def button_enter(bt, ev): bt.child.set_from_pixbuf(pix_large) def button_enter(bt, ev): bt.child.set_from_pixbuf(pix_small) button.connect("enter-notify-event", button_enter) button.connect("leave-notify-event", button_leave) That's it. I could have misspelled some function names, be warned. Good luck. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] working with buttons and images...
A Qui, 2003-10-30 às 15:27, Ivan Hernandez escreveu: > hello. i had been working a little with pygtk, and i haven't found a way > to make a pixmap "scale" to an arbitrary size. > i mean this... i have my button with an image, let's say... Very roughly, the solution is among these lines. Look into http://yang.inescn.pt/~gjc/pygtk2reference/ for more info. pix_small = gtk.gdk.pixbuf_new_from_file("icon-small.png") pix_large = gtk.gdk.pixbuf_new_from_file("icon-small.png") image = gtk.Image() image.set_from_pixbuf(pix_small) image.show() button = gtk.Button() button.add(image) button.show() def button_enter(bt, ev): bt.child.set_from_pixbuf(pix_large) def button_enter(bt, ev): bt.child.set_from_pixbuf(pix_small) button.connect("enter-notify-event", button_enter) button.connect("leave-notify-event", button_leave) That's it. I could have misspelled some function names, be warned. Good luck. -- Gustavo João Alves Marques Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] working with buttons and images...
hello. i had been working a little with pygtk, and i haven't found a way to make a pixmap "scale" to an arbitrary size. i mean this... i have my button with an image, let's say... image = gtk.Image() image.set_from_file("apple-red.png") image.show() button = gtk.Button() button.add(image) button.show() And i wanna make the image grow when the mouse is over... is this possible??? where can i found information on things like that? i have readed a tutorial but there is no more info. thanks ivan hernandez. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/