Image Buttons And Rounded Buttons - Python Tkinter GUI Tutorial #66

  Рет қаралды 128,005

Codemy.com

4 жыл бұрын

In this video I'll show you how to use Images for your Buttons and how to make rounded buttons with tKinter!
I get asked all the time...how do you make rounded buttons in TKinter? The short answer is...you can't. At least not with a widget attribute. But you CAN use images as buttons pretty easily...and that's what we'll do in this video.

Пікірлер: 265
@garrybeck216
@garrybeck216 4 жыл бұрын
John, thanks for this series. very informative and easy to follow.
@Codemycom
@Codemycom 4 жыл бұрын
Very welcome!
@marckhycs319
@marckhycs319 3 жыл бұрын
This series helps me a lot on building my own projects. Thanks!!!
@Codemycom
@Codemycom 3 жыл бұрын
Great to hear!
@Codemycom
@Codemycom 4 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
@brandonhagopian7165
@brandonhagopian7165 3 жыл бұрын
Thank You so much for your effort John!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks for watching!
@nowybopes
@nowybopes 3 жыл бұрын
If you need to do this on a background with a different color: 1. set button bg to color of the background (ex. bg="ffffff") 2. set button bg when it's clicked to color of the background (ex. activebackground="ffffff")
@jdsguam
@jdsguam 3 жыл бұрын
Answered my next question right out of the gate! Thanks.
@katmanduYT
@katmanduYT 3 жыл бұрын
what if we use a background image
@nowybopes
@nowybopes 3 жыл бұрын
​@@katmanduYT I don't think you can do anything about it in Tkinter
@katmanduYT
@katmanduYT 3 жыл бұрын
@@nowybopes okay :) thanks for the help tho
@LucasSideris
@LucasSideris 2 жыл бұрын
@@katmanduYT you can "cut" the an entire square block containing the button and background where it touches like a common internet image stripes process, and put the button bg as close as you can get from background part. It could be seamless depending on resolution and images used. @ubant Thank you so much, man!
@MR.Science12
@MR.Science12 2 жыл бұрын
YOUR AWESOME I WATCH MANY KZbin VIDEOS ABOUT PYTHON BUT POSSIBLE TO UNDERSTAND TODAY I FOUND THIS CHANNEL REALLY HELPUFLLY I UNDERSTOOD EVERYTHING
@Codemycom
@Codemycom 2 жыл бұрын
Great to hear!
@khyatiparikh2929
@khyatiparikh2929 3 жыл бұрын
its exactly what i wanted.... thanks codemy
@Codemycom
@Codemycom 3 жыл бұрын
Glad you liked it!
@dimitriosdesmos4699
@dimitriosdesmos4699 4 жыл бұрын
thanks for that, i needed it.
@Codemycom
@Codemycom 4 жыл бұрын
Glad I could help
@stellaschmucker3059
@stellaschmucker3059 11 ай бұрын
Love your video!!❤
@Codemycom
@Codemycom 11 ай бұрын
Thanks!
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
best python teacher #1
@katrinastewart3765
@katrinastewart3765 3 жыл бұрын
thanks so much I'm completely new to all this and I already have buttons coded using classes for my separate windows and was wondering how to fit this code into it, as I want to use images as buttons ?
@akramelomrani8728
@akramelomrani8728 3 жыл бұрын
I am watching this series and I see that you started kivy When I finish tkinter I will Imediatly start kivy thank you for your tutorials I have watched most of them the flask series taught me how to push to heroku And I use it from then thank you sir
@Codemycom
@Codemycom 3 жыл бұрын
Have fun!
@m.t-thoughts8919
@m.t-thoughts8919 4 жыл бұрын
Could you pls make a deeper video about tkinter notebook tabs? I would love to add buttons to the name area of a tap but I don't know how to do that. I want a similar adding and closing method as the Atom Text Editor has for it's taps. I hope you getting what I mean. This was also a really helpfull video. 😊
@rubenmata73
@rubenmata73 3 жыл бұрын
Just GREAT!!!! THANKS!
@Codemycom
@Codemycom 3 жыл бұрын
Glad you liked it!
@anuragthakur5787
@anuragthakur5787 3 жыл бұрын
Thank you very much because of you I was able to make my first project :)
@Codemycom
@Codemycom 3 жыл бұрын
Happy to hear it!
@darkjunior2162
@darkjunior2162 3 жыл бұрын
Merci beaucoup pour cette vidéo 😄 Thank you very much for this video
@Codemycom
@Codemycom 3 жыл бұрын
You're very welcome!
@phudinhtruong
@phudinhtruong 3 жыл бұрын
another great video . tks u alot
@Codemycom
@Codemycom 3 жыл бұрын
Glad you liked it!
@maxblax9159
@maxblax9159 3 жыл бұрын
I just thank you for this
@Codemycom
@Codemycom 3 жыл бұрын
Glad you enjoyed it!
@sherzodabdumutalibov1384
@sherzodabdumutalibov1384 Жыл бұрын
thank you man! Спасибо брат, помог. Удачи тебе!
@shraddha10827
@shraddha10827 3 жыл бұрын
Good job!!!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!!
@EthioWonder
@EthioWonder 3 жыл бұрын
You are the one you make me programmerr
@RyanDanielG
@RyanDanielG 2 жыл бұрын
feed the algorithm! great vid
@codeKeshav
@codeKeshav 3 жыл бұрын
Using bind function in that image label can work as button too..
@__noel_abraham__
@__noel_abraham__ Жыл бұрын
Thank you, actually i am searching for this
@Codemycom
@Codemycom Жыл бұрын
happy to hear it
@hello-my6ot
@hello-my6ot 3 жыл бұрын
Thank you!
@Codemycom
@Codemycom 3 жыл бұрын
You're welcome!
@ryce_jnes
@ryce_jnes 4 жыл бұрын
you the best in python
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@asmerbay8200
@asmerbay8200 4 жыл бұрын
Thanks for this wonderful courses John.Could you make more videos about classes in Tkinter?
@Codemycom
@Codemycom 4 жыл бұрын
Sure
@deepikasinghj5486
@deepikasinghj5486 2 жыл бұрын
Tq It was a great help
@Codemycom
@Codemycom 2 жыл бұрын
Glad to hear it!
@mujassimjamal24
@mujassimjamal24 4 жыл бұрын
Thank you so much sir 😊❤❤❤
@Codemycom
@Codemycom 4 жыл бұрын
You're very welcome!
@LearnwithAnsh
@LearnwithAnsh 2 жыл бұрын
8:28 I smashed the like button but my computer screen broke lol 😂
@Codemycom
@Codemycom 2 жыл бұрын
ha!
@hello-my6ot
@hello-my6ot 3 жыл бұрын
Hello john I did the same thing and it worked but it doesnt show my image as transparent but it was a transparent image. Do you know how to solve this?
@katrinastewart3765
@katrinastewart3765 3 жыл бұрын
very informative I'm new to coding all together. just one thing I struggled with here was adjusting the button sizes ? thank you!
@Codemycom
@Codemycom 3 жыл бұрын
Glad it helped!
@xtiankimochii7479
@xtiankimochii7479 3 жыл бұрын
It relly helps me . Thank u so much btw i why it is not working it say that image"pyimage8" doesn't exist but i all ready do it
@yashmehta4799
@yashmehta4799 4 жыл бұрын
Thanks a ton for this video. Sir, could you make a video on gtts module and how can we use it in our tkinter code??
@Codemycom
@Codemycom 4 жыл бұрын
I don't know gtts, but it would be interesting
@arunvijay6493
@arunvijay6493 2 жыл бұрын
big fan bro..
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@elysonpanolino7522
@elysonpanolino7522 Жыл бұрын
Is there any way so that I can't click on the removed background?
@alepuglisi5780
@alepuglisi5780 4 жыл бұрын
John, I love this series! I've a problem with the button images, I use your image and even if my code is correct and I set the borderwidth at 0 I still continue to see the borders of button and it doesn't move... It can be because I'm using macOS?
@shaktisinhjhala5758
@shaktisinhjhala5758 3 жыл бұрын
hey, try to add.. highlightthickness=0 along with borderwidth=0 ..it will solve your problem.
@hillybankok
@hillybankok 2 жыл бұрын
@GoldenD60 true
@alexindustries1672
@alexindustries1672 3 жыл бұрын
borderwidth doesn't work on mac can someone tell me how to fix that and also is there a way to display text on top of button image?
@david0411
@david0411 Жыл бұрын
Did you find any solution to this?
@dimitriosdesmos4699
@dimitriosdesmos4699 4 жыл бұрын
there are some libraries that allow you to design the tkinter layout in a manner similar to the qt5 toolkit.....like a design interface with drag and drop buttons..etc etc..any chance you can review those in the future?
@Codemycom
@Codemycom 4 жыл бұрын
could be
@quinnfly1708
@quinnfly1708 2 ай бұрын
how would i get rid of the white space around the button tho? i wanted to use a circle png with a background but the white part of the buttons still shows in the background, how do i make it so that it is strictly the png file?
@BarsamJahanvash
@BarsamJahanvash 2 жыл бұрын
Perfect
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@thitismit
@thitismit 2 жыл бұрын
And if I want to get string from API and put it on rounded button with image, What must I do?
@JalalDictaJet
@JalalDictaJet 9 ай бұрын
good work
@Codemycom
@Codemycom 9 ай бұрын
Thanks!
@maxwellhawk
@maxwellhawk Жыл бұрын
i would like to see the one with themes ^^
@psirohi7199
@psirohi7199 4 жыл бұрын
Hi! Thanks for video, but I have an query. Can we use 3d graphics with tkinter?
@Codemycom
@Codemycom 4 жыл бұрын
Not sure what you mean by 3d
@digitalmachine0101
@digitalmachine0101 6 ай бұрын
Good information
@Codemycom
@Codemycom 6 ай бұрын
Thanks
@ebaadkhan8501
@ebaadkhan8501 3 жыл бұрын
may god bless you may you be in peace,sir you are damn amazing lovee you alotttt!!!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@2527donni
@2527donni 4 жыл бұрын
Is there a way to save the last used state of buttons clicked , slider positions etc to a file in tkinter? I can't find a way to make a backup of buttons pressed , sliders set , and then load it back into tkinter , some feature akin to the preferences/last used settings in software is what I'm looking for. Does Tk provides for this? . Awesome content you got John , I've smashed the like button :)
@Codemycom
@Codemycom 4 жыл бұрын
Just assign whatever you want into a variable...then you can access it any way you want, whenever you want. Unless you mean like after the program has closed? Then you could save those things to a file in the normal python way...
@MathematicalReasoning
@MathematicalReasoning 5 ай бұрын
i had to capitalize Label and it worked
@Codemycom
@Codemycom 5 ай бұрын
Well yeah, Label is capitalized in the video. Code is always exact.
@kaaaaasraa49563
@kaaaaasraa49563 4 жыл бұрын
Greetings John, Please make a video about concatenating image and text in labels
@Codemycom
@Codemycom 4 жыл бұрын
Good idea...all you have to do is use the compound attribute. compound=CENTER puts the text in the center, compound=LEFT puts it left, etc. Everything else stays the same. You can also compound top or bottom, center, left, right.
@kaaaaasraa49563
@kaaaaasraa49563 4 жыл бұрын
@@Codemycom Thanks 🙏
@abhasoli2655
@abhasoli2655 4 жыл бұрын
Can you make a video on the ttk module widgets?
@Codemycom
@Codemycom 4 жыл бұрын
I have several in the playlist already
@johnemanuelalamares2206
@johnemanuelalamares2206 3 жыл бұрын
How to make it rounded when I have an image as my background? because the background of the button is still there
@ShekhMukhtarMansuri
@ShekhMukhtarMansuri 3 жыл бұрын
edit background image in rounded shop in photoshop itself.. then import in python...
@user-om1ud5hn3w
@user-om1ud5hn3w 9 ай бұрын
nice video
@Codemycom
@Codemycom 9 ай бұрын
Thanks!
@sepehr2371
@sepehr2371 3 жыл бұрын
Great video, my problem with this is that if I was to click on somewhere a little outside of the login button, would it still get activated as the image itself is a square so the "hitbox" would be larger than the rounded button alone?
@Codemycom
@Codemycom 3 жыл бұрын
depends on the image you use
@sepehr2371
@sepehr2371 3 жыл бұрын
@@Codemycom yeah also I figured that buttons for some reason dont allow transparency if you change the background colour to not white you will notice. I tried using root.wm_attributes("-transparentcolor", "somecolor") to sort of green screen the background of it but it resulted in a weird box that is see-through in the window.
@Wuottfac
@Wuottfac 3 жыл бұрын
Hello, Is possible in tkinter when a button clicked print a text in textarea and also clear it with another button?? Pls help me
@Codemycom
@Codemycom 3 жыл бұрын
Sure, just keep watching videos in the playlist to learn this basic functionality.
@mr_dodex
@mr_dodex Жыл бұрын
Good.
@Codemycom
@Codemycom Жыл бұрын
Thanks
@user-cv6ze5cr1h
@user-cv6ze5cr1h 3 жыл бұрын
hello! what can I do if I can't see the image on the screen? it looks like a grey square... Thank you for your useful videos!
@Codemycom
@Codemycom 3 жыл бұрын
What did you do differently than the video?
@Shaffi003
@Shaffi003 4 жыл бұрын
Hi.. I'm a noob in python.. I am creating an app that process a csv file into some sort of configurations. I have a template csv file and i want to host in tkinter with button.. A csv file will get download once button clicked.. I looking for an idea.. Kindly help..
@Codemycom
@Codemycom 4 жыл бұрын
Sorry, I'm not going to write your app for you.
@joeldsouza2690
@joeldsouza2690 4 жыл бұрын
Is there any attribute by which I could change the dimension of the image
@Codemycom
@Codemycom 4 жыл бұрын
No, you need to actually resize the image with pil...I have a video on it.
@liamgaeuman4990
@liamgaeuman4990 3 жыл бұрын
Hey John, I'm trying to make a card game in tkinter but I can't figure out how to select an image drag it and place it and then select a different image and do the same thing. I've decided to try turning my images into buttons and defining the selected image for dragging that way. Can you make a video on how to drag and drop multiple separate items? In your drag and drop video the image will just snap back to wherever you click on the screen which isn't what you want if you are going to select another item to drag.
@kylebrooks8162
@kylebrooks8162 3 жыл бұрын
I'd probably use pygame for that not tkinter.
@liamgaeuman4990
@liamgaeuman4990 3 жыл бұрын
@@kylebrooks8162 I tried that too lol. It’s quite the process as well.
@noname99832
@noname99832 3 жыл бұрын
ttk Buttons are bit round from tkinter import * from tkinter import ttk root = Tk() Btn = ttk.Button(root, text="This looks a bit modern and its rounded") Btn.pack() root.mainloop() Note - You cannot change fg and bg of ttk.Button it have it's own style
@debakamalhazarika7097
@debakamalhazarika7097 2 жыл бұрын
Sir, how to round the corners of the canvas ? Your videos are really very good and sir please keep making it
@afnanardi27
@afnanardi27 4 жыл бұрын
what is the dimension of a button to use that in tkinter? like what would be the dimension if i want to make that in potoshop
@Codemycom
@Codemycom 4 жыл бұрын
A button is the size of the text you put on it...so there is no one size...
@ZAYN_ONE_DIRECTION
@ZAYN_ONE_DIRECTION 2 жыл бұрын
does this work on a canvas?
@RafaelMartinez-si2hm
@RafaelMartinez-si2hm 2 жыл бұрын
On Linux when I hover over my button it gets highlighted with a white color. Is there a way to change this?
@Codemycom
@Codemycom 2 жыл бұрын
No idea
@sameehazahid466
@sameehazahid466 Жыл бұрын
whenever I try to use an image it say 'no such file or directory'. I have saved all the files I'm using to the same place which is the desktop. It works when opening programs but not images. Any way to fix this?
@Codemycom
@Codemycom Жыл бұрын
You're getting that error because you aren't using the correct path to open the images.
@johnpro2847
@johnpro2847 3 жыл бұрын
1:15 John's lawyer makes him say this disclaimer...
@amirmohammadk745
@amirmohammadk745 2 жыл бұрын
wait why you dont use cntrl + b in sublime
@isaacphiri8301
@isaacphiri8301 3 жыл бұрын
An trying but am failing its saying that no such file or directory so what should I do
@Codemycom
@Codemycom 3 жыл бұрын
three's a typo likely in your code.
@JustAnotherCoder
@JustAnotherCoder 3 жыл бұрын
This is great thanks! The only problem is that it gives me this error "self.tk.call(('image', 'create', imgtype, name,) + options) _tkinter.TclError: couldn't recognize data in image file "images/inbox.png" when I try to run it using the code you showed us.
@Codemycom
@Codemycom 3 жыл бұрын
is the file you're using an actual png file?
@JustAnotherCoder
@JustAnotherCoder 3 жыл бұрын
@@Codemycom oh nevermind yeah that was the problem, I converted it to png and now when I run my program I just see 2 lines in the middle and no errors
@matesss16
@matesss16 11 ай бұрын
I want to make button from transparent image and after that write some text on it (so the button looks like text). Is it some way how to do it?
@Codemycom
@Codemycom 11 ай бұрын
Use photoshop
@matesss16
@matesss16 11 ай бұрын
@@Codemycom Thanks for response, but I have cca 40 buttons, so isn't there easier way 😅
@shaktisinhjhala5758
@shaktisinhjhala5758 3 жыл бұрын
If one is using Tkinter with python-OOPs than only "self.login_btn = PhotoImage(...)" will be sufficient. no need to store the image's reference in "Label" as a variable with 'self' will be considered as an instance variable, which will prevent garbage collector to destroy reference object.
@Codemycom
@Codemycom 3 жыл бұрын
Yeah but we aren't using classes here
@shaktisinhjhala5758
@shaktisinhjhala5758 3 жыл бұрын
@@Codemycom yup👍 jst shared a thought 😄. Anyways great tutorials 🔥😊
@Codemycom
@Codemycom 3 жыл бұрын
@@shaktisinhjhala5758 :-)
@soham7226
@soham7226 3 жыл бұрын
can I change the image of the button when hovering the mouse cursor?
@Codemycom
@Codemycom 3 жыл бұрын
Sure
@soham7226
@soham7226 3 жыл бұрын
@@Codemycom how??
@Codemycom
@Codemycom 3 жыл бұрын
@@soham7226 I have a video on that in the playlist
@oussamathedjfreeman
@oussamathedjfreeman 2 жыл бұрын
need corse about gui with animation buttons and video on it :)
@Codemycom
@Codemycom 2 жыл бұрын
check the playlist
@kingvg9567
@kingvg9567 Жыл бұрын
i tried it and saved the picutre i wanted to use in the same folder. When i try to run the code it says "pyimage1" doesn't exist. pls help!
@Codemycom
@Codemycom Жыл бұрын
what did you do differently from the video?
@proxnoob2
@proxnoob2 Жыл бұрын
thank you everything worked for me except borderwidth, when I am giving borderwidth it is showing this error _tkinter.tclerror: unknown option "-borderwidth", do you know how to solve it
@Codemycom
@Codemycom Жыл бұрын
use bd=
@Zhisaoka
@Zhisaoka 3 жыл бұрын
thank you so much, but for me when I change the borderwidth it wont work
@Codemycom
@Codemycom 3 жыл бұрын
You're welcome!
@gbg6750
@gbg6750 4 жыл бұрын
The problem is when we have a backgound image on label, then we still have the square chape at the button, is there some how to fix it?
@Codemycom
@Codemycom 4 жыл бұрын
yes...don't I show you how to set the borderwidth=0 on the button? If not in this video, I know I do somewhere on the playlist..
@Stocktan1
@Stocktan1 3 жыл бұрын
@@Codemycom using borderwidth=0 doesn't fix it when you are using a different background :c help
@Codemycom
@Codemycom 3 жыл бұрын
@@Stocktan1 It should
@martindubois9279
@martindubois9279 3 жыл бұрын
weird my code work on windows but not on my pi. i still see the border button on my pi
@Codemycom
@Codemycom 3 жыл бұрын
yeah, pi's are different than windows
@nayanendusanthosh2053
@nayanendusanthosh2053 4 жыл бұрын
Can we add multiple buttons ?Please reply..As in after we click one button the next input button appears..
@Codemycom
@Codemycom 4 жыл бұрын
Why not?
@sepehr2371
@sepehr2371 3 жыл бұрын
yeah you can just somewhere in the button command function pack the next button and it should show up.
@leothomas1113
@leothomas1113 2 жыл бұрын
select_img = PhotoImage(file="/select2.png") select=Label(image=select_img) b = Button(frame, image=select_img, width=100, height=20, borderwidth=0, relief='raised', cursor='hand2', command=lambda roomno=r: book(roomno)) b.pack(anchor=E) this doesn't show any image on the button, nor does the button work. how to solve this ?
@Codemycom
@Codemycom 2 жыл бұрын
Your code is all wrong. Rewatch the videos.
@castropaulo5467
@castropaulo5467 2 жыл бұрын
hi i am beginner, it is related to your video the images buttons can't show after run the code can you help me? i already located the images in folder but still can't show you can solve?
@JohnElder
@JohnElder 2 жыл бұрын
You'll have to rewatch the video and figure out what you did differently
@castropaulo5467
@castropaulo5467 2 жыл бұрын
@@JohnElder the images can't show can you help me? i followed your instruction
@Codemycom
@Codemycom 2 жыл бұрын
@@castropaulo5467 You'll have to rewatch the video and figure out what you did differently, you did not follow the instructions
@nurizzahwanibintimartangbs2857
@nurizzahwanibintimartangbs2857 Жыл бұрын
i want to use ttk.Button insteac the usual Button, but it said _tkinter.TclError: unknown option "-borderwidth"
@Codemycom
@Codemycom Жыл бұрын
yeah, ttk button doesn't have that attribute
@huntermccauley4583
@huntermccauley4583 4 жыл бұрын
My buttons will not display any image, only blank grey squares. Could it be because I'm using macOS? I've noticed it can be very restrictive with tkinter.
@Codemycom
@Codemycom 4 жыл бұрын
Could be, but shouldn't... check your image paths...
@huntermccauley4583
@huntermccauley4583 4 жыл бұрын
@@Codemycom Image paths are correct. Interestingly, if I simply add the line create_image(image = 'my image') after I pack my button, then the image appears on the button as it should. But I don't believe this is the correct usage.
@huntermccauley4583
@huntermccauley4583 4 жыл бұрын
I forgot to add, any code after create_image(image = 'my image') will not show in the GUI, obviously not the correct usage lol.
@Codemycom
@Codemycom 4 жыл бұрын
@@huntermccauley4583 Anything that works is the correct usage lol
@datneanimation2336
@datneanimation2336 3 жыл бұрын
Can I put Image on Button when button is lying on Frame ? I can't do it. Help me. pls. Thanks
@Codemycom
@Codemycom 3 жыл бұрын
Yes, in the exact same way
@datneanimation2336
@datneanimation2336 3 жыл бұрын
​@@Codemycom Thanks. Can i add my images on Treeview ? I searched your youtube channel but I couldn't see it :((
@shivanshukamboj7940
@shivanshukamboj7940 3 жыл бұрын
It doesn't work when image is in background .....a square button shape appears on the back
@nanduola
@nanduola 2 жыл бұрын
bad geometry specifier "350*500" , why and solution ??
@Codemycom
@Codemycom 2 жыл бұрын
use x not *
@jazaaraian
@jazaaraian 3 жыл бұрын
Hello! I used this guide to add this to my code but somehow get an error "image "py2image" doesn't exist". How to fix this one? Any guides?
@Codemycom
@Codemycom 3 жыл бұрын
Is the image sitting on your computer in the directory that you're pointing to?
@jazaaraian
@jazaaraian 3 жыл бұрын
@@Codemycom Yes, I also double checks it
@jazaaraian
@jazaaraian 3 жыл бұрын
Is it possible to use it in one of the two tk window ? Or 1 has to be in Toplevel() ? It works when I do it on a new .py file.
@Codemycom
@Codemycom 3 жыл бұрын
@@jazaaraian Yes, you have have to make your image variable global to use it in a second window
@jazaaraian
@jazaaraian 3 жыл бұрын
@@Codemycom Thank you ! I will try this one. I apologize if I ask for help here even though it's not should be.
@athiradivakaran2036
@athiradivakaran2036 4 жыл бұрын
Tried the same..i have a background image...so even borderwidth is zero it looks like a rectangle button
@Codemycom
@Codemycom 4 жыл бұрын
Then you're doing something wrong...check your code for typos
@screensauce
@screensauce 3 жыл бұрын
Pls do a vid on how to make a neon text In tkinter
@Codemycom
@Codemycom 3 жыл бұрын
You'd have to use an image
@sevilnatas
@sevilnatas 3 жыл бұрын
For the life of me, I can't get the image to show up in even the simplest stage of your tutorial. The stage where you put the image in the label. Program runs but the window comes up with a blank window. Tkinter is kicking my ass for what seems basic, stupi reasons. I spent 2 days trying to get PIL and Pillow to work which is what lead me hear. All I want is an image button and even copying your code character by character (except for the image paths) I can't get anything to show up. I read somewhere that PhotoImage doesn't support PNGs and JPGs, but yours works fine. Also, mine won't allow me to use 'pady=20' in the pack method. There is something different between my tkinter and yours. I am on WIN 10 (64bit) in VS Code. Could that be the reason?
@sevilnatas
@sevilnatas 3 жыл бұрын
Wait, why is my 'pack' method making me capitalize 'Pack' but yours isn't? What version Python is your tutorial in?
@Codemycom
@Codemycom 3 жыл бұрын
@@sevilnatas it's because VS code sucks. I use sublime text (free) and git bash terminal (free) git-scm.com and vs code doesn't "make" you capitalize it, it autocorrects. You can change it.
@sevilnatas
@sevilnatas 3 жыл бұрын
@@Codemycom Thanks for the feedback. I will try sublime and git bash terminal then. Any thoughts on the other parts of my comment. It seems bizarre that I can't even get the simplest example to run. I know debugging someones code is hard enough let alone when they ask you to do it without being able to see it but just wondering if you had any ideas off the top of your head where I shoul dgo to next? Thanks again....
@Codemycom
@Codemycom 3 жыл бұрын
@@sevilnatas I couldn’t say...but using the other tools may clear up your other problems.
@sevilnatas
@sevilnatas 3 жыл бұрын
@@Codemycom Oki doke, I'll try it, thanks...
@datimo5029
@datimo5029 2 жыл бұрын
So Insert image and your button is "rounded" but how to actually round the button (without inserting image)
@Codemycom
@Codemycom 2 жыл бұрын
You don't
@seshrisanjanaa153
@seshrisanjanaa153 3 жыл бұрын
how to place back button?
@Codemycom
@Codemycom 3 жыл бұрын
Huh? In the normal way you put any button in a tkinter app
@black-ym5di
@black-ym5di 3 жыл бұрын
hey john can tkinter be able to create UI like Jarvis?
@Codemycom
@Codemycom 3 жыл бұрын
Sorry, I'm not familiar with Jarvis
@rocketleagueshorts1961
@rocketleagueshorts1961 3 жыл бұрын
amazing video sir, but can you please tell how to get an image of that size ?
@Codemycom
@Codemycom 3 жыл бұрын
Sorry, I don't know what you mean.
@rocketleagueshorts1961
@rocketleagueshorts1961 3 жыл бұрын
@@Codemycom i watched your video on how to do a calculator. in that calculator app instead of having normal buttons i planned to have images of 1,2,3.. as button but i didnt get images for 1,2.. with a size which is equal to actual tkinter button size. so do you know any website where i can download an image where the size of images is small that we can use it for our projects ?
@Codemycom
@Codemycom 3 жыл бұрын
@@rocketleagueshorts1961 I mean, google it there are millions of image websites. Or just resize the images yourself using photo editing software. gimp is free or there are tons of free image editing website. Google image editing
@rocketleagueshorts1961
@rocketleagueshorts1961 3 жыл бұрын
@@Codemycom thx a lot
@Vincent2103
@Vincent2103 Ай бұрын
it works but my button says pyimage1, and its a jpg file so I did import PIL as well i forgot to change the 'text=' to 'image=' haha
@Codemycom
@Codemycom Ай бұрын
ha whoops!
@j6mes
@j6mes 3 жыл бұрын
You: put the image into the button Me: put the button into the image :|
@Codemycom
@Codemycom 3 жыл бұрын
But you're literally putting the image in the button...you aren't putting the button into the image.
@furkank5614
@furkank5614 3 жыл бұрын
All i have is white screen after 6:07. why is that ?
@Codemycom
@Codemycom 3 жыл бұрын
You have a typo in your code somewhere
@rubensahas9280
@rubensahas9280 4 жыл бұрын
Hi John, i have problem while inserting a image , while i load the image and set the background of root window to black , the background of the image is still default Is there anyway to make the background transparency? Even the same problem with label. Is ther anyway we can add image for scroll widget? this is how it looks. drive.google.com/file/d/1gDtwf6HlDlU2TFy8MRkyJehQOOmIIKmd/view?usp=sharing Thank you for your videos it really helping me alot. :)
@sepehr2371
@sepehr2371 3 жыл бұрын
I actually figured a way around this yesterday, it is probably going to break your mind since you have to redo some stuff but you have to use the canvas widget to allow for transparency as the root window doesnt support it on its own.
@oz9985
@oz9985 Жыл бұрын
for me it only shows a blank label
@Codemycom
@Codemycom Жыл бұрын
Then you did it wrong. Check your code vs the video and see where your mistake is.
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Little girl's dream of a giant teddy bear is about to come true #shorts
00:32
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН