Background of button


I have this code:

Button = DirectButton(
                                          text=" ",

but it always throws this error:

    raise IOError, message
IOError: Could not load model file(s): [u'.\\pics\\drachenklinge.png']

Whats wrong with it?
Isnt geom the argument to set the background picture of the button?

Use image instead of geom, if you are loading an image file like a png file. geom is for egg or bam files.

But you should also use forward slashes, following Panda’s filename convention, not backward slashes, as described in the manual.


Oh, thank you. Now I can set a picture as backgound. But how can I delete this gray?

Im trying to write my own button class, but whats wrong with this code? It doesnt work:

class DirectB(DirectButton):
    def __init__(self, parent=None, **kw):
        DirectButton.__init__(self, parent, **kw)


Set relief = None to remove the default gray background. When inheriting from DirectGui objects, you must call initialiseoptions in your own constructor. Search the forums for initialiseoptions.