[pygtk] Rendering arbitrary widgets in a CellRenderer

Neil Muller drnlmuller+gtk at gmail.com
Thu May 14 04:53:04 WST 2009


On Wed, May 13, 2009 at 6:20 PM, Walter Leibbrandt
<walter at translate.org.za> wrote:
> Walter Leibbrandt wrote:
> I've got it working with a hack, but one important problem remains: The
> CellRenderer's size is calculated based on the string rendered for
> unselected cells. This means that, if the widget rendered in a selected
> cell needs more space than the rendered string, it is simply cut off.
> The problem (as far as I can tell) seems to arise from the fact that the
> widget to render in the cell has not yet been realize()d and thus has no
> allocation.

Since you're looking to allocate enough space to display the widget,
you shouldn't need to realize the widgets first. It looks like the
problem is with your use of set_size_request() and get_size_request(),
since get_size_request() only returns the values set via
set_size_request(). Just using size_request() should do what you want.

-- 
Neil Muller
drnlmuller at gmail.com

I've got a gmail account. Why haven't I become cool?


More information about the pygtk mailing list