smalltalk - How do I ask the user for a file name? -
searching call of filedialog
i ask user file name in pharo 4.0
through spotter found class
filedialogwindow
with method
answerfilename
looking senders of #answerfilename class
uitheme
where called in method
choosefilenamein: athemedmorph title: title extensions: exts path: path preview: preview
and there come class
teasilythemed
with method
choosefilename: title extensions: exts path: path preview: preview
from there class
widgetexamples class >> exampledialogs
and have call
widgetexamples examplebuilder choosefilename: 'pick file name' extensions: nil path: nil preview: nil.
however print it
of expression not give file name.
question
what regular way of calling file dialog?
supplementary question after answers
two classes mentioned providing service.
- uimanager
- uitheme
uimanager comment
uimanager dispatcher various ui requests.
uitheme comment
common superclass user interface themes. provides methods creating new morphs in standard way, various "services" file dialog, message dialogs etc. , methods customising aspects of appearance of various morphs. though conceptually abstract, no code "missing". subclasses, therefore, should override aspects wish change.
what difference between 2 approaches?
the easiest way use:
uimanager default choosefilematching: nil
you can specify patterns as:
uimanager default choosefilematching: #('*.jpg' '*.png')
you can specify label dialog:
uimanager default choosefilematching: #('*.jpg' '*.png') label: 'please select , image process'
Comments
Post a Comment