I've been trying for several days to get the Spec InputWidget to work as expected. I've been running the "example2" example. If you enter text in the input field and press the "enter" key, then the input text is returned. But, if you click the "Ok" button rather than "enter" key, then the input text field is empty. I've tried to dig into why, but I stymied. Can someone please help me with this? ----- Brad Selfridge -- View this message in context: http://forum.world.st/Spec-InputWidget-question-tp4914439.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
2016-09-06 23:14 GMT+02:00 Brad Selfridge <bsselfridge@gmail.com>:
I've been trying for several days to get the Spec InputWidget to work as expected. I've been running the "example2" example. If you enter text in the input field and press the "enter" key, then the input text is returned. But, if you click the "Ok" button rather than "enter" key, then the input text field is empty. I've tried to dig into why, but I stymied.
Can someone please help me with this?
Hi Brad, what pharo version ? For me, the example does not work at all (Pharo 5 and Pharo 6). Pressing OK, or pressing the Enter-Key shows a DNU "MessageNotUnderstood: PluggableTextFieldMorph>>acceptContents"
----- Brad Selfridge -- View this message in context: http://forum.world.st/Spec- InputWidget-question-tp4914439.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi Brad, the magic of the OK and Cancel buttons is due to the opening of the UI with openDialogWithSpec (instead of openWithSpec). There is info on that in the Spec documentation, in the âManaging Windowsâ chapter (which I finished last week :-) ). You can find a pdf of that chapter here: https://ci.inria.fr/pharo-contribution/view/Books/job/BuildingUIWithSpec/las... HTH -- Does this mail seem too brief? Sorry for that, I donât mean to be rude! Please see http://emailcharter.org . Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile
On Sep 6, 2016, at 18:14, Brad Selfridge <bsselfridge@gmail.com> wrote:
I've been trying for several days to get the Spec InputWidget to work as expected. I've been running the "example2" example. If you enter text in the input field and press the "enter" key, then the input text is returned. But, if you click the "Ok" button rather than "enter" key, then the input text field is empty. I've tried to dig into why, but I stymied.
Can someone please help me with this?
----- Brad Selfridge -- View this message in context: http://forum.world.st/Spec-InputWidget-question-tp4914439.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Read the chapter. Being new to Spec, I'm still confused because I don't see clear evidence in the chapter that would fix the problems that are occurring in the InputWidget. I did, however, read your documentation referring to the TextFieldInputModel example. After reading that, I created a TextPrompterWidget, (which is a direct copy of InputWidget). I changed the super class to DynamicComposableModel. I modified the "initializeWidgets" method, removed the "OK" method, and made a few other small modifications and got the widget to work as expected. I DID have to open the widget with "openDialogWithSpec" as that was the only way to auto-magically get the OK-Cancel toolbar widget. I'd share my code if you want. ----- Brad Selfridge -- View this message in context: http://forum.world.st/Spec-InputWidget-question-tp4914439p4914673.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Apologies for not being clear in my mail. The key is that the UI is being opened as a dialog box, generating the OK and Cancel buttons. All this logic is explained in the section "Opening a dialog box and its configuration optionsâ. This also talks about configuring what to do when these buttons are clicked. -- Does this mail seem too brief? Sorry for that, I donât mean to be rude! Please see http://emailcharter.org . Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile
On Sep 7, 2016, at 18:07, Brad Selfridge <bsselfridge@gmail.com> wrote:
Read the chapter. Being new to Spec, I'm still confused because I don't see clear evidence in the chapter that would fix the problems that are occurring in the InputWidget.
I did, however, read your documentation referring to the TextFieldInputModel example. After reading that, I created a TextPrompterWidget, (which is a direct copy of InputWidget). I changed the super class to DynamicComposableModel. I modified the "initializeWidgets" method, removed the "OK" method, and made a few other small modifications and got the widget to work as expected. I DID have to open the widget with "openDialogWithSpec" as that was the only way to auto-magically get the OK-Cancel toolbar widget. I'd share my code if you want.
----- Brad Selfridge -- View this message in context: http://forum.world.st/Spec-InputWidget-question-tp4914439p4914673.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (3)
-
Brad Selfridge -
Johan Fabry -
Nicolai Hess