A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.1068.mcz
==================== Summary ====================
Name: Tools-ct.1068
Author: ct
Time: 1 November 2021, 7:01:28.288014 pm
UUID: f6d09127-a2e9-c34e-8573-bc2aa252cf00
Ancestors: Tools-eem.1065
Fixes CustomMenu >> #add:submenu:target:selector:argumentList: and updates example analogously to Morphic-ct.1791.
=============== Diff against Tools-eem.1065 ===============
Item was changed:
----- Method: CustomMenu class>>example (in category 'example') -----
example
"CustomMenu example"
| menu |
menu := CustomMenu new.
menu add: 'apples' action: #apples.
menu add: 'oranges' action: #oranges.
menu addLine.
menu addLine. "extra lines ignored"
menu add: 'peaches' action: #peaches.
menu addLine.
menu add: 'pears' action: #pears.
menu addLine.
+ menu add: 'test' subMenu: (CustomMenu new
+ add: 'foo' action: #inspect;
+ yourself) target: 42 selector: #inform: argumentList: #('hello').
+ ^ menu invokeOn: nil
+
- ^ menu startUp: #apples
-
-
"NB: The following is equivalent to the above, but uses the compact #fromArray: consruct:
(CustomMenu fromArray:
#( ('apples' apples)
('oranges' oranges)
-
-
('peaches' peaches)
-
('pears' pears)
-))
startUp: #apples"!
Item was changed:
----- Method: CustomMenu>>add:action: (in category 'construction') -----
add: aString action: actionItem
"Add the given string as the next menu item. If it is selected, the given action (usually but not necessarily a symbol) will be returned to the client."
| s |
aString ifNil: [^ self addLine].
s := String new: aString size + 2.
s at: 1 put: Character space.
s replaceFrom: 2 to: s size - 1 with: aString.
s at: s size put: Character space.
labels addLast: s.
+ targets addLast: nil.
+ arguments addLast: nil.
selections addLast: actionItem.!
Item was changed:
----- Method: CustomMenu>>add:subMenu:target:selector:argumentList: (in category 'compatibility') -----
add: aString subMenu: aMenu target: target selector: aSymbol argumentList: argList
"Create a sub-menu with the given label. This isn't really a sub-menu the way Morphic does it; it'll just pop up another menu."
self
add: aString
+ target: self
+ selector: #invokeSubmenu:target:selector:argumentList:
+ argumentList: {aMenu. target. aSymbol. argList asArray}.!
- target: aMenu
- selector: #invokeOn:
- argumentList: argList asArray.!
Item was changed:
----- Method: CustomMenu>>add:target:selector:argumentList: (in category 'compatibility') -----
add: aString target: target selector: aSymbol argumentList: argList
"Append a menu item with the given label. If the item is selected, it will send the given selector to the target object with the given arguments. If the selector takes one more argument than the number of arguments in the given list, then the triggering event is supplied as as the last argument."
self add: aString action: aSymbol.
+ targets atLast: 1 put: target.
+ arguments atLast: 1 put: argList asArray
- targets addLast: target.
- arguments addLast: argList asArray
!
Item was changed:
----- Method: CustomMenu>>invokeOn:orSendTo: (in category 'invocation') -----
invokeOn: targetObject orSendTo: anObject
"Pop up this menu and return the result of sending to the target object the selector corresponding to the menu item selected by the user. Return nil if no item is selected. If the chosen selector has arguments, obtain appropriately. If the recipient does not respond to the resulting message, send it to the alternate object provided"
| aSelector anIndex recipient |
^ (aSelector := self startUp) ifNotNil:
[anIndex := self selection.
+ recipient := nil.
+ ((targets := self targets) notNil and: [anIndex <= targets size])
+ ifTrue: [recipient := targets at: anIndex].
+ recipient
+ ifNil: [recipient := targetObject].
- recipient := ((targets := self targets) isEmptyOrNil or: [anIndex > targets size])
- ifTrue:
- [targetObject]
- ifFalse:
- [targets at: anIndex].
aSelector numArgs = 0
ifTrue:
[recipient perform: aSelector orSendTo: anObject]
ifFalse:
[recipient perform: aSelector withArguments: (self arguments at: anIndex)]]!
Item was added:
+ ----- Method: CustomMenu>>invokeSubmenu:target:selector:argumentList: (in category 'invocation') -----
+ invokeSubmenu: aMenu target: target selector: aSymbol argumentList: argList
+
+ target perform: aSymbol withArguments: argList.
+ ^ aMenu invokeOn: target!
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1791.mcz
==================== Summary ====================
Name: Morphic-ct.1791
Author: ct
Time: 1 November 2021, 6:59:37.506014 pm
UUID: c33323b2-7221-9d4f-b3af-d723dd256645
Ancestors: Morphic-eem.1784
Documentation: Adds example of #add:subMenu:target:selector:argumentList: to MenuMorph example.
=============== Diff against Morphic-eem.1784 ===============
Item was changed:
----- Method: MenuMorph class>>example (in category 'example') -----
example
"MenuMorph example popUpInWorld"
| menu |
menu := MenuMorph new.
menu addTitle: 'Fruit' translated.
menu addStayUpItem.
menu add: 'apples' action: #apples.
menu add: 'oranges' action: #oranges.
menu addLine.
menu addLine. "extra lines ignored"
menu add: 'peaches' action: #peaches.
menu addLine.
menu add: 'pears' action: #pears.
menu addLine.
+ menu add: 'test' subMenu: (MenuMorph new
+ defaultTarget: #peaches;
+ add: 'foo' action: #inspect;
+ yourself) target: 42 selector: #inform: argumentList: #('hello').
+ ^ menu!
- ^ menu
- !
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1790.mcz
==================== Summary ====================
Name: Morphic-ct.1790
Author: ct
Time: 1 November 2021, 6:18:39.271014 pm
UUID: d7f1d632-e952-e44a-a817-587501e5c542
Ancestors: Morphic-eem.1784
Proposal: Add syntax for submenus to MenuMorph >> #addList: by specifying a 1-ary selector. Also fixes typos in the comment.
=============== Diff against Morphic-eem.1784 ===============
Item was changed:
----- Method: MenuMorph>>addList: (in category 'construction') -----
addList: aList
+ "Add the given items to this menu, where each item is a pair (<string> <actionSelector | menuSelector:>). If an element of the list is simply the symbol #-, add a line to the receiver. The optional third element of each entry, if present, provides balloon help."
- "Add the given items to this menu, where each item is a pair (<string> <actionSelector>).. If an element of the list is simply the symobl $-, add a line to the receiver. The optional third element of each entry, if present, provides balloon help."
aList do: [:tuple |
(tuple == #-)
ifTrue: [self addLine]
ifFalse:
+ [tuple second isUnary
+ ifTrue: [self add: tuple first action: tuple second]
+ ifFalse:
+ [self addItem: [:item |
+ item
+ target: self defaultTarget;
+ contents: tuple first;
+ subMenuUpdater: [:menu |
+ menu defaultTarget: self defaultTarget.
+ self defaultTarget perform: tuple second with: menu]
+ selector: #value:]]].
- [self add: tuple first action: tuple second.
tuple size > 2 ifTrue:
+ [self balloonTextForLastItem: tuple third]].!
- [self balloonTextForLastItem: tuple third]]]!
Item was changed:
----- Method: MenuMorph>>addTranslatedList: (in category 'construction') -----
addTranslatedList: aList
+ "Add the given items to this menu, where each item is a pair (<string> <actionSelector | menuSelector:>). If an element of the list is simply the symbol #-, add a line to the receiver. The optional third element of each entry, if present, provides balloon help.
+ All strings will be translated."
- "Add the given items to this menu, where each item is a pair (<string> <actionSelector>).. If an element of the list is simply the symobl $-, add a line to the receiver. The optional third element of each entry, if present, provides balloon help.
- The first and third items will be translated."
+ ^ self addList: (aList collect: [:tuple |
+ tuple == #-
+ ifTrue: [tuple]
- aList do: [:tuple |
- (tuple == #-)
- ifTrue: [self addLine]
ifFalse:
+ [Array new: tuple size streamContents: [:stream |
+ stream nextPut: tuple first translated.
+ tuple size >= 2
+ ifTrue: [stream nextPut: tuple second].
+ tuple size >= 3
+ ifTrue:
+ [stream nextPut:
+ (tuple third isString
+ ifTrue: [tuple third translated]
+ ifFalse: [tuple third])]]]])!
- [self add: tuple first translated action: tuple second.
- tuple size > 2 ifTrue:
- [self balloonTextForLastItem: tuple third translated ]]]!
Hi all,
recently I have created a PR against the FileSystem repository under [1] that migrates the CI from Travis (not working any longer) to state-of-the-art GitHub Actions. Under the PR, Jakob and I had a discussion on who should receive notification emails about CI failures for this repo.
I first intention was only to add interested people to the mail job (that would be me, maybe Jakob, and everyone else who asks). However, we also enter the squeak-dev list there. Or even another mailing list. Do you have any opinions about this? If not, I will go with my initial proposal.
Best,
Christoph
[1] https://github.com/squeak-smalltalk/squeak-filesystem/pull/5
---
Sent from Squeak Inbox Talk
Hi everyone.
It's been quite a while since we've done any major work on Fuel, so we are very excited to announce version 4.0.0 of Fuel today!
Short-list of the most interesting things:
- builder API
- support for talents and anonymous classes
- support for FullBlockClosure
- full serialization support by default (no more need to load FuelMetalevel to serialize classes and methods)
- full serialization support for Squeak
The complete release notes are over on GitHub: https://theseion.github.io/Fuel/releases/4.0.0/.
We hope that you'll like what we've done and we're excited to see, what kind of magic you will do with it.
If you are using Fuel in a project, please let us know and we'll add it to the list of projects on GitHub (good for us and you ;)).
As always, please report any issues to https://github.com/theseion/Fuel/issues and we'll try to help you out.
Cheers,
Max (on behalf of the Fuel team)