From juan0christian at gmail.com Mon Oct 27 21:10:20 2014 From: juan0christian at gmail.com (Juan Christian) Date: Mon, 27 Oct 2014 18:10:20 -0200 Subject: [Tkinter-discuss] Change menubar color? Message-ID: I have this simple code: from tkinter import * root = Tk() root.title("Steam Trader") root.minsize(500, 800) root.maxsize(500, 0) menubar = Menu(root) filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="Open", command=None) filemenu.add_command(label="Save", command=None) menubar.add_cascade(label="File", menu=filemenu) root.config(bg='#2A2C2B', menu=menubar) root.mainloop() And I want to change the menu color, is it possible? [image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 12703 bytes Desc: not available URL: From alejandroautalan at gmail.com Mon Oct 27 21:35:16 2014 From: alejandroautalan at gmail.com (Alejandro Autalan) Date: Mon, 27 Oct 2014 17:35:16 -0300 Subject: [Tkinter-discuss] Change menubar color? In-Reply-To: References: Message-ID: 2014-10-27 17:10 GMT-03:00 Juan Christian : > I have this simple code: > > from tkinter import * > > root = Tk() > root.title("Steam Trader") > root.minsize(500, 800) > root.maxsize(500, 0) > > menubar = Menu(root) > filemenu = Menu(menubar, tearoff=0) > filemenu.add_command(label="Open", command=None) > filemenu.add_command(label="Save", command=None) > menubar.add_cascade(label="File", menu=filemenu) > > root.config(bg='#2A2C2B', menu=menubar) > root.mainloop() > > > And I want to change the menu color, is it possible? > > [image: Inline image 1] > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > > Hello, yes it is posible: from tkinter import * root = Tk() root.title("Steam Trader") root.minsize(500, 800) root.maxsize(500, 0) menubar = Menu(root, background='#000099', foreground='white', activebackground='#004c99', activeforeground='white') filemenu = Menu(menubar, tearoff=0, background='#000099', foreground='white', activebackground='#004c99', activeforeground='white') filemenu.add_command(label="Open", command=None) filemenu.add_command(label="Save", command=None) menubar.add_cascade(label="File", menu=filemenu) root.config(bg='#2A2C2B', menu=menubar) root.mainloop() Regards. Alejandro A. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 12703 bytes Desc: not available URL: From juan0christian at gmail.com Mon Oct 27 21:42:59 2014 From: juan0christian at gmail.com (Juan Christian) Date: Mon, 27 Oct 2014 18:42:59 -0200 Subject: [Tkinter-discuss] Change menubar color? In-Reply-To: References: Message-ID: from tkinter import * root = Tk() root.title("Steam Trader") root.minsize(600, 800) root.maxsize(600, 0) menubar = Menu(root, background='#374140', foreground='black', activebackground='#374140', activeforeground='black') filemenu = Menu(menubar, tearoff=0, background='#374140', foreground='#D9CB9E', activebackground='#D9CB9E', activeforeground='#374140') filemenu.add_command(label="Open", command=None) filemenu.add_command(label="Save", command=None) menubar.add_cascade(label="File", menu=filemenu) root.config(bg='#2A2C2B', menu=menubar) root.mainloop() --- Ok, it's somewhat working, but the menu isn't colored yet, just the 'filemenu'. [image: Inline image 1] On Mon, Oct 27, 2014 at 6:35 PM, Alejandro Autalan < alejandroautalan at gmail.com> wrote: > 2014-10-27 17:10 GMT-03:00 Juan Christian : > >> I have this simple code: >> >> from tkinter import * >> >> root = Tk() >> root.title("Steam Trader") >> root.minsize(500, 800) >> root.maxsize(500, 0) >> >> menubar = Menu(root) >> filemenu = Menu(menubar, tearoff=0) >> filemenu.add_command(label="Open", command=None) >> filemenu.add_command(label="Save", command=None) >> menubar.add_cascade(label="File", menu=filemenu) >> >> root.config(bg='#2A2C2B', menu=menubar) >> root.mainloop() >> >> >> And I want to change the menu color, is it possible? >> >> [image: Inline image 1] >> >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tkinter-discuss >> >> > Hello, yes it is posible: > > from tkinter import * > > root = Tk() > root.title("Steam Trader") > root.minsize(500, 800) > root.maxsize(500, 0) > > menubar = Menu(root, background='#000099', foreground='white', > activebackground='#004c99', activeforeground='white') > filemenu = Menu(menubar, tearoff=0, background='#000099', > foreground='white', > activebackground='#004c99', activeforeground='white') > filemenu.add_command(label="Open", command=None) > filemenu.add_command(label="Save", command=None) > menubar.add_cascade(label="File", menu=filemenu) > > root.config(bg='#2A2C2B', menu=menubar) > root.mainloop() > > > Regards. > Alejandro A. > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 92599 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 12703 bytes Desc: not available URL: From rajatdas2005 at gmail.com Wed Oct 29 08:38:04 2014 From: rajatdas2005 at gmail.com (rajat das) Date: Wed, 29 Oct 2014 13:08:04 +0530 Subject: [Tkinter-discuss] update image on pressing button Message-ID: Dear All, I am new in python programming, kindly help me out. *Problem: *Basically as user press the "Next image button" the image should get refreshed by the next image from the specified path and so on. The problem is on pressing the button the image is coming below of the previous image not on top of it. Basically I want the images should slide on pressing the next button. I am sharing my code for understanding. You need few "bmp" files and set the path according to which path need to set in the program. ==================================================== from Tkinter import * from PIL import Image, ImageTk root = Tk() def Click(): image = Image.open("C:/Users/Slide2.bmp") photo = ImageTk.PhotoImage(image) label = Label(root,image=photo) label.image = photo # keep a reference! label.pack() image = Image.open("C:/Users/Slide1.bmp") photo = ImageTk.PhotoImage(image) label = Label(root,image=photo) label.image = photo # keep a reference! label.pack() labelframe = LabelFrame(root) labelframe.pack(fill="both", expand="yes") left = Label(labelframe) button=Button(labelframe, padx = 5, pady = 5, text="Next",command = Click) button.pack(side = RIGHT) R1 = Radiobutton(labelframe, text="Choice 1", value=1) R1.pack(side = LEFT) R2 = Radiobutton(labelframe, text="Choice 2", value=2) R2.pack(side = LEFT) left.pack() root.mainloop() ============================================ -- Thanks Rajat Das -------------- next part -------------- An HTML attachment was scrubbed... URL: From klappnase at web.de Wed Oct 29 20:20:45 2014 From: klappnase at web.de (Michael Lange) Date: Wed, 29 Oct 2014 20:20:45 +0100 Subject: [Tkinter-discuss] update image on pressing button In-Reply-To: References: Message-ID: <20141029202045.d1e6c811ea8f27fa60d0430d@web.de> Hi, On Wed, 29 Oct 2014 13:08:04 +0530 rajat das wrote: > Dear All, > > I am new in python programming, kindly help me out. > > *Problem: *Basically as user press the "Next image button" the image > should get refreshed by the next image from the specified path and so > on. The problem is on pressing the button the image is coming below of > the previous image not on top of it. Basically I want the images should > slide on pressing the next button. (...) > def Click(): > > image = Image.open("C:/Users/Slide2.bmp") > photo = ImageTk.PhotoImage(image) > > label = Label(root,image=photo) > label.image = photo # keep a reference! > label.pack() the problem with your code is that instead of changing the image data of the existing label widget you create a new Label. In your Click() function you should simply do label.configure(image=photo) instead of creating a new label. I hope this helps Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Humans do claim a great deal for that particular emotion (love). -- Spock, "The Lights of Zetar", stardate 5725.6