On 21 Mar 2001, satish k wrote:
> Hi.
>
> i have a problem with setting the style of widget.
> i want to set the bg style of the widget using bg_pixmap.
>
> My code is some thing like this.
>
> win=GtkWindow()
> style=win.get_style ().copy ()
> img = GdkImlib.Image("test.png")
> img.render()
> pix = img.make_pixmap ()
> style.bg_pixmap[STATE_NORMAL]=pix
> win.set_style(style)
> win.show_all()
>
> I get the following error :
> style.bg_pixmap[STATE_NORMAL]=pix
> TypeError: can only assign a GdkPixmap or None
>
> is pix not of type GdkPixmap? if so how to solve this problem?
It is not of the type GdkPixmap. It is a GtkPixmap widget. Use the
following:
pix, mask = img.get_pixmap()
That will give you a GdkPixmap.
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk