For occassional usage, it might be friendlier for users to be presented with an interactive selection screen that leads users through conversion options, and provides visual feedback of options selected, before performing the actual conversion. But they are in the same ballpark. Beyond the capability for selecting each configuration option, a scrolling help box is created with the TK Text widget, an about box used the Message widget, and a series of history lines help flex 'TK's dynamic geometry management a little bit. Of course, as with most interactive applications, some user input is caught with 'TK's Entry widget. But the only thing actually missing from our first sample program is some widgets to populate the root window we have created.
Every widget has a parent.
Whenever we create a widget, the first argument to the instance creation is the parent of that new widget. This gives us lots of flexibility about what options we want to override the defaults on, and which we are happy to leave be. It would be possible to pass these around from function to function, and maintain a theoretical purity about scoping. Doing that is much more trouble than it is worth. After a widget is created, it needs to call a geometry manager method to let TK know where to put the widget.