Is there a GUI design app for the Tkinter / grid geometry? [closed]

Does anyone know of a GUI design app that lets you choose/drag/drop the widgets, and then turn that layout into Python code with the appropriate Tkinter calls & arrangement using the grid geometry manager? So far I've turned up a couple of pretty nice options that I may end up using, but they generate code using either pack or place instead.

=========

EDIT: Please note this is not to seek a "recommendation" per se, but rather it is a factual inquiry. I was asking whether or not such an app exists.

=====

Before you say it: Yes, I know Tkinter is easy to learn, and Yes, I've found multiple online sources to help me do so, and I'm already on my way with that. This isn't about avoiding the effort of learning, it's about using the right tool for the job. I found out a long time ago that those drag-and-drop widget environments for coding program logic, are just too klunky and unmanageable when the project gets beyond a certain size -- for bigger stuff, it's just easier to build and maintain the logic when it's in plain text. More recently I've found out that the reverse is true for designing a GUI. Writing text works up to a point, but when you have a main window with 30 or 40 widgets, plus a couple of side windows each with similar complexity, it goes much faster and easier if you can design it graphically rather than typing it all out.


Asked by: Kevin460 | Posted: 06-12-2021






Answer 1

Apart from the options already given in other answers, there's a current more active, recent and open-source project called pygubu.

This is the first description by the author taken from the github repository:

Pygubu is a RAD tool to enable quick & easy development of user interfaces for the python tkinter module.

The user interfaces designed are saved as XML, and by using the pygubu builder these can be loaded by applications dynamically as needed. Pygubu is inspired by Glade.


Pygubu hello world program is an introductory video explaining how to create a first project using Pygubu.

The following in an image of interface of the last version of pygubu designer on a OS X Yosemite 10.10.2:

enter image description here

I would definitely give it a try, and contribute to its development.

Answered by: Adelaide541 | Posted: 07-01-2022



Answer 2

You have VisualTkinter also known as Visual Python. Development seems not active. You have sourceforge and googlecode sites. Web site is here.

On the other hand, you have PAGE that seems active and works in python 2.7 and py3k

As you indicate on your comment, none of these use the grid geometry. As far as I can say the only GUI builder doing that could probably be Komodo Pro GUI Builder which was discontinued and made open source in ca. 2007. The code was located in the SpecTcl repository.

It seems to install fine on win7 although has not used it yet. This is an screenshot from my PC:

enter image description here

By the way, Rapyd Tk also had plans to implement grid geometry as in its documentation says it is not ready 'yet'. Unfortunately it seems 'nearly' abandoned.

Answered by: Elian100 | Posted: 07-01-2022



Answer 3

The best tool for doing layouts using grid, IMHO, is graph paper and a pencil. I know you're asking for some type of program, but it really does work. I've been doing Tk programming for a couple of decades so layout comes quite easily for me, yet I still break out graph paper when I have a complex GUI.

Another thing to think about is this: The real power of Tkinter geometry managers comes from using them together*. If you set out to use only grid, or only pack, you're doing it wrong. Instead, design your GUI on paper first, then look for patterns that are best solved by one or the other. Pack is the right choice for certain types of layouts, and grid is the right choice for others. For a very small set of problems, place is the right choice. Don't limit your thinking to using only one of the geometry managers.

* The only caveat to using both geometry managers is that you should only use one per container (a container can be any widget, but typically it will be a frame).

Answered by: Lenny282 | Posted: 07-01-2022



Similar questions

python - Why Tkinter geometry takes a string?

I've recently been working on a project having to develop a simple GUI app using Python. I was looking at setting the form size to a default value and came across the minsize and geometry methods. minsize takes two arguments representing height and width. geometry takes a single string representing the information. I was wondering why the discrepancy? Is there a good reason why a single string is ...


python - How to change window geometry in tkinter using after?

What I want to achieve is displaying an image on another application window with regard to its coordinates. For example, it should appear 100 pixels down and 100 pixels left to the left upper corner. I am using transparent window for the image, and it displays an image properly but it doesn't update its coordinates. Here is my code: import tkinter as tk # Python 3 from functions import window_coord...


python - Tkinter geometry method to only set width or height

The following will set a tkinter window width and height. root.geometry("500x500") Is it possible to only set width or height? Where can I find a full list of geometry method variations, for setting only select parameters? I would like to be able to set select parameters, of the window size and/or position, and let the rest ...


python - Why i am getting the bad geometry error in tkinter

from tkinter import Tk root=Tk() root.geometry("680×1200") canvas = canvas(root,width =100,height=100) canvas.grid(column=1,row=0) photo = PhotoImage(file = "/storage/emulated/0/Documents/pixelLab/20220918_124806.png") canvas.create_image(20,20,anchor=NW,image=img)


python - Why Tkinter geometry takes a string?

I've recently been working on a project having to develop a simple GUI app using Python. I was looking at setting the form size to a default value and came across the minsize and geometry methods. minsize takes two arguments representing height and width. geometry takes a single string representing the information. I was wondering why the discrepancy? Is there a good reason why a single string is ...


python - How to change window geometry in tkinter using after?

What I want to achieve is displaying an image on another application window with regard to its coordinates. For example, it should appear 100 pixels down and 100 pixels left to the left upper corner. I am using transparent window for the image, and it displays an image properly but it doesn't update its coordinates. Here is my code: import tkinter as tk # Python 3 from functions import window_coord...


python - Tkinter cannot use geometry manager grid inside

Widgets works generally when running this when code below Label(window, image=photo1, bg="black").grid(row=0, column=0, sticky=E) Code gives me the error: _tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack I understand that this error is about using both .pack and .grid but it works without this line, whic...


python - The Tkinter Pack Geometry Manager - options

I am teaching myself TKINTER at the moment. I have written... self.frameBottom = tk.Frame(master) self.frameBottom.pack(side=tk.BOTTOM, fill=tk.BOTH) self.textBox = tk.Text(master, height=1) self.textBox.pack(side = tk.LEFT, expand=1, fill=tk.X) self.searchButton = tk.Button(master, text="Search", command=self.searchButtonPress) self.searchButton.pack(side = tk.RIGHT) self.textBoxResults = tk.Text(self....


tkinter frame has no geometry python tkinter

why do i get this error? this is my first time trying to understand what is going in a class but i cant seem to figure it out. the app variable saves it as tkinter windowframe and that way i can put widgets on it but if i need to change the geometry how would i do this?. im sorry for my bad explaining. Any help would do. import tkinter as tk class App(tk.Frame): def __init__(self, parent): app = tk.Fr...


python - Why I cannot use tkinter geometry manager grid?

I'am trying to build a simple tkinter GUI but I got this error: _tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack Here is my code: file_menu = Menu(menu_bar, tearoff=0) file_menu.add_command(label='New') file_menu.add_separator() file_menu.add_command(label='Exit', command=_quit) menu_bar.add_cascade(label='File', menu=file_menu) hel...


python - Unable to hide Tkinter window while I am setting its geometry

I have a root window and I want to create a Toplevel window positioned in a specific place on the screen (centralized over the root window). So far I have been unable to accomplish this without seeing the Toplevel window quickly build itself in its default location and then hop over to the position I want it. I would prefer not to see this because it's weird and jarring. Is there a way to build, then reposition a wi...


python - Tkinter geometry method to only set width or height

The following will set a tkinter window width and height. root.geometry("500x500") Is it possible to only set width or height? Where can I find a full list of geometry method variations, for setting only select parameters? I would like to be able to set select parameters, of the window size and/or position, and let the rest ...


python - Tkinter button not working geometry error

This question already has an answer here:


python - tkinter when I set a widgets height and width the right geometry is not set

This is the code : from tkinter import * app = Tk() app.configure(background='DimGray') b=Button(app,bg='#e6e6e6',width=50,height=50) b.pack() b.update() print(b.winfo_width()) app.mainloop() And this is the output : 360 The output should be 50 but it is not


python - How do I overlap widgets with the Tkinter pack geometry manager?

I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background. Is it possible to have two states for the pack manager: one for one set of widgets and another for another set?


Good geometry library in python?

Closed. This question does not meet Stack Overflow guid...


python - Postgis - How do i check the geometry type before i do an insert

i have a postgres database with millions of rows in it it has a column called geom which contains the boundary of a property. using a python script i am extracting the information from this table and re-inserting it into a new table. when i insert in the new table the script bugs out with the following: Traceback (most recent call last): File "build_parcels.py", line 258, in <module>...


python - How do I use Django to insert a Geometry Field into the database?

class LocationLog(models.Model): user = models.ForeignKey(User) utm = models.GeometryField(spatial_index=True) This is my database model. I would like to insert a row. I want to insert a circle at point -55, 333. With a radius of 10. How can I put this circle into the geometry field? Of course, then I would want to check which circles overlap a given circle. (my select stat...


Help with Windows Geometry in Python

Why are the commands to change the window position before and after sleep(3.00) being ignored? if self.selectedM.get() == 'Bump': W1 = GetSystemMetrics(1) + 200 print W1 w1.wm_geometry("+100+" + str(W1)) w2.wm_geometry("+100+" + str(W1)) w3.wm_geometry("+100+" + str(W1)) w4.wm_geometry("+100+" + str(W1)) self.rvar.set(0) self.rvar2.set(0) ...


python - Parsing MSDN Geometry Data Type

I have a database where one field gives spatial coordinates. I have learned the field is a serialised MSDN geometry Data Type (http://msdn.microsoft.com/en-us/library/bb933973.aspx). I want to access this database from Python and was wandering if anyone knew the format of the Geometry Data Type, or any libraries capable of parsing ...


python - GUI layout using Tk Grid Geometry Manager

Building a small application for personal use with Python and thought I'd try my hand with a little GUI programming using Tkinter. This is the GUI I've created so far: Application doubts: How can I make sure that the three LableFrames - A, B and C in the screenshot - have the same width? (Or rather, have ...


geometry - Integral of a triangle function in python

I have just defined a function which is the integral of a given step function, and now I would like to integrate the triangle function obtained. jerk:1,-1,1-1 The step function correspond of a given list of successive jerk. For getting the triangle function, I have used the formula: a(t)=kt+ac with k the Jerk and ac a con...


geometry - Python - Pygame Drawing Angle

I need to draw an angle(in Pygame), given it's 1. Measure of the angle (θ) 2. Endpoints of the base(A & B) Here I know 1. Measure of θ (in radians and degrees) 2. (x,y) of A and B 3. Measure of BC My Question How do I calculate the position of the Co-ordinates(...


python - Convert Point Geometry to list

I have the following script that creates a point geometry. How can I convert this point geometry to a list only containing the coordiantes to look like [258432.79138201929, 1001957.4394514663]? >>> import ogr >>> driver = ogr.GetDriverByName('ESRI Shapefile') >>> pointshp = driver.Open('U:/My Documents/Tool/shp/point.shp', 0) >>> pointlyr = pointshp.GetLayer...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top