Quick skim of Pharo Spec UI book

23 Aug 2019

Notes based on The Spec UI framework

Skim reading notes

Small but complete interfaces

Customer satisfaction UI

Allows user to give feedback by clicking on one of three buttons: 'Happy', 'neutral' and 'bad' with little icons in each button.

Fun with lists

A list using different background colors and a list that also shows icons.

Ideas

Chapter conclusion

Reusing and composing elements

Widgets are all reusable, this gives significant productivity boost when creating user interfaces.

This chapter shows us how to build new ui using existing ui elements.

First requirements

The only thing that needs to be taken into account is how a UI can (or should) be customised, and public customization methods should be placed in a api protocol.

Fundamentals of Spec

There are three fundamental methods of Spec: initializeWidgets, defaultSpec and initializePresenter, which are each responsible for a different aspect of the user interface building process.

Layout Constructions

If your user interface has more than one widget, you will need to use one of these strategies. The book covers two broad layout strategies: row and column-based, and absolute and relative layouts (plus a combination).

Ideas

Managing Windows

Small but important details of the window, it's title, icon and about text.

Advanced Widgets

Some interface elements provide more advanced functionalities, like text input widgets, radio buttons and tabs, toolbars and pop-up menus

In some examples, author used dynamic spec, discussed in next chapter

Dynamic Spec

There are some cases where user interfaces need to be more dynamic.

Discussed dynamic features of spec like changing the layout and content on the fly, determining the UIs widget at opening time. Ended with allowing the complete construction of a UI in one big block of code.

Tips and tricks

Small interesting features that are useful for building user interfaces with Spec.

Integrating different UI frameworks

Lists, trees and tables

Using the underlying widget library

Testing the functionality of a Spec Ui

By programmatically simulating button clicks, without having to open the UI at all.

Best practice is to create an API for testing that exposes the internals that are required to be able to write UI tests.

Final thoughts

Question: Does user have to open Pharo, or be familiar with Pharo to use the programs that have been built in it? How can I set up a project on a non-tech person's computer?

Build a rover project that incorporates all of the widgets discussed in this book.

Let rover be moved with keyboard shortcuts

Rover choose your own adventure game, let him explore obects that are on the screen