Tkinter Tk/Tcl is a cross-platform widget tool kit that is used to create graphical user interfaces (GUIs) for Python programs. Tkinter is included with standard Linux, Microsoft Windows and Mac OS X installs of Python. For more information on tkinter, see the official Tkinter Python documentation. There are different implementations of how differnet functions are implemented on different platforms. To tackle that PyFormGUI was created.
PyFormGUI is a Python module is a wrapper around the tkinter module. It is designed to be easy to use and to provide a powerful set of widgets that are commonly needed in GUI applications. PyFormGUI is designed to work on all platforms.
This project was created for making simple forms using built-in Python Tkinter Library that can fetch values and can be used directly within the program with just a single line required for making a field. (Just like Flutter)
The function has various attributes which can make it read-only, number-only etc. (explained below)
Run main.py for the GUI
At the start of your program, call the following function to start the window from the inbuilt Window
main_window = Window.start_window('')
This will take the following arguements:
- title (String): Title of the window
- windowIcon (String): Icon of the window - store your assets in assets folder and pass the name of the image as a string. Eg. 'icon.png'
- fullscreen (Boolean) - True or False - Default is False, if True, the window will be fullscreen
- resizable (Boolean) - True or False - Default is True, if False, the window will not be resizable
- color (String) - pass the hex code of the color you want the window to be. Eg. '#000000' for black
At the end of your program, call the following function to close the window:
Window.close_window(main_window)
Example:
main_window = Window.start_window(title = 'Main Window',
windowIcon = 'info_icon.png',
fullScreen = False,
resizable = True,
color = '#000000') #hex for black
Window.close_window(main_window)
This will create the following window i.e. not fullscreen and resizable.