[Pharo-project] Is there a simple example of how to create a GUI form in Pharo or Squeak?
Is there a simple example of how to create a GUI form in Pharo or Squeak? I want to accomplish a simple task with a form: 1. Create a form with a button and edit control and 2 text areas. 2. Enter a value into the edit control. 3. Run a database query using the value in the edit control as a parameter and return the results in text area 1 4. Run a shell script using the value in the edit control as a parameter and return the results in text area 2 I have OpenDBX running successfully and I don't think using OSProcess and CommandShell will be that difficult. Creating the form is the part I don't know how to accomplish. I have done some searching and there seems to be a surprising dearth of info on how to create a simple GUI from scratch using Pharo or Squeak. -- Frank Church ======================= http://devblog.brahmancreations.com
First, pharo-users is a better forum for such questions. That said, I recently used Polymorph for the first time. I found Laurent Laffont's Pharocast [2] a good tutorial. [1] http://lists.gforge.inria.fr/mailman/listinfo/pharo-users [2] http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html Frank Church wrote:
Is there a simple example of how to create a GUI form in Pharo or Squeak?
I want to accomplish a simple task with a form:
1. Create a form with a button and edit control and 2 text areas.
2. Enter a value into the edit control.
3. Run a database query using the value in the edit control as a parameter and return the results in text area 1
4. Run a shell script using the value in the edit control as a parameter and return the results in text area 2
I have OpenDBX running successfully and I don't think using OSProcess and CommandShell will be that difficult.
Creating the form is the part I don't know how to accomplish.
I have done some searching and there seems to be a surprising dearth of info on how to create a simple GUI from scratch using Pharo or Squeak.
On 26 December 2012 01:13, Ben Coman <btc@openinworld.com> wrote:
First, pharo-users is a better forum for such questions. That said, I recently used Polymorph for the first time. I found Laurent Laffont's Pharocast [2] a good tutorial.
[1] http://lists.gforge.inria.fr/**mailman/listinfo/pharo-users<http://lists.gforge.inria.fr/mailman/listinfo/pharo-users> [2] http://www.pharocasts.com/**2011/02/pharo-gui-with-**polymorph.html<http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html>
Frank Church wrote:
Is there a simple example of how to create a GUI form in Pharo or Squeak?
I want to accomplish a simple task with a form:
1. Create a form with a button and edit control and 2 text areas.
2. Enter a value into the edit control.
3. Run a database query using the value in the edit control as a parameter and return the results in text area 1
4. Run a shell script using the value in the edit control as a parameter and return the results in text area 2
I have OpenDBX running successfully and I don't think using OSProcess and CommandShell will be that difficult.
Creating the form is the part I don't know how to accomplish.
I have done some searching and there seems to be a surprising dearth of info on how to create a simple GUI from scratch using Pharo or Squeak.
I realized I had posted to the wrong mailing llist. Anyway I am working my way through the PBE book and I will get there soon enough. -- Frank Church ======================= http://devblog.brahmancreations.com
Frank there is no problem. Welcome. I can tell you that I'm not satisfied with the way we build interfaces. We are working on it but as usual it takes time and effort. Do not hesitate to ask questions. We are really trying hard to improve. Stef
On 26 December 2012 01:13, Ben Coman <btc@openinworld.com> wrote: First, pharo-users is a better forum for such questions. That said, I recently used Polymorph for the first time. I found Laurent Laffont's Pharocast [2] a good tutorial.
[1] http://lists.gforge.inria.fr/mailman/listinfo/pharo-users [2] http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html
Frank Church wrote: Is there a simple example of how to create a GUI form in Pharo or Squeak?
I want to accomplish a simple task with a form:
1. Create a form with a button and edit control and 2 text areas.
2. Enter a value into the edit control.
3. Run a database query using the value in the edit control as a parameter and return the results in text area 1
4. Run a shell script using the value in the edit control as a parameter and return the results in text area 2
I have OpenDBX running successfully and I don't think using OSProcess and CommandShell will be that difficult.
Creating the form is the part I don't know how to accomplish.
I have done some searching and there seems to be a surprising dearth of info on how to create a simple GUI from scratch using Pharo or Squeak.
I realized I had posted to the wrong mailing llist. Anyway I am working my way through the PBE book and I will get there soon enough.
-- Frank Church
======================= http://devblog.brahmancreations.com
Hi Frank,
I want to accomplish a simple task with a form:
1. Create a form with a button and edit control and 2 text areas.
2. Enter a value into the edit control.
3. Run a database query using the value in the edit control as a parameter and return the results in text area 1
4. Run a shell script using the value in the edit control as a parameter and return the results in text area 2
I have OpenDBX running successfully and I don't think using OSProcess and CommandShell will be that difficult.
Indeed, you could use OSProcess command: 'your-script.sh arg1 arg2', but there may be some added complexity if you need to block and/or extract output.
Creating the form is the part I don't know how to accomplish.
I have done some searching and there seems to be a surprising dearth of info on how to create a simple GUI from scratch using Pharo or Squeak.
Since you said Squeak too I'll just mention: If you would first create a class to encapsulate the functionality you want: say, "FranksDualQuery" that would have an instvar 'input' (with getter/setter accessors), along with two additional methods for your db-query and shell-script (which each consume the 'input'), then you could use Maui to create your form in about 30 seconds. Maui can be installed straight from the SqueakMap catalog. Then execute: FranksDualQuery new maui and a blank form panel appears. Just drag the #input getter from the code-browser into this blank form panel. Then select "tools | be a getter/setter" so its "text-area" will be editable. Then drag the other two messages to the panel to complete the form. Done. I love naked-objects because it integrates "development" and "consumption" in a way that has helped me understand and appreciate Smalltalk as a live computing environment and not just an app-studio. Here's a video overview in case you're interested. http://www.youtube.com/watch?v=kUdu8ImXJwU
-- Frank Church
======================= http://devblog.brahmancreations.com
This is exactly the kind of stuff that has brought me to smalltalk. Visual coding in all its glory. Thanks for sharing this. ________________________________ From: Chris Muller <asqueaker@gmail.com> To: Pharo-project@lists.gforge.inria.fr Sent: Friday, 28 December 2012, 1:52 Subject: Re: [Pharo-project] Is there a simple example of how to create a GUI form in Pharo or Squeak? Hi Frank,
I want to accomplish a simple task with a form:
1. Create a form with a button and edit control and 2 text areas.
2. Enter a value into the edit control.
3. Run a database query using the value in the edit control as a parameter and return the results in text area 1
4. Run a shell script using the value in the edit control as a parameter and return the results in text area 2
I have OpenDBX running successfully and I don't think using OSProcess and CommandShell will be that difficult.
Indeed, you could use OSProcess command: 'your-script.sh arg1 arg2', but there may be some added complexity if you need to block and/or extract output.
Creating the form is the part I don't know how to accomplish.
I have done some searching and there seems to be a surprising dearth of info on how to create a simple GUI from scratch using Pharo or Squeak.
Since you said Squeak too I'll just mention: If you would first create a class to encapsulate the functionality you want: say, "FranksDualQuery" that would have an instvar 'input' (with getter/setter accessors), along with two additional methods for your db-query and shell-script (which each consume the 'input'), then you could use Maui to create your form in about 30 seconds. Maui can be installed straight from the SqueakMap catalog. Then execute:  FranksDualQuery new maui and a blank form panel appears. Just drag the #input getter from the code-browser into this blank form panel. Then select "tools | be a getter/setter" so its "text-area" will be editable. Then drag the other two messages to the panel to complete the form. Done. I love naked-objects because it integrates "development" and "consumption" in a way that has helped me understand and appreciate Smalltalk as a live computing environment and not just an app-studio. Here's a video overview in case you're interested.  http://www.youtube.com/watch?v=kUdu8ImXJwU
-- Frank Church
======================= http://devblog.brahmancreations.com
participants (5)
-
Ben Coman -
Chris Muller -
dimitris chloupis -
Frank Church -
Stéphane Ducasse