Re: [pygtk] Help installing PyGObject

2013-03-12 Thread Hrvoje Niksic

On 03/05/2013 09:20 PM, Vincent D. Brown wrote:

I was wondering if anyone could help me with some installation trouble.
I downloaded PyGObject 3.0.2 and tried running configure.  It said that
I don't have glib version = 2.24.0, so I found glib 2.24.2 and
installed it.  The configure still stops on the same error:

checking for GLIB - version = 2.24.0... no


What is the output of pkg-config --cflags glib-2.0? It should point to 
your newly installed glib 2.24.2, and not to the old glib present on the 
system. If this is not the case, you either need to put the installed 
directory on PKG_CONFIG_PATH, or see what went wrong with the installation.


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] Change cursor on a single widget

2013-03-12 Thread Timo

Op 11-03-13 15:49, Neil Muller schreef:

On 11 March 2013 00:37, Timo timomli...@gmail.com wrote:

I seem to be unable to change the cursor on one widget only, not an entire
window. How is this done? Below is a testscript which I thought was the
right way.

Run normal to use PyGI, run with -p argument for PyGTK. Both act the same.
def run_pygtk():
 import gtk

 def disable_cb(widget):
 widget.set_sensitive(False)
 cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
 widget.window.set_cursor(cursor)

This works for widgets which have their own gtk.gdkWindows. It's
mentioned in the gtk docs that this isn't always the case, and several
widgets will return their parent's gtk.gdk.Window. You can check for
this using the get_has_window method.
Thanks for that. I did read that part, but foolishly assumed it were 
just those few mentioned widgets which don't have a GdkWindow. In my 
real life application, I have stuff packed into a frame=alignment=box 
and neither of those have a GdkWindow.


The get_has_window method comes in handy!

Cheers,
Timo



One approach is to stuff the buttons inside an EventBox, since that
will definitely provide it's own gtk.gdk.Window  - something along the
lines of:

def run_pygtk():
 import gtk

 def disable_cb(widget, eventbox):
 widget.set_sensitive(False)
 cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
 eventbox.window.set_cursor(cursor)

 win = gtk.Window()
 win.resize(400, 400)
 win.set_title(PyGTK example)
 win.connect('delete-event', gtk.main_quit)

 eventbox = gtk.EventBox()

 b1 = gtk.Button('Disable me')
 b1.connect('clicked', disable_cb, eventbox)
 eventbox.add(b1)
 b2 = gtk.Button('I do nothing')
 box = gtk.VBox()
 box.pack_start(eventbox, False, False, 0)
 box.pack_start(b2, False, False, 0)
 win.add(box)
 win.show_all()



___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/