Dialog>>showModal - no effect?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dialog>>showModal - no effect?

Günther Schmidt
Hi,

from my main application window I want to start a modal dialog.

So I do

MainAppShell>>editBook: aBook

|pres|

pres := BookEditorDialog on: aBook.

pres setBookLocationChoices: "someList".

pres showModal.


That doesn't open any windows.

What am I misunderstanding about Dialog instances >>showModal?

Günther


Reply | Threaded
Open this post in threaded view
|

Re: Dialog>>showModal - no effect?

Ian Bartholomew-21
Günther,

> What am I misunderstanding about Dialog instances >>showModal?

The ClassBrowser is your friend :-)  Use it to have a look at the Dialog
class>>showModalOn: method - the one you would be using if you didn't want
to dynamically change the #setBookLocationChoices: value.  You will find

showModalOn: aModel
 ^(self createOn: aModel) showModal

which immediately tells you what you have done wrong.  You need

pres := BookEditorDialog createOn: aBook.
pres setBookLocationChoices: "someList".
pres showModal.

--
Ian

Use the Reply-To address to contact me (limited validity).
Mail sent to the From address is ignored.