Hi Pharoers, I'm a beginner with Pharo and try to dive into Morph. My question is trivial as I want to open a modal dialog to catch some text and save it in a file. I use the following code: dialog := TextEntryDialogWindow new. dialog openInWorld. dialog canceled ifFalse: [self createAndWrite: dialog entryText]. In Cincom Smalltalk, the same code opened a dialog modally , but here, not, as it seems suggested in the DialogWindow class comment. I don't know how to change this, I tried to include it as submorph in another morph, but it failed (still system modal). I also tried to tell currentWorld to set the ModalWindow to Dialog, without success. Any hint? Thank you Florent
You can do something like this: dialog := TextEntryDialogWindow new. World openModal: dialog. dialog cancelled ifFalse: [self createAndWrite: dialog entryText]. but I am not sure if this is the correct way to do it. -- Daniel Galdames El miércoles, 26 de septiembre de 2012 a las 15:58, Florent Arrignon escribió:
Hi Pharoers,
I'm a beginner with Pharo and try to dive into Morph. My question is trivial as I want to open a modal dialog to catch some text and save it in a file.
I use the following code: dialog := TextEntryDialogWindow new. dialog openInWorld. dialog canceled ifFalse: [self createAndWrite: dialog entryText].
In Cincom Smalltalk, the same code opened a dialog modally , but here, not, as it seems suggested in the DialogWindow class comment. I don't know how to change this, I tried to include it as submorph in another morph, but it failed (still system modal). I also tried to tell currentWorld to set the ModalWindow to Dialog, without success. Any hint?
Thank you
Florent
Thank you, it works well ! I had seen openModal: but did not know how to use it. Sven, thank you too. I had seen the UIManager>>request: but was afraid to have to subclass such a class when in need for a simple special dialog design. Florent Date: Wed, 26 Sep 2012 16:57:14 -0300 From: lemuus@gmail.com To: pharo-users@lists.gforge.inria.fr Subject: Re: [Pharo-users] modal dialog You can do something like this: dialog := TextEntryDialogWindow new.World openModal: dialog.dialog cancelled ifFalse: [self createAndWrite: dialog entryText]. but I am not sure if this is the correct way to do it.-- Daniel Galdames El miércoles, 26 de septiembre de 2012 a las 15:58, Florent Arrignon escribió: Hi Pharoers, I'm a beginner with Pharo and try to dive into Morph. My question is trivial as I want to open a modal dialog to catch some text and save it in a file. I use the following code: dialog := TextEntryDialogWindow new. dialog openInWorld. dialog canceled ifFalse: [self createAndWrite: dialog entryText]. In Cincom Smalltalk, the same code opened a dialog modally , but here, not, as it seems suggested in the DialogWindow class comment. I don't know how to change this, I tried to include it as submorph in another morph, but it failed (still system modal). I also tried to tell currentWorld to set the ModalWindow to Dialog, without success. Any hint? Thank you Florent
Florent We are not happy of the current design. UIManager allows us to control window request in headless mode. Now this is not really satisfactory. Facades are often bad smells to me. There is UITheme and others⦠and the responsibilities are unclear. Now you do not have to subclass you can extend it. Still I'm not happy about the overall design. For example, some logic of the debugger building should be located in the Debugger class and not in UIManager or whatever class. This is why we are working on Spec and its UIBuilder and we want to rewrite all the tools. But it takes time. We will get there after 20 is out probably. Stef
Thank you, it works well ! I had seen openModal: but did not know how to use it.
Sven, thank you too. I had seen the UIManager>>request: but was afraid to have to subclass such a class when in need for a simple special dialog design.
Florent
Date: Wed, 26 Sep 2012 16:57:14 -0300 From: lemuus@gmail.com To: pharo-users@lists.gforge.inria.fr Subject: Re: [Pharo-users] modal dialog
You can do something like this:
dialog := TextEntryDialogWindow new. World openModal: dialog. dialog cancelled ifFalse: [self createAndWrite: dialog entryText].
but I am not sure if this is the correct way to do it. -- Daniel Galdames
El miércoles, 26 de septiembre de 2012 a las 15:58, Florent Arrignon escribió: Hi Pharoers,
I'm a beginner with Pharo and try to dive into Morph. My question is trivial as I want to open a modal dialog to catch some text and save it in a file.
I use the following code: dialog := TextEntryDialogWindow new. dialog openInWorld. dialog canceled ifFalse: [self createAndWrite: dialog entryText].
In Cincom Smalltalk, the same code opened a dialog modally , but here, not, as it seems suggested in the DialogWindow class comment. I don't know how to change this, I tried to include it as submorph in another morph, but it failed (still system modal). I also tried to tell currentWorld to set the ModalWindow to Dialog, without success. Any hint?
Thank you
Florent
Hello Do you see Presenty? http://smalltalk-presenty.blogspot.com/ You can try it with prepared image at http://code.google.com/p/smalltalk-presenty In Presenty your example will look like: YourApplicationTask>>body some stuff... answer := user confirm: 'message'. ... And modal mode of confirmation dialog is just one specific setting of it activation which can be different for different parts of your application. Best regards, Denis 2012/9/27 Florent Arrignon <florent_arrignon@hotmail.fr>
Thank you, it works well ! I had seen openModal: but did not know how to use it.
Sven, thank you too. I had seen the UIManager>>request: but was afraid to have to subclass such a class when in need for a simple special dialog design.
Florent
------------------------------ Date: Wed, 26 Sep 2012 16:57:14 -0300 From: lemuus@gmail.com To: pharo-users@lists.gforge.inria.fr Subject: Re: [Pharo-users] modal dialog
You can do something like this:
dialog := TextEntryDialogWindow new. World openModal: dialog. dialog cancelled ifFalse: [self createAndWrite: dialog entryText].
but I am not sure if this is the correct way to do it. -- Daniel Galdames
El miércoles, 26 de septiembre de 2012 a las 15:58, Florent Arrignon escribió:
Hi Pharoers,
I'm a beginner with Pharo and try to dive into Morph. My question is trivial as I want to open a modal dialog to catch some text and save it in a file.
I use the following code: dialog := TextEntryDialogWindow new. dialog openInWorld. dialog canceled ifFalse: [self createAndWrite: dialog entryText].
In Cincom Smalltalk, the same code opened a dialog modally , but here, not, as it seems suggested in the DialogWindow class comment. I don't know how to change this, I tried to include it as submorph in another morph, but it failed (still system modal). I also tried to tell currentWorld to set the ModalWindow to Dialog, without success. Any hint?
Thank you
Florent
Hi Florent, On 26 Sep 2012, at 20:58, Florent Arrignon <florent_arrignon@hotmail.fr> wrote:
I'm a beginner with Pharo and try to dive into Morph. My question is trivial as I want to open a modal dialog to catch some text
Maybe this is not what you are looking for, but a very easy way is like this: UIManager default request: 'Enter some text'. Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
participants (5)
-
Daniel Galdames -
Denis Kudriashov -
Florent Arrignon -
Stéphane Ducasse -
Sven Van Caekenberghe