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