wiki:widgets

Widgets

Adds nice looking Morphic controls, e.g., lists, dropdown lists, push buttons, check boxes. It uses the signals mechanism for callbacks.

How to Install

Environment
4.3
4.1.1 (win)
r2559 or newer
Sources
ConfigurationOfWidgets
SwaUtilities
Widgets
WidgetTests? (optional)
WidgetTools? (optional)
Icons (optional)
Signals
Animations
VB-Regex
Misc
SwaUtilities@SqueakSource

Using Metacello, just run the following code in your workspace:

(Installer mc http: 'http://www.hpi.uni-potsdam.de/hirschfeld/squeaksource/')
   project: 'MetacelloRepository';
   install: 'ConfigurationOfWidgets'.
(Smalltalk at: #ConfigurationOfWidgets) load.

If you want to try the latest snapshot (may be unstable), run this:

ConfigurationOfWidgets loadSnapshot.

If you want to update to the latest development version, run this:

ConfigurationOfWidgets loadDevelopment.

Configuration groups

core ... just the widgets
tools ... widgets, useful example tools, icon sets
tests ... widgets and their tests
full ... everything above

Version 1.1 Highlights

  • useful basic controls (buttons, check boxes, lists, ...)
  • powerful item-view framework
  • extensible paint engine
  • 167 tests

How to Use

Explore all examples in the WidgetTools package to learn more about the item-view framework and how to connect widgets to user input. Try to design your graphical front-ends with the Morphic Designer to avoid writing verbose user interface code.

How to Extend

Most of the widgets are written from scratch. If you want to extend or add new ones, here are some hints:

  • layouting of morphs in combination with embedded text morphs can be problematic in the first place as the dimensions are not correct
    • see optimizations and fixes in UiComboBox
  • put all signals of a widget class into the signals protocol
  • for each signal, explain with a comment when it will generally be sent, e.g., "This signal is emitted whenever the user clicks with the left mouse button."
  • try to write as compact classes as possible, i.e., avoid having several classes for buttons, buttons with icons, buttons with icons and text, but write exactly one class and make these features configurable
  • consider the Morphic Designer and implement on the class-side of your widget class:
    • #isWidgetClass ... used by the designer as a widget
    • #widgetCategory ... as grouped in the designer's widget tree
    • #widgetProperties ... appended to the end of the designer's property table
    • #widgetPropertiesToIgnore ... hidden in the designer's property table
    • #widgetClassIcon ... icon in the designer's widget tree
    • #widgetClassName ... text in the designer's widget tree
Last modified 5 years ago Last modified on 08/21/2012 03:04:22 PM

Attachments (12)

Download all attachments as: .zip