Python 2.7. Tkinker. Linux WindRiver. How to make

2019-08-19 04:02发布

Code:

import Tkinter as tk

#start GUI part
root = tk.Tk()
# show no frame
root.overrideredirect(True) 

#root.wm_attributes("-alpha", 0.2) 

#If uncommented the line above raises:
#    root.wm_attributes("-alpha", 0.2) 
#  File "/opt/python27-x86_64/usr/lib/python2.7/lib-tk/Tkinter.py", line 1553, in wm_attributes
#    return self.tk.call(args)
#_tkinter.TclError: wrong # args: should be "wm attributes window"
 
#__version__ = "$Revision: 81008 $"

root.geometry('%dx%d+%d+%d' % (300, 300, 300, 300)) 

root.after(5000, root.destroy) 
#start
root.mainloop()

According to the asnwers that I found so far this line: root.wm_attributes("-alpha", 0.2) should do the trick but instead I get error "_tkinter.TclError: wrong # args: should be "wm attributes window""

Any suggestions, pls?

0条回答
登录 后发表回答