Questions tagged [spec-ui]

Spec is a simple framework for describing user interfaces. It takes a model and a layout description, runs it through an interpreter and a UI is produced as a result.

Spec is a simple framework for describing user interfaces. It takes a model and a layout description, runs it through an interpreter and a UI is produced as a result.

All the widget implemented this can then immediately be reused as any other widget.

It also allows the separation of concerns between the different part of the user interface as expressed in the MVP pattern.

Spec emphasis the reuse of the widgets as well as there customisation.

More information available on the official website.

9 questions
4
votes
1 answer

How to close a window with Spec in Pharo

I have a Spec window with several controls. When I click on the Ok button I want the window to be closed. | m | m := DynamicComposableModel new. m instantiateModels: #(text TextModel ok OkToolbar). m ok okAction: [ self close ]. m…
user869097
  • 1,362
  • 8
  • 16
3
votes
1 answer

Add menu to ListModel

How can I add a menu to a list model with decent actions? I've seen some code like: list menu: [ :menu | menu add: 'Name' action: [ "some action" ]. but when I do this I get an error because the block is not evaluated but sent as a…
Uko
  • 13,134
  • 6
  • 58
  • 106
3
votes
1 answer

Opening menu in a MultiColumnList in Spec gives MNU

In Pharo 3 right-clicking in a menu using a MultiColumnListModel gives a MessageNotUnderstood, as shown in this example code: | specModel list itemMenu group1 item1 | itemMenu := MenuModel new. item1 := MenuItemModel new name: 'Browse'; …
user869097
  • 1,362
  • 8
  • 16
3
votes
1 answer

Adding a row in Spec results in a column?

The current API of Spec is totally counter-intuitive. I am trying to stack up two rows in a SpecLayout. How is that adding a row ends up with two columns? | m | m := DynamicComposableModel new. m instantiateModels: #(text1 TextModel ok OkToolbar). m…
user869097
  • 1,362
  • 8
  • 16
2
votes
2 answers

openWorldWithSpec making it impossible to return to previous windows

Reading the book "The Spec UI framework". Trying to implement the part described in chapter "Taking over the entire screen". After executing the code suggested in the book: WindowExample new openWorldWithSpec it seems to be impossible to return to…
Anton
  • 103
  • 4
2
votes
2 answers

Change list background color in Pharo with Spec

Is this supposed to change a list background color to red in Pharo? ListModel new items: (1 to: 10); color: Color red; openWithSpec. Because it's always white no matter what, nothing happens.
user869097
  • 1,362
  • 8
  • 16
0
votes
1 answer

Disable editing of TextModel

Can I disable editing of Spec TextModel and use it only for display purposes. Tried sending it disable, no noticeable results
Uko
  • 13,134
  • 6
  • 58
  • 106
0
votes
3 answers

Easy way to display alert

Is it possible to display an alert for user in an easy way? Something like: save title ifEmpty: [ 'Title cannot be empty' alert ] ifNotEmpty: [ "…do the saving…" ] so that if title ivar will be empty user will see the dialog with…
Uko
  • 13,134
  • 6
  • 58
  • 106
0
votes
1 answer

Adding a header to MultiColumnListModel

I am working with Spec library in Pharo 3 and I have found no way to add a header to a multi column list. However, adding headers is feasible through TreeColumnModel and TreeModel like this: | m col1 col2 | m := TreeModel new. m roots: #(#a #b #c…
user869097
  • 1,362
  • 8
  • 16