[Tkinter-discuss] Different aspect in windows and linux for the Button's highlight background

Rossana Airoldi Rossana.Airoldi at ciaolab.com
Thu May 13 07:53:17 EDT 2004


Hi all

The following script has different behaviour in Linux and Windows.
In Linux you can see the button’s highlight colors. In Windows when the
button has the focus you see a dashed 1 pixel line around the inner space of
the button.
Is there a way to override this Windows behaviour and to have the
interpreter to work in the same way as in Linux?

I would appreciate any suggestion, advice you can give me.
Have a good day

============================================================================
=================================

from Tkinter import *

class Button_test:
    def __init__(self,master):
        self.root=master

    def mainwindow(self,master,title):
        self.root.geometry("800x600")
        self.graphRegs = ()
        self.root.configure(bg="#000053")
        self.root.columnconfigure(0,minsize=19)
        self.root.columnconfigure(1,minsize=203)
        self.root.columnconfigure(2,minsize=17)
        self.root.columnconfigure(3,minsize=441)
        self.root.columnconfigure(4,minsize=7)
        self.root.columnconfigure(5,minsize=106)
        self.root.columnconfigure(6,minsize=7)
        self.root.rowconfigure(0,minsize=96)
        self.root.rowconfigure(1,minsize=47)
        self.root.rowconfigure(2,minsize=19)
        self.root.rowconfigure(3,minsize=80)
        self.root.rowconfigure(4,minsize=80)
        self.root.rowconfigure(5,minsize=80)
        self.root.rowconfigure(6,minsize=80)
        self.root.rowconfigure(7,minsize=80)


        frame1 = Frame(root,height=96,width=400,bg="#000053")
        self.titolo =
Label(frame1,text=title,font=("arial",25),fg="#FFFFFF",bg="#000053",anchor=W
).grid(row=0,column=0,columnspan=3,sticky=W,padx=20)
        frame1.grid(row=0,column=0,sticky=W,columnspan=6)
        frame2 = Frame(root,height=96,width=400,bg="#000053")
        frame2.grid(row=0,column=0,sticky=E,columnspan=6)

    def menusistema(self,master):
        frame4 = Frame(root,height=400,width=203,bg="#094AA6")
        w = Button(master, text="Button1", font=("arial",12), width=18,
fg="#000053", bg="#EFF4F8", bd = 6, takefocus=1, highlightthickness = 6,
highlightcolor = "#FFCC00", relief = 'ridge')
        w.grid(row=3, column = 1)
        w.focus_force()
        self.root.event_generate('<Tab>')
        w1 = Button(master, text="Button2", font=("arial",12), width=18,
bg="#EFF4F8", bd = 6, highlightthickness = 6,  activeforeground = "#FFCC00",
highlightcolor = "#FFCCFF", highlightbackground = "#FFCCFF", relief =
'ridge'              )
        w1.grid(row=4, column = 1)

root = Tk()
Gui = Button_test(root)

Gui.mainwindow(root,"Button Test")
Gui.menusistema(root)

root.mainloop()

============================================================================
=================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20040513/0c460d76/attachment-0001.html


More information about the Tkinter-discuss mailing list