A quick tour of GT
This page is intended to provide you with a quick tour of the GT environment and several of the tools within it.
As explained in more detail on the page What is Glamorous Toolkit?, GT is a Moldable Development Environment for creating inexpensive contextual tools to make software systems explainable. But here we will focus just on technical aspects of GT to help you understand what tools make up GT, and how to navigate its UI.
Technically, GT is a Pharo Smalltalk environment of live objects. Everything you see and everything you interact with is an object . Programming means making small, incremental changes (adding or changing classes or methods) to this live system. GT uses these live objects to model and interact with software systems of interest, whether they are implemented directly in Smalltalk, or in any other language (such as Python, Java or Rust).
Tabs — You probably arrived at this page by clicking on some of the links in the Glamorous Toolkit Book home card visible on the initial GT World screen. At the top left of
this
screen you can see a number of
tabs
. The currently active tab is probably labeled A quick tour of GT (the title of this page). There is also (at least) all the way to the left a tab labeled gt, showing you the home screen.
Try it:
Click on the gt tab and back again to this tab.
If you have multiple open tabs, you can drag their positions around. You can
primary
-click on a tab to get a menu of actions (close tabs to left or right etc.). There are also buttons on the tab to open the tab in a new window or to close it.
Spotter — to the far right at the top of the screen there are three buttons. The first is a Search button to search globally within GT for pages, tools, classes, packages, and many other entities. Try it: Click on the Search button and just start typing to see the list of partial results. If you hit return , then you will open a new tab with the result. Then come back to this tab. NB: you will find Spotter search buttons elsewhere in GT, but very often these other tools will show you specialized searches restricted to a particular context, for example, just the pages of a particular knowledge base.
Lepiter knowledge base status — Next to the search button there is a little colored circle that may be green, orange or red. It provides you information about the status of the various knowledge bases that may be loaded into GT. By default you get the GT Book — a knowledge base ofdedicated notebook pages about GT itself — and your “Local knowledge base” — a collection of pages that you write, and are stored locally on your machine. There may also be other knowledge bases dedicated to projects that you create or load. This button keeps you informed about whether changes have been safely stored to disk.
Menu — Finally there is a hamburger menu providing access to several tools within GT as well as buttons to Save , Rename , and Quit the environment. More details follow below.
We said that GT is an environment of live objects . This means that programming consists in making changes to a live system : incremental changes to classes or method will affect the behavior of the existing objects. But what happens to these objects when we quit the environment? The short answer is that all these objects are stored in an image file containing a frozen snapshot of everything in the live system. When you press the Save button, you overwrite the image with a new snapshot. On the other hand, if you Quit , then any changes to objects since the last save are lost.
Try it: Save the image, Quit , and then restart GT. You should find yourself back in exactly the state you are now.
NB: although the live objects in the system are saved in the image, notebook pages are separately stored as individual files in JSON format, and code changes are stored in a separate changes file. This means that even if you quit (or crash) the environment without saving, changes to code and pages will normally be backed up and recoverable. For more details see Pharo architecture and How do I recover my work after a crash?.
Tip: Get into the habit of saving your image periodically, or after any important changes.
Pro tip: If you plan to develop a project with GT, don't rely on saved images. Instead put your project under version control using GitHub, and always start work with a fresh image into which you load your poejct. See How to work with GitHub.
In the GT menu, the first entry is Page . This allows you to create a new notebook page in your local knowledge base . This knowledge base will be created, if it does not already exist, in the Documents folder of your local machine in a folder called lepiter . Pages you create will automatically be saved within this folder, and every time you start GT, even from a new download or build of GT, you will find your private database as you left it.
Try it: Click on the Page icon in the menu, and select Text as the kind of snippet to create. Give the new page a title and some contents. Then come back to this tab. You should find your new page in the view below of your private database pages.
For more information, see How to get started with Lepiter (FAQ).
The next GT menu entry is
Knowledge bases
. It opens a view of all the currently loaded Lepiter knowledge bases in your GT environment. By defaultyou get two of these:
• Glamorous Toolkit Book (which includes this page) is a knowledge base dedicated to documentation about GT itself.
• Documents/lepiter/default is your
Local knowledge base
which you can use at your pleasure to keep notes, start experiments, track your activities, or anything you like.
Additional knowledge bases may be associated with other projects. Very often a GT GitHub project will have its own knowledge base to track development acivities or to store documentation.
Try it: Directly open pages from the databases below.
The Coder is a tool for browsing and authoring packages, classes and methods. At the left you can select either a package or class hierarchy view of the system. The latter only makes sense if a specific class has been selected. There is a Spotter tool to search for classes or packages by name, and an add class or package button that will open a creation widget. At the right you can browse or edit specific packages or classes.
Try it: click on a package to browse its classes, and then click on a class to browse its methods.
Find out more in How to get started with Coder (FAQ).
Pro tip: In practice, coding in GT tends to happens in the context of live objects using Inspector playgrounds rather than using the Coder, which only provides you static views of code divorced from live objects. If you find yourself writing code mostly in the Coder, you should read about Moldable Development patterns, and in particular about Contextual Playground.
The
Git
tool allows you manage git repositories. At the left you will see a list of loaded repositories, and at the right you can manage an individual repo.
NB:
In the standard release of GT, there are no git repositories loaded by default, whereas a developer build contains all the GT repositories pre-loaded.
To clone a remote repo or to load a local one, use the + (
Add repository
) button. There are also buttons to
fetch
,
search
and
refresh
the list of repos.
Try it:
Click on the + button below, select
Clone a remote repository
, and paste in the following URL.
https://github.com/feenkcom/paper-moldable-patterns.git
You should now see the repo paper-moldable-patterns at the right, with a simple GUI to explore the
Commits
,
Packages
etc., and to
fetch
,
pull
,
commit
and
push
changes.
To learn more, see How to work with GitHub.
The Code changes tool records all changes to code in GT. It is rarely needed, but is essential in case of a system crash to select and replay any changes since the last time the image was saved. See How do I recover my work after a crash?.
The Monitor tool provides various views of the running processes within GT. There are several buttons at the top right, in particular one to start a Profiler on the system The Monitor can be especially useful for track down and killing zombie processes that may be slowing down GT. See What to do when GT slows to a crawl?
Finally, the Transcript is a tool for logging information from applications.
Try it: Evaluate the following snippet.
Transcript nextPutAll: 'Hello world!'; cr
Click on the trash can at right to empty the Transcript.
We have taken a quick tour of the the top-level interface of GT, and seen several of the tools that can be started up in the environment, but this barely gives a hint of how GT can be used effectively to make systems explainable. For the details, go back to 1. Learn the basics of Glamorous Toolkit.