Skip to content

Instantly share code, notes, and snippets.

@peteruhnak
Created September 14, 2016 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peteruhnak/8ac6667b8eb11daee71517d0172b7355 to your computer and use it in GitHub Desktop.
Save peteruhnak/8ac6667b8eb11daee71517d0172b7355 to your computer and use it in GitHub Desktop.
Pharo UIManager API notes
abort:
abort:title:
alert:
alert:title:
confirm:
confirm:label:
* label is actually a title, returns true/false
confirm:orCancel:
* the same, except returns the result of cancelBlock
confirm:trueChoice:falseChoice:
* customizing labels of true/false
deny:title:
inform:
proceed:
proceed:title:
* same as confirm: except has Ok/Cancel instead of Yes/No
question:
question:title:
* Yes/No/Cancel
questionWithoutCancel:
questionWithoutCancel:title:
* Yes/No; same as confirm:
request:
request:entryCompletion:
request:initialAnswer:
request:initialAnswer:entryCompletion:
request:initialAnswer:title:
request:initialAnswer:title:entryCompletion:
* request a string from the user
request:regex:
* the fuck?
requestPassword:
* password input
textEntry:
textEntry:title:
textEntry:title:entryText:

#abort:, #abort:title:

#chooseDirectory

FileReference of the selected folder, or nil if canceled.

#chooseDirectory: label

Custom label of the window

##chooseDirectory: label from: dir, #chooseDirectoryFrom: dir

dir is the directory opened by default (the default default is the image location)

##chooseFileMatching: patterns, #chooseFileMatching:label:

patterns is a collection of patterns

UIManager default chooseFileMatching: #('*.ston', '*.image')
UIManager default chooseFileMatching: nil

Returns a String containing the basename of the file.

chooseFrom:
chooseFrom:lines:
chooseFrom:lines:message:
chooseFrom:lines:message:title:
chooseFrom:lines:title:
chooseFrom:message:
chooseFrom:message:title:
chooseFrom:title:
UIManager default
	chooseFrom: #(a b c d e f g h i j)
	lines: #(1 5)
	message: 'custom message'
	title: 'custom title'

Returns the index of the selected chooseFrom: item, or 0 if canceled.

chooseFrom:values:
chooseFrom:values:lines:
chooseFrom:values:lines:message:
chooseFrom:values:lines:message:title:
chooseFrom:values:lines:title:
chooseFrom:values:message:
chooseFrom:values:message:title:
chooseFrom:values:title:
UIManager default
	chooseFrom: #(aa bb cc dd ee ff gg hh ii jj)
	values: #(a b c d e f g h i j)
	lines: #(1 5)
	message: 'message'
	title: 'title'

Returns the corresponding values item of the selected chooseFrom item, or nil if canceled. The size of values and chooseFrom must match.

chooseFullFileNameMatching:
chooseFullFileNameMatching:label:

Returns the full path of the selected file.

#displayProgress:from:to:during:

Eh? Maybe use Job directly?

edit:
edit:label:

completely useless

edit:label:accept:

Edit a text and specify a block that will be executed when the text is saved.

TEasilyThemed

Naming ¯_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment