David M. Cook wrote:

What was the secret?

I spoke too soon. I'm no closer to understanding how Rectangles are handled
by pygtk. I was embarassed that I might be rehashing old ground, but there
is almost nothing on this subject in over 11M of pygtk list archives.
gdk.Rectangle has a copy method. Playing around a bit, you can get a
GdkRectangle by copying, say, Widget.allocation:

rect = somewidget.allocation.copy()

However, I tried passing this to TreeView.get_visible_rect, but the passed
in rect doesn't change. I was able to get what I wanted (the first visible
row & col on the top left (origin) of the TreeView) with
TreeView.get_path_at_pos(0,0) (if you want the column number in the
callback, you'll need to attach an integer to ViewColumn at creation time;
there are still a few holes in the C-Gtk TreeView API.)

You shouldn't be needing to do all thse tricks :)

There isn't very many cases in GTK where inout GdkRectangle arguments are used. For in args, you should be able to just pass a sequence of integers to get it to work. As out arguments are not pythonic, I have converted them to return values in most places. If I have missed one, please submit a bugzilla bug so that it can be fixed.

James.

--
Email: [EMAIL PROTECTED] | Linux.conf.au http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.


_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Reply via email to