Introduction ========================= PAGE is a tool which helps in the creation of Python GUI interfaces using Tkinter and the Tk/ttk widget set. It is a fork or extension of the program Visual Tcl (vTcl) which now produces Python code. PAGE runs on any system with Python installed and the generated Python code requires only Python to execute. macOS is an exception; PAGE does not run on macOS. Faced with the problem of building a GUI for an application, users will find that PAGE facilitates designing that GUI and building a working skeletal Python program utilizing the Tk/ttk widget set. As of version 7, PAGE supports the design and construction of GUI's with multiple toplevel windows. See :ref:`Applications with Multiple Top-Level Windows`. Also, PAGE supports design rework to a limited extent. Version 7 is much simpler while supporting expanded functionality compared to earlier versions. Version 8 includes support for Ttk styles and themes. PAGE is aimed at a use who wants to rapidly construct a GUI and is willing to accept the limitations of Tk and the Place Geometry Manager. It is a helper tool. It does not build an entire application but rather is aimed at designing and implementing GUI windows. It is not a Python Interactive Design Environment (IDE). Stated in other words, PAGE generates Python classes which implement GUI windows and also supplies all of the boiler-plate code for execution or instantiation of the GUI objects. If, like me, you have difficulty remembering all the little tricks of getting a GUI to actually appear on the screen, PAGE can show you code that will work. .. When I first set about building programs that exploited Tkinter, I .. could not find nearly enough examples. Another way of looking at PAGE .. is to consider it to be a Tkinter example builder which can build the .. examples you need to see. It is a good place to start when starting .. with Tkinter. The author is Donald Rozenberg and the project page for PAGE is http://page.sourceforge.net/. My email address is Don dot Rozenberg at gmail dot com. Note that some of the screen shots in this documentation may appear with a gray or a wheat background. The reason is that the Tk default color is gray but I prefer wheat. Also, the font size is often large because I prefer, nay require large fonts. Change History ~~~~~~~~~~~~~~ .. include:: The 8.1 release: + Changes the page.bat file improving the initiation of PAGE on Windows. + Improves the menu editor by showing only options available to the selected menu item. + Supports tk and ttk menubuttons. Cut-copy-paste not supported. + Improves popup or context menus by allowing the specification of the function name. + Changes how the Attribute Editor and the Menu Editor treat the image attribute. + Recognizes that PAGE does not currently work properly on macOS. This is the result of the macOS support of tcl. . The 8.0 is a major release providing: + A first attempt to support ttk themes, but with my tweaks. See :ref:`v8`. + Several themes coordinated with PAGE theme support. + Support for copy-paste of menubars from lender project to current project. + Improved support popup menus including copy-and-paste. + Ability to change locations of notebook tabs. There are known issues with menu editing that will be addressed in a future release. The 7.6 release: + Adds support for vertical progress bars. + Improves behavior Attribute Editor resizing. + Changes popup (context) menus from root widgets to toplevel widgets. + Extends Tooltip support to allow user specify attribute changes from within the support module. + Corrects some issues with Menu Editor. + Corrects an issue with the borrow facility. The 7.5 release: + Moves some boiler plate code from the toplevel class definitions to the module level. + Adds function to Widget Tree allowing collapse and expansion of container widgets. See :ref:`compress`. + Changes the code generation for GUI images so that generated GUI modules can be executed from arbitrary directories. See :ref:`images`. + Corrects problems with paned window widget. + Improves menu processing. + Makes minor corrections to color handling. + Changes skeletal callback functions to make the output more readable. + Adds a couple of color utilities to help with choosing colors. See :ref:`color_utilities`. The 7.4 release: + Cleans up color handling and can lead to a "Dark" mode for PAGE. See :ref:`dark`. + Supports the location of rc files to be in any writable directory. See :ref:`rc`. + Added some capability to modify global colors when reopening existing projects. See :ref:`reopen_colors`. + Includes a new example which shows all of the supported widgets and shows some useful tips. See :ref:`widgetdemo`. The 7.3 release consists mostly of bug fixes. The 7.2 release: + Corrects bugs related to the textvariable option with ttk widgets. Requires the user to disregard "::" artifact in Attribute Editor. + Disallows the closing of the Widget Tree by the user. + Now supports a variety of graphical formats including JPEG for most architectures and OS's. + Uses tk widgets, in place of ttk widgets for dialogues. + Corrects bugs in the update functions. + Corrects bug with selecting TLabel widgets. + Supports selection with Double-Button-1 in Widget Tree. See :ref:`wt_double`. + Implements a search function in Widget Tree. See :ref:`wt_search`. The 7.1 release: + Improves behavior of Attribute Editor. + Corrects bug that prevented creation of popup menus. The 7.0 release is a major release: + Utilizes new formats for the generated GUI module and the support module which are simpler particulary for multiple toplevel GUI's. See :ref:`mod_struct`, :ref:`Applications with Multiple Top-Level Windows`, and :ref:`auto_update`. However the new formats present some backward compatibility questions with existing support modules; see :ref:`compat7`. + Changes code for the skeletal callback functions. + Drops Python 2 support. + Updates examples to version 7. + Updates and substantially enlarges the tutorials. + Includes a discussion on migrating projects created in earlier versions of PAGE. + Improves presentation of attribute errors. + Allows user defined names for context menu function names. + Corrects code for using images. + Corrects code in notebook editor. + Improves the handling of text and textvariable interactions. See :ref:`interact`, and :ref:`ae`. + Adds support for the ttk::spinbox widget. + Modifies the copy-paste to behave more naturally when borrowing toplevel windows. See :ref:`borrow`. + Corrects problems with copy-paste of toplevel menubars and context menus. + Modifies the Widget Tree to behave more naturally when borrowing. + Relegates backup files to the "backups" subdirectoy of project directory. + Adds a preference to add custom sizes to the font selection dialog. + Provides support for the labelanchor attribute with labelframe widgets. + Provides support for inclusion of the post command for the ttk::combobox. + Fixes miscellaneous bugs. The 6.2 release fixes some bugs. The 6.1 release: + Implements an auto-save feature. See :ref:`auto_save`. + Invocation accepts a nonexistent project name. See :ref:`preferred invocation `. + Expands the documentation to discuss :ref:`setting command preferences`. + Better handles specification of validation attributes. + Better handles remembering of PAGE window geometry. + Fixes some bugs. The 6.0 release: + employs a Python wrapper which leads to a much simpler installation process, + improves the error handling and display of PAGE errors, + puts install directory in users PATH for Windows users, + sets working directory of Windows icon to the users Desktop. Installation ~~~~~~~~~~~~ **With PAGE 6.0, the way PAGE is installed and invoked has changed.** Installation is much simpler than before and avoids the need to separately install Tcl/Tk. In essence, PAGE uses a Python wrapper, that is a minimal Python module which invokes PAGE which remains a Tcl script. The advantage of the new approach is simplicity of installation. There is no longer a need to install Tcl/Tk. The primary disadvantage I see is that the Tcl/Tk included with Tkinter does not support jpeg images. See :ref:`images`. While that support can easily be added to Linux installations, I have not found a way to added additional image support to Windows. **With PAGE 7.0 PAGE ceases to cater to Python 2.** The required packages for executing PAGE are: * PAGE 7 or greater - This is the GUI generator. Actually one should be using the latest version. * I recommend Python 3.6 or greater. The latest version is a good idea. The packages required for executing the python code generated by PAGE are: * The generated Python modules will execute under Python 3. One does not require PAGE to execute programs containing GUI's generated by PAGE. All that is necessary is a Python version which includes the ttk widgets. The default installation directory is "page" in the users home directory on Unix-like systems. This directory contains the script "page.py", which is executed to invoke PAGE on Unix-like systems. With Windows the default PAGE installation directory is C:\\page. The installation directory contains "page.bat" which invokes PAGE. Installation on Linux --------------------- Untar the distribution file in your home directory. You can probably use 'tar zxvf pageXXX.tgz. This will put all the distribution in the subdirectory "page". Installation on Windows ----------------------- Download page-x.x.x.exe and execute it. This will install PAGE in C:\page. As part of the installation "page.bat" is installed in that directory, page.bat is the analog to the "page" script mentioned above. page.bat is a one line file containing: .. sourcecode:: python @start /min py c:\page\page.py %1 %2 %3 One can install PAGE in any directory and have the icon start the program. The default directory for installation is C:\\page. .. It was suggested by Pär Smårs that the generation of winpage.bat with .. the correct installation directory should be done magically at .. installation. With version 4.8.7, I managed to do this. Since I have .. a deficient understanding of the Windows world, I decline trying to .. update the PATH environmental variable. The installation directory is automatically added to the Path environmental variable at installation. Thus "page" will invoke the program from any directory. The Shortcut icon will use the users Desktop folder as the working directory. PAGE and macOS -------------- I have not done much with PAGE on OS X. Several users, including Kent Fox, have tried PAGE on OS X and have convinced me that I should try to support PAGE on that system. .. However, the .. implementation of ttk with respect to color on OS X doesn't seem very .. satisfactory to me so I recommend sticking with default colors. .. .. .. #. Download the current version probably page-8x.tgz. .. .. #. Double click on it to expand the zip file. .. #. Move the page folder to your home directory. However there are problems with the tcl/tk implementation on macOS which prevents necessary functioning of PAGE from running. In addition the version of tcl/tk bundled with macOS is an old version. .. _rc: Initializing and Executing PAGE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **It is important that the current directory is the development directory for the application when PAGE is started.** A number of users have experienced difficulties because they started PAGE without being in the development directory. Please visit the directory "How To Start PAGE" in page/docs for Greg Walters discussion of our recommended startup procedure. One executes PAGE in Unix-like systems, Linux, SunOS, etc., by issuing the "python3 page.py" command in the installation directory. Running "./configure" in the installation directory creates an executable file "page" in the installation directory. One can then create a shell alias like: .. sourcecode:: python alias page="python3 ~/page/page.py" Either way, you can execute "page" in any directory. Be aware that Linux system may have a completely different command with the name “page”. If you issue the command “page” and strange things happen check to be sure you know if our page was executed. Initialization rc Files ----------------------- Associated with the execution of PAGE is an initialization file sometimes called an rc file. It contains the initial configuration, i.e. color schemes, font preferences, window locations, the Python command name, and many other initial values. With PAGE the rc file is by default the file ".pagerc" located in the user's home directory. With Linux and UNIX like systems, PAGE determines the home directory from the HOME environmental variable. With Windows, PAGE tries to get the home directory from the HOME environmental variable. If there is no HOME environmental variable, PAGE uses the HOMEDRIVE and HOMEPATH variables. There are times when one wishes to have multiple initial configurations which are facilitated by having multiple rc files. With version 7.4, rc files are not restricted to the users home directory. For instance, if one wish to have a particular color scheme for a particular PAGE product, he/she may create a custom rc file in the associated project directory. You create a custom rc file by opening PAGE, selecting Preferences from the main menu, and saving the modified preferences wherever you like. The name of the new rc file may be any legal file name, but if you forgo the character "." and end with "rc", the -s argument below will work more satisfactorily. The command for executing PAGE is: .. sourcecode:: python usage: page [