top of page
Search
  • ciecimenlandmu

Mastering Perl/Tk: Get the PDF and Become a Pro at Perl GUI Programming



When an event related to your widget fires, the subroutine that has been bound to the command is called. Possible bound events include key clicks and releases, mouse motion, and window resizing. More information can be found using perldoc Tk:bind.


One of the most powerful widgets in Tk is the Canvas window. In a Canvas window, you can draw simple graphics and include other widgets. The Canvas area may be larger than the visible window, and may then be scrolled. Any item you draw on the canvas has its own id, and may optionally have one or more tags. You may refer to any item by its id, and may refer to any group of items by a common tag; you can move, delete, or change groups of items using these tags, and you can bind actions to tags. For a properly designed (often structured) Canvas, you can specify powerful actions quite simply.




mastering perl tk pdf download



Unfortunately, there are still places in Perl ignorant of Unicode. One of these places are filenames. Consequently, the file selectors in Perl/Tk do not handle encoding of filenames properly. Currently they suppose that filenames are in iso-8859-1 encoding, at least on Unix systems. As soon as Perl has a concept of filename encodings, then Perl/Tk will also implement such schemes.


You'll need both Tk and bindings for the language you're using it from. Sometimes these are bundled together, sometimes not. Though there are lots of ways to install Tk, often the easiest is to download and install one of the versions provided by ActiveState (www.activestate.com).


In your web browser, visit www.activestate.com/products/activetcl.Download ActiveTcl (as of this writing, it's version 8.6.9). Make sure to download an 8.6.x version, not something older!Note that you will need to create an account with ActiveState (no cost) to download it. After it's downloaded, run the installer to get Tcl and Tk loaded onto your machine.


In your web browser, go to www.activestate.com, and followalong the links to download the Community Edition of ActiveTcl.Note that you will need to create an account with ActiveState (no cost) to download it.Make sure you're downloading an 8.6.x version, not an older version.


Ruby/Tk is a binding that links against an existing but separate Tk library. So, to get the latest version of Tk for Ruby, we're going to have to do first download the latest 8.6.x Tcl/Tk version from ActiveState.


The "ActiveTcl" distribution from ActiveState contains the latest Tk, as well as the latestversion of Tcl (which Ruby's Tk bindings use internally to talk to Tk). In your web browser, go to www.activestate.com, and follow along the links to download the Community Edition of ActiveTcl. Note that you will need to create an account with ActiveState (no cost) to download it.Again, make sure you're downloading an 8.6.x version.


For modern Tk programming using Perl, the "Tkx" module is highly recommended, and we'llbe using that here. It links against an existing but separate Tk library. So, to get the latest version of Tk for Perl, we're going to have to do first download the latest 8.6.x Tcl/Tk version from ActiveState.


The "ActiveTcl" distribution from ActiveState contains the latest Tk, as well as the latestversion of Tcl (which Perl's Tk bindings use internally to talk to Tk). In your web browser, go to www.activestate.com, and follow along the links to download the Community Edition of ActiveTcl. Note that you will need to create an account with ActiveState (no cost) to download it.Again, make sure you're downloading an 8.6.x version.


Next, you'll want to install Perl. There are multiple ways to do this, as explained at www.perl.org. One option is to use a package manager like Homebrew. Once it's been installed (at /usr/local/bin/brew) you can install Ruby from a command prompt (e.g. Terminal) via:


That should put the Perl binaries in /usr/local/opt/perl/bin).You can check this via brew info perl. Below, where we use perl,make sure you're running the version you just installed. One way to do that is specifying the fullpath.


Next, you'll need to download and install Perl's Tkx module. We can grab it from CPAN. Unfortunately, at present it will not install correctly due to errors in its tests. We can bypass the tests and install it anyway. To do so, from the command prompt, run:


In your web browser, go to www.activestate.com, and followalong the links to download the Community Edition of ActiveTcl for Windows. Make sure you're downloading an 8.6.x version. Note that you will need to create an account with ActiveState (no cost) to download it.


Ruby/Tk is the binding for Tk. In the distant past, installing it on your Windows machine used to be pure hell, involving installinga separate version of Tcl/Tk, downloading a development environment like Visual Studio, downloading the Rubysource code, carefully compiling Ruby, ...


The "ActivePerl" distribution from ActiveState includes not only Perl, but also recent versions ofTk and Tcl (which Tkx uses internally to talk to Tk). In your web browser, go to www.activestate.com, and follow along the links to download the Community Edition of ActivePerl. Note that you will need to create an account with ActiveState (no cost) to download it.


But to do so, you'll need to get the Tcl and Tk include files and libraries loaded on your machine first.Again, while there are several ways to do that, the easiest is to download and install ActiveTcl.


In your web browser, go to www.activestate.com/products/activetcl.Download the latest version of ActiveTcl for Linux. Make sure you're downloading an 8.6 or newer version. Note that you will need to create an account with ActiveState (no cost) to download it. After it's downloaded, unpack it, run the installer (sudo ./install.sh), and follow along. You'll end up with a fresh installof ActiveTcl, located in, e.g., /opt/ActiveTcl-8.6.


Next, download the current Python 3.x source distribution from python.org, and unpack it.On your configure line, you'll need to tell it how to find the version of Tcl/Tk you installed. Then build as usual:


In your web browser, go to www.activestate.com, and followalong the links to download the Community Edition of ActiveTcl for Linux. Make sure you're downloading an 8.6.x version. Note that you will need to create an account with ActiveState (no cost) to download it.


If you do not have privileges to install software or if you needa newer version than the one provided by the system, you may useone of the alternative means of obtaining Tcl as described below.Binary DistributionsPre-built Tcl distributions for many common platforms are availablefor download. These include both traditional installers as well assingle file "download and run" executables. SeeBinary distributions.Source DistributionsFinally, you always have the option of downloading the Tcl/Tk sourcedistributions and building it yourself. SeeSource distributions for instructionson downloading and compiling.Related SoftwareA very large number of libraries and extensions are available for Tcl/Tk.The most popular and commonly used ones are catalogued in theGreat Unified Tcl/TkExtension Repository. (In other words, get them from the GUTTER.)The Tcler's Wiki is an alternate,but uncategorized, resource for the same.License InformationTcl/Tk is open source (based on a BSD-style license), so you canuse it and modify it virtually any way you want, including forcommercial uses. Here is the Tcl source distributionlicense, but be sure to check the license for any particulardistribution you use.This is the main Tcl Developer Xchange site,www.tcl-lang.org . About this Site [email protected]Home About Tcl/Tk Software Core Development Community Documentation


The Graphviz layout programs take descriptions of graphs in a simple text language, and make diagrams in useful formats, such as images and SVG for web pages; PDF or Postscript for inclusion in other documents; or display in an interactive graph browser. Graphviz has many useful features for concrete diagrams, such as options for colors, fonts, tabular node layouts, line styles, hyperlinks, and custom shapes.


As previously stated, the best way to get the latest version of Tkinter is to install Python 3.7 or later. But Tkinter can also be downloaded and installed as part of any standard Python 3 installation.


Tkinter is not available as a standalone package for download. Instead, it is included in the standard library of recent versions of Tcl and Python. The easiest way to download Tkinter is therefore to install a recent version of Tcl or Python.


Tkinter for Python is not available as a standalone package for download. Instead, it is included in the standard library of recent versions of Python. The easiest way to download Tkinter is therefore to install a recent version of Python.


Older versions of Tkinter do not include the latest widgets provided by the Ttk extension. The best Tkinter download version is 8.5 or later, which includes Ttk. For Python developers, the easiest way to get the latest version of Tkinter is to install Python 3.7 or later. 2ff7e9595c


1 view0 comments

Recent Posts

See All

コメント


bottom of page