On Wed, 2003-11-12 at 16:21, Morten Heiberg wrote:
> Hi gurus and lurkers
> 
> I have searched both the FAQ and the list archives, but I haven't found
> an answer to this question, so now I risk asking it myself.
> 
> The problem is: I would like to place widgets on top of an image.
> 
> I am making an app that is not going to look like a classic "GTK-app",
> so in my case I am placing clickable pixmaps (eventboxes with images in
> them instead of classic buttons) in a gtk.Fixed area. This seems to work
> well for my purpose.
> 
> Now I would like to have a background picture that fits with the
> buttons. I have limited GTK-knowledge but I assume that this would have
> to be done in the gtk.Fixed widget (it's actually in a multipage
> notebook with hidden tabs to facilitate changing the entire interface,
> but I don't think that matters here).
> 
> Maybe if I install a handler for some "draw the gtk.Fixed widget" event
> that somehow gets a drawable area and renders a bitmap on it before the
> contained widgets are drawn? Or maybe there is some simple
> gtk.Fixed.set_background_image() function that I just haven't been able
> to find?
> 
> I hope I am making sense here...
> 
> What is the "right" way to do this? I am using Python, PyGTK, libglade
> and Glade to do this.
> 
> I would really appreciate any advice you might have on this! :-)
> 
> Cheers!
> 
>       /Morten

I did this using glade.  I have buttons in a table in a frame and I also
used a pixmap inside an eventbox in a different frame for the part of
the background that wasn't occupied by buttons.  I set the button
pixmaps in a map event handler and I do that by:

c = btn.children()
if c:
    # a button can only have one child
    btn.remove(c[0])

win = gtk.GtkWindow()
pm = gtk.GtkPixmap(win, build_path('BladeModule.xpm', mwsbase.screenSize), None)
pm.show()
btn.add(pm)

The background pixmap is defined in the glade file.

-- 
Steve McClure <[EMAIL PROTECTED]>
Racemi, Inc.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
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