Setting Window Size In Tkinter
To set a window to an initial size we will be using ".geometry".
Insert the BOLD code into your python editor. (See Part-1 for help with IDLE)
#! /usr/bin/env python
from Tkinter import*
window = Tk()
My code looks like this:
Save your work using the same procedure as in Part-1. Only this time name your file tkinter2.py.
Open your terminal window and change directory to your Desktop.
Enter cd Desktop in your terminal window. Click enter.
Enter chmod 755 tkinter2.py in your terminal editor. Click enter.
Enter ./tkinter2.py in your terminal window. Click enter.
Ignore my scrot commands in my terminal window.
If everything went OK then your screen should produce a window (below) with a larger size. Note: The window is not currently doing anything except opening.
Throughout these posts I will show you how to build a GUI that will actually do cool audio control stuff.
For now, practice the procedure I just showed you until you can enter all of the code without looking at mine. Also, play around with different window sizes while you are at it.
TKINTER2.PY GUI RESULTS:
Here is the screen capture for my Ras-pi-3 running tkinter2.py.
"Part-1" screen of tkinter1.py: Notice the size difference of the grey window?
NEXT UP? ADDING A SIMPLE BUTTON
Thanks for reading,