Axel R. wrote:

Hi all,
I would like click on a label who is put on a Fixed container - I've put an
image on this Fixed to do something like this :
http://www.cursodeesperanto.com.br/fr/ekrano1.jpg
I've found that I can't connect a signal on a label and I have to use a
eventBox
to do this.
But now, I've 2 problems :
- The EventBox have a gray background and I see a gray area around my label
:-(
Is it possible to make it transparent ?


EventBox.set_visible_window(False)

thank you, it's work but...

- When I put my mouse on the eventBox, I would like to see a "hand" cursor,
I've
try to do something like eventBox.window.set_cursor but the eventBox.window
is
"None" type. So, how change the cursor.


The eventBox and its parent widgets have to be shown before the
eventBox.window is created. Try setting the cursor after showing the
widget hierarchy.

I've try with this :
print e.window
l.show()
e.show()
fixed.show()
self.window.show()
print e.window

But it don't work (it display "None" 2 times)

usually, when should I showing the widget ?

Try this program:

---------------
import gtk
w=gtk.Window()
f=gtk.Fixed()
w.add(f)
eb=gtk.EventBox()
eb.set_visible_window(False)
f.add(eb)
l=gtk.Label('TESTING')
eb.add(l)
w.show_all()
eb.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.HAND2))
gtk.main()
---------------

Works for me.

John
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to