Newbie question Tkinter bitmap

From: Wim Goffin (wim.goffin_at_telenet.be)
Date: 03/12/05


Date: Sat, 12 Mar 2005 14:35:00 GMT

Hi,

I'm trying to get a bitmap onto a button, but I can't.
Can anyone tell me where to look for a solution?

The call I use is this one:
self.b = Button(toolbar, text="nieuw", bitmap="@/test.xbm", width=20, command=self.print_msg)

The message I get is this:
Traceback (most recent call last):
  File "C:\Documents and Settings\Wim\Mijn documenten\Python\overhoor.py", line 143, in -toplevel-
    app = App(root)
  File "C:\Documents and Settings\Wim\Mijn documenten\Python\overhoor.py", line 71, in __init__
    self.b = Button(toolbar, text="nieuw", bitmap="@/test.xbm", width=20, command=self.print_msg)
  File "C:\Python24\lib\lib-tk\Tkinter.py", line 1939, in __init__
    Widget.__init__(self, master, 'button', cnf, kw)
  File "C:\Python24\lib\lib-tk\Tkinter.py", line 1868, in __init__
    self.tk.call(
TclError: error reading bitmap file "\test.xbm"

This is hapening on a WindowsXP system.
It seems as though the file is not found. Because if specify the name of a non-existing file, then I get exactly the same error. What could I do to make sure first that Puthon does find the file?

Thanks in advance,
Wim Goffin



Relevant Pages

  • Tkinter Bitmap Newbie question
    ... I'm trying to get a bitmap onto a button, ... error reading bitmap file "\test.xbm" ... What could I do to make sure first that Puthon does find the file? ... Wim Goffin ...
    (comp.lang.python)
  • Python Tkinter Newbie question
    ... I'm trying to get a bitmap onto a button, ... error reading bitmap file "\test.xbm" ... What could I do to make sure first that Puthon does find the file? ... Wim Goffin ...
    (comp.lang.python)
  • Re: Tkinter Bitmap Newbie question
    ... Is XBM also the best format for glyphs on the Windows platform? ... "Raseliarison nirinA" schreef in bericht ... > "Wim Goffin" wrote: ... I'm trying to get a bitmap onto a button, ...
    (comp.lang.python)
  • Re: Tkinter Bitmap Newbie question
    ... "Wim Goffin" wrote: ... you may write something like (one single string!): ... notice also that if the bitmap appears in your button, ...
    (comp.lang.python)