How it works...
Note how, in the first screenshot, our new Spinbox control defaulted to a width of 20, pushing out the column width of all controls in this column. This is not what we want.
We gave the widget a range from 0 to 10.
In the second screenshot, we reduced the width of the Spinbox control, which aligned it in the center of the column.
In the third screenshot, we added the borderwidth property of the Spinbox, which automatically made the entire Spinbox appear no longer flat, but three-dimensional.
In the fourth screenshot, we added a callback function to display the number chosen in the ScrolledText widget and print it to the standard out stream. We added \n to print on new lines. Notice how the default value does not get printed. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access