0

I need some help with GUI programming (python tkinter)

Comments
  • 1
    Welcome to devRant! Just to start with, you should write out your problem and/or question in your post itself. That way people also know if they can be of help or not.

    I have used tkinter a little bit to make a couple of very basic practice programs so I won't promise anything, but I could try to help. What do you need help with?
  • 0
    I have nothing against tkinter but sometimes it isn't enough and upgrading to pyQt is an option.

    Welcome btw, it can sound like a dumb advice and its for most of the time the default one but reading the docs help you understand what you are doing most of the time: https://docs.python.org/3.7/...
  • 0
    @Navigatr thank you, I’m just trying the app, soon I will ask you questions
  • 0
    @Navigatr which one is the best for packing widgets

    Pack
    Grid
    Place
  • 0
    @programmer420 I think I recall seeing somewhere that it's not recommended to use .place(), but the other two are perfectly fine. As to which one to use really depends on what might fit best for that specific instance and/or personal preference.

    E.g. in the main window, I might have a Frame, some buttons and some other things. To align them properly I use the .grid() function. Inside that frame I might have only two widgets or so, that are evenly taking up half the space each. In that case I'd use the .pack() function for those.

    Remember that all widgets that share the same parent/master need to use the same function. Like in the above example, the Frame shares parent with the buttons and stuff (parent being the main window), but the elements inside the Frame both have that Frame as their parent instead of the main window, thus you could use the .pack() method for those instead of .grid()
  • 0
    @Navigatr @Navigatr but why when I use grid, it doesn't go as planned to go
  • 0
  • 0
    @programmer420 That one can be a bit tricky to explain in just words, but maybe this video can be helpful: https://youtu.be/qJtf0J0Vrkg

    It also sounds like that guy's made videos on some of the other widgets and stuff in tkinter, so it might be a good idea to check those out too.

    If you haven't done so already I also highly recommend checking out these websites as they are pretty good references: 1) http://effbot.org/tkinterbook/ 2) http://infohost.nmt.edu/tcc/help/...

    Also, sometimes I find it a bit easier to draw a design on paper first so I can see which widgets will align and where. (Also keep in mind that the .grid() method takes two arguments called "rowspan" and "columnspan", so check that out too.)
  • 0
    @Navigatr it hasn't work ☹️☹️
  • 0
    @Navigatr where I wrote a columnspan=2 and it appears under the label 1
  • 0
    @programmer420 You still need to include the row and column properties, example: ".grid(row=0, column=1, rowspan=2, columnspan=4)"

    Of course you'd insert your own values for those properties instead of the ones I wrote.
  • 0
    @Navigatr thx, I will try it when I go home
  • 0
    And btw do you have hangouts?, cuz here I feel uncomfortable when I talk to you in this app
  • 0
    @programmer420 No, I don't, but I'm on discord. You could probably find me through the devRant discord server, same username as here.
  • 0
    @Navigatr @Navigatr so can you teach me how to chat with you in private, bc this app is pissing me off
  • 0
    @programmer420 Well, do you have discord? Once you have it you can join devRant's server through this link here: https://discord.gg/3tjZFe8
  • 0
    @Navigatr I want your account
  • 0
    @programmer420 Like I said, I'm on that discord server with the same username as here, so you can find me there.
  • 1
    Buy "python in a nutshell" and read it. It will solve your problems.
Add Comment