On Mon, 31 Jul 2000 10:29:55 +0200, Javi Roman <[EMAIL PROTECTED]> wrote:
> > I have the following code:
> >
> > from gtk import *
> >
> > rcfile = """
> > pixmap_path "/home"
> > style "back" {
> >        bg_pixmap[NORMAL] = "image.xpm"
> > }
> > widget "*mystyle" style "back"
> > """
> >
> > Everything works correctly. But the load of the image is very slow,
> > therefore I have tried to use the following thing:
> >
> > from gtk import *
> >
> > rcfile = """
> > pixmap_path "/home"
> > style "back" {
> >        bg_pixmap[NORMAL] = "image.png"
> > }
> > widget "*mystyle" style "back"
> > """
> >
> > It does not load the PNG image, why?.
> > In other programs I have seen that they load PNG images without
> > problems.

Note: I don't know much about the gtk rc stuff.

I think what you've seen the other programs use is a gtk-theme-engine,
not the "regular" rc parsing.  

I've never gotten that crap to work, you have to do some garbage like
this (example doesn't work):

#!/usr/bin/python
from gtk import *

rcfile = """
pixmap_path "/home/mnt/acano/src/pygtk/rcfile"
module_path "/usr/lib/gtk/themes/engines"
style "back" {
        #bg_pixmap[NORMAL] = "image.png"
        engine "pixmap" {
                image {
                                function        = BOX
                                recolorable     = TRUE
                                detail          = "button"
                                state           = NORMAL
                                shadow          = IN
                                file            = "image.png"
                                border          = { 3, 3, 3, 3 }
                                stretch         = TRUE

                }
        }
}

widget "main window.*GtkButton*" style "back"
#class "GtkWidget" style "default"

#widget "*mybutton" style "back"
#widget "*mystyle" style "back"
"""

rc_parse_string (rcfile)
win = GtkWindow ()
win.connect ("destroy", mainquit)
#win.set_name ("mystyle")
win.set_usize (200, 200)

button = GtkButton ("test")
#button.set_name ("mytest")
win.add (button)

win.show_all ()
mainloop ()



> 
> 
> 
>  I have received silence by answer. It is that I have asked a
> triviality?
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> 
> 


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to