I have a weird behavior building an interface with Spec.
I have a window built with Spec, and I want to add a button that shows a dialog with some text. To display the dialog I use the following line: UIManager default longMessage: 'a text message' title: 'some title'. And I hooked this code to a widget through the #action: method. The problem is: If I use a ButtonModel, the code behaves correctly showing the dialog. If I use an instance of the class ImageModel to display an icon, the dialog is displayed but the interface "hangs", in the sense that the "ok" button won't close the dialog and every click would spawn a new dialog. I would like to use an icon because it integrates better with the interface. Do you know if it is a bug or if I am doing something wrong? Thanks, Tommaso P.s.: Steps to reproduce If you need a working example you can inspect the code on the bleeding edge version of ShoreLine Reporter by following these instructions: 1. download a recent Pharo 4 image; 2. open a workspace and run: ConfigurationOfShoreLineReporter loadBleedingEdge 3. trigger an exception (for example by running 3/0 in a workspace). 4. click 'Report' 5. click the '?' button on the right side of the window. |
2014-12-14 20:26 GMT+01:00 Tommaso Dal Sasso <[hidden email]>: I have a weird behavior building an interface with Spec. This is a known problem, if a modal dialog is opened from a "mouse clicked" event. |
In reply to this post by Tommaso DS
As soon as you scroll the list then the ok button works. This is strange.
Did you check a bit the code of ImageModel? Stef Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : > ConfigurationOfShoreLineReporter loadBleedingEdge |
In reply to this post by Tommaso DS
I'm trying to understand, could you see if you can reproduce the problem
with just the LongMessageDialog? Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : > I have a weird behavior building an interface with Spec. > > I have a window built with Spec, and I want to add a button that shows > a dialog with some text. > To display the dialog I use the following line: > > UIManager default longMessage: 'a text message' title: 'some title'. > > And I hooked this code to a widget through the #action: method. > The problem is: If I use a ButtonModel, the code behaves correctly > showing the dialog. > If I use an instance of the class ImageModel to display an icon, the > dialog is displayed but the interface "hangs", in the sense that the > "ok" button won't close the dialog and every click would spawn a new > dialog. > > I would like to use an icon because it integrates better with the > interface. > Do you know if it is a bug or if I am doing something wrong? > > Thanks, > Tommaso > > > P.s.: Steps to reproduce > > If you need a working example you can inspect the code on the bleeding > edge version of ShoreLine Reporter by following these instructions: > 1. download a recent Pharo 4 image; > 2. open a workspace and run: ConfigurationOfShoreLineReporter > loadBleedingEdge > 3. trigger an exception (for example by running 3/0 in a workspace). > 4. click 'Report' > 5. click the '?' button on the right side of the window. > > > |
In reply to this post by Tommaso DS
I tried to reproduce the problem by invoking directly the longMessage:
with a really long text but it did not work. I will try to find where you invoke the code. Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : > I have a weird behavior building an interface with Spec. > > I have a window built with Spec, and I want to add a button that shows > a dialog with some text. > To display the dialog I use the following line: > > UIManager default longMessage: 'a text message' title: 'some title'. > > And I hooked this code to a widget through the #action: method. > The problem is: If I use a ButtonModel, the code behaves correctly > showing the dialog. > If I use an instance of the class ImageModel to display an icon, the > dialog is displayed but the interface "hangs", in the sense that the > "ok" button won't close the dialog and every click would spawn a new > dialog. > > I would like to use an icon because it integrates better with the > interface. > Do you know if it is a bug or if I am doing something wrong? > > Thanks, > Tommaso > > > P.s.: Steps to reproduce > > If you need a working example you can inspect the code on the bleeding > edge version of ShoreLine Reporter by following these instructions: > 1. download a recent Pharo 4 image; > 2. open a workspace and run: ConfigurationOfShoreLineReporter > loadBleedingEdge > 3. trigger an exception (for example by running 3/0 in a workspace). > 4. click 'Report' > 5. click the '?' button on the right side of the window. > > > |
In reply to this post by Tommaso DS
I got the same problem when I put an Halt pressing on any button leads
to the opening of the same UI. I wonder if there is not an interaction between spec and the UI modal opening. I read the code of ImageModel and I did not find anything special. Stef. Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : > I have a weird behavior building an interface with Spec. > > I have a window built with Spec, and I want to add a button that shows > a dialog with some text. > To display the dialog I use the following line: > > UIManager default longMessage: 'a text message' title: 'some title'. > > And I hooked this code to a widget through the #action: method. > The problem is: If I use a ButtonModel, the code behaves correctly > showing the dialog. > If I use an instance of the class ImageModel to display an icon, the > dialog is displayed but the interface "hangs", in the sense that the > "ok" button won't close the dialog and every click would spawn a new > dialog. > > I would like to use an icon because it integrates better with the > interface. > Do you know if it is a bug or if I am doing something wrong? > > Thanks, > Tommaso > > > P.s.: Steps to reproduce > > If you need a working example you can inspect the code on the bleeding > edge version of ShoreLine Reporter by following these instructions: > 1. download a recent Pharo 4 image; > 2. open a workspace and run: ConfigurationOfShoreLineReporter > loadBleedingEdge > 3. trigger an exception (for example by running 3/0 in a workspace). > 4. click 'Report' > 5. click the '?' button on the right side of the window. > > > |
On 14/12/14 21:44, stepharo wrote: > I got the same problem when I put an Halt pressing on any button leads > to the opening of the same UI. > I wonder if there is not an interaction between spec and the UI modal > opening. > I read the code of ImageModel and I did not find anything special. > Yes, I thought as well that could be something regarding modal UI, but I have so little knowledge of Spec and the way it interacts with Morphic that I could not tell more. OK, it works correctly if I put the dialog code inside a block and i fork it, so probably the modal window blocks the way the action of the icon is triggered. I'll try to investigate more. Thanks for the feedback, Tommaso > Stef. > Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : >> I have a weird behavior building an interface with Spec. >> >> I have a window built with Spec, and I want to add a button that >> shows a dialog with some text. >> To display the dialog I use the following line: >> >> UIManager default longMessage: 'a text message' title: 'some title'. >> >> And I hooked this code to a widget through the #action: method. >> The problem is: If I use a ButtonModel, the code behaves correctly >> showing the dialog. >> If I use an instance of the class ImageModel to display an icon, the >> dialog is displayed but the interface "hangs", in the sense that the >> "ok" button won't close the dialog and every click would spawn a new >> dialog. >> >> I would like to use an icon because it integrates better with the >> interface. >> Do you know if it is a bug or if I am doing something wrong? >> >> Thanks, >> Tommaso >> >> >> P.s.: Steps to reproduce >> >> If you need a working example you can inspect the code on the >> bleeding edge version of ShoreLine Reporter by following these >> instructions: >> 1. download a recent Pharo 4 image; >> 2. open a workspace and run: ConfigurationOfShoreLineReporter >> loadBleedingEdge >> 3. trigger an exception (for example by running 3/0 in a workspace). >> 4. click 'Report' >> 5. click the '?' button on the right side of the window. >> >> >> > > |
2014-12-14 22:14 GMT+01:00 Tommaso Dal Sasso <[hidden email]>:
No, it is not related to spec, just the way the imagemodel adapter uses morphics click event for the action dispatching. You can simulate the same (buggy) behavior on pure morphic: |m| m:= Morph new. m on:#click send:#value to:[m confirm:'Really?']. m openInWorld. MouseClickEvent processing and modal dialogs don't work.
|
On 14/12/14 22:59, Nicolai Hess wrote: > 2014-12-14 22:14 GMT+01:00 Tommaso Dal Sasso > <[hidden email] <mailto:[hidden email]>>: > > > On 14/12/14 21:44, stepharo wrote: > > I got the same problem when I put an Halt pressing on any > button leads to the opening of the same UI. > I wonder if there is not an interaction between spec and the > UI modal opening. > I read the code of ImageModel and I did not find anything special. > > Yes, I thought as well that could be something regarding modal UI, > but I have so little knowledge of Spec and the way it interacts > with Morphic that I could not tell more. > OK, it works correctly if I put the dialog code inside a block and > i fork it, so probably the modal window blocks the way the action > of the icon is triggered. > > > > No, it is not related to spec, just the way the imagemodel adapter > uses morphics click event for the action dispatching. > You can simulate the same (buggy) behavior on pure morphic: > > |m| > m:= Morph new. > m on:#click send:#value to:[m confirm:'Really?']. > m openInWorld. > > > MouseClickEvent processing and modal dialogs don't work. > your clarification. So, is it a bug or it just works that way and it is supposed to do so by architectural design? The interesting thing is that with a button it works. Tommaso > > > > I'll try to investigate more. > Thanks for the feedback, > > Tommaso > > > Stef. > Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : > > I have a weird behavior building an interface with Spec. > > I have a window built with Spec, and I want to add a > button that shows a dialog with some text. > To display the dialog I use the following line: > > UIManager default longMessage: 'a text message' title: > 'some title'. > > And I hooked this code to a widget through the #action: > method. > The problem is: If I use a ButtonModel, the code behaves > correctly showing the dialog. > If I use an instance of the class ImageModel to display an > icon, the dialog is displayed but the interface "hangs", > in the sense that the "ok" button won't close the dialog > and every click would spawn a new dialog. > > I would like to use an icon because it integrates better > with the interface. > Do you know if it is a bug or if I am doing something wrong? > > Thanks, > Tommaso > > > P.s.: Steps to reproduce > > If you need a working example you can inspect the code on > the bleeding edge version of ShoreLine Reporter by > following these instructions: > 1. download a recent Pharo 4 image; > 2. open a workspace and run: > ConfigurationOfShoreLineReporter loadBleedingEdge > 3. trigger an exception (for example by running 3/0 in a > workspace). > 4. click 'Report' > 5. click the '?' button on the right side of the window. > > > > > > > |
2014-12-14 23:52 GMT+01:00 Tommaso Dal Sasso <[hidden email]>:
I think it is a bug on morphics mouse click handling. The UI-element for a ButtonModel is a PluggableButtonMorph, it already has support for handling "clicks", but it only acts on mouse up /(or mouse down) An ImageMorph don't have this by default, so the ImageModel adapter installs a eventhandler with on:event do:action and the creator of Spec choosed #mouseUp for the mouse event to act on. Nicolai
|
In reply to this post by Tommaso DS
> Sorry, I wrote it badly. Of course it is an issue of Morphic, thanks
> for your clarification. > So, is it a bug or it just works that way and it is supposed to do so > by architectural design? this is a bug. And we should open a bug entry about it. > > The interesting thing is that with a button it works. > > Tommaso > >> >> >> >> I'll try to investigate more. >> Thanks for the feedback, >> >> Tommaso >> >> >> Stef. >> Le 14/12/14 20:26, Tommaso Dal Sasso a écrit : >> >> I have a weird behavior building an interface with Spec. >> >> I have a window built with Spec, and I want to add a >> button that shows a dialog with some text. >> To display the dialog I use the following line: >> >> UIManager default longMessage: 'a text message' title: >> 'some title'. >> >> And I hooked this code to a widget through the #action: >> method. >> The problem is: If I use a ButtonModel, the code behaves >> correctly showing the dialog. >> If I use an instance of the class ImageModel to display an >> icon, the dialog is displayed but the interface "hangs", >> in the sense that the "ok" button won't close the dialog >> and every click would spawn a new dialog. >> >> I would like to use an icon because it integrates better >> with the interface. >> Do you know if it is a bug or if I am doing something wrong? >> >> Thanks, >> Tommaso >> >> >> P.s.: Steps to reproduce >> >> If you need a working example you can inspect the code on >> the bleeding edge version of ShoreLine Reporter by >> following these instructions: >> 1. download a recent Pharo 4 image; >> 2. open a workspace and run: >> ConfigurationOfShoreLineReporter loadBleedingEdge >> 3. trigger an exception (for example by running 3/0 in a >> workspace). >> 4. click 'Report' >> 5. click the '?' button on the right side of the window. >> >> >> >> >> >> >> > > > |
On 15/12/14 22:02, stepharo wrote: >> Sorry, I wrote it badly. Of course it is an issue of Morphic, thanks >> for your clarification. >> So, is it a bug or it just works that way and it is supposed to do so >> by architectural design? > > this is a bug. > And we should open a bug entry about it. I opened a bug report at https://pharo.fogbugz.com/f/cases/14629/Morphic-click-event-and-modal-windows-get-stuck Tommaso |
Free forum by Nabble | Edit this page |