Writing a GUI - Where to start?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Stephan Eggermont-3
Johan wrote:
>I recommend you to go with Spec. It is the newest and designed to be the most capable. It is also the way forward, it will be the 'standard' GUI builders >in the future. We know that the documentation right now is far from optimal. Ben and I will work on that in January.

I’d recommend to try to build your application with Glamour first. Only if that doesn’t provide a good fit,
take a look at spec. Spec is much more powerful, but too low level for most applications.

Stephan





Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Picci Pharo
About Glamour, isn'it used to create Browser? How can i create a typical window?

> From: [hidden email]

> Date: Fri, 22 Nov 2013 12:39:06 +0100
> To: [hidden email]
> Subject: Re: [Pharo-users] Writing a GUI - Where to start?
>
> Johan wrote:
> >I recommend you to go with Spec. It is the newest and designed to be the most capable. It is also the way forward, it will be the 'standard' GUI builders >in the future. We know that the documentation right now is far from optimal. Ben and I will work on that in January.
>
> I’d recommend to try to build your application with Glamour first. Only if that doesn’t provide a good fit,
> take a look at spec. Spec is much more powerful, but too low level for most applications.
>
> Stephan
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Stephan Eggermont-3
In reply to this post by bahman
>About Glamour, isn'it used to create Browser? How can i create a typical window?

What is a typical window? Spec gives too much freedom and not enough
structure for 'typical’ applications.

Almost every window in your smalltalk system is a browser.
Nearly all would be significantly less code when build with Glamour.

Stephan
Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

jfabry

On Nov 22, 2013, at 12:35 PM, Stephan Eggermont <[hidden email]> wrote:

>> About Glamour, isn'it used to create Browser? How can i create a typical window?
>
> What is a typical window? Spec gives too much freedom and not enough
> structure for 'typical’ applications.
>
> Almost every window in your smalltalk system is a browser.
> Nearly all would be significantly less code when build with Glamour.


I agree with Stephan that it is less code to write a browser-like user interface with Glamour. That is the advantage of using a domain-specific solution, like Glamour. However if you are writing something that falls outside of the domain, i.e. a user interface that is not a browser, it will become difficult with Glamour.

So I also agree that the question is: what do you mean with 'a typical window'? What is it that your UI should do ?

---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Picci Pharo
In reply to this post by Stephan Eggermont-3
Typical Window := Window with buttons and textInput....

> From: [hidden email]

> Date: Fri, 22 Nov 2013 16:35:09 +0100
> To: [hidden email]
> Subject: Re: [Pharo-users] Writing a GUI - Where to start?
>
> >About Glamour, isn'it used to create Browser? How can i create a typical window?
>
> What is a typical window? Spec gives too much freedom and not enough
> structure for 'typical’ applications.
>
> Almost every window in your smalltalk system is a browser.
> Nearly all would be significantly less code when build with Glamour.
>
> Stephan
Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Benjamin Van Ryseghem (Pharo)
In reply to this post by Picci Pharo
The problem is here

rowPlayer 
add: (textPlayer at:i) ;
                         add:#captainButton;
add: (buttonStartingEleven at:i). 
].

As you see, the argument of add: is a symbol,
but in the first and third add, you add directly a 
TextInputFieldModel

In addition your usage of class inst var is a bit disturbing :)

Ben

On 22 Nov 2013, at 11:08, prova email <[hidden email]> wrote:

Hi Ben,
here the .st file, there are some comments in italian, i hope it's not a problem. 
I know that Spec is the most used and it will be the standard GUI builders in the future, so i'd like to find a solution here, without changing to Morph and Polymorphic.

Paolo


From: [hidden email]
Date: Fri, 22 Nov 2013 11:04:53 +0100
To: [hidden email]
Subject: Re: [Pharo-users] Writing a GUI - Where to start?

It seems that you return the wrong object somewhere :)

Could you commit your code somewhere so I can have a look ?


Ben

On 22 Nov 2013, at 11:01, prova email <[hidden email]> wrote:

I started to use Spec, i love nested layouts and so on. But i've got a little problem. I'm creating a Window with 14 TextInputFieldModel and 14 ButtonModel and, to avoid the definition of 28 different instance variables (obviously), i created two arrays which contain the ButtonModel and the TextInputFieldModel that i need. 

 ^ SpecLayout composed
       
            newColumn: [ :columnTeam | 
1 to: 14 do:[:i|
columnTeam 
                 newRow: [ :rowPlayer |
                     rowPlayer 
add: (textPlayer at:i) ;
                         add:#captainButton;
add: (buttonStartingEleven at:i). 
].

.....

This is what i did in the defaultSpec of my Player class. captainButton is a RadioButton defined in self instantiateModels: in initializeWidgets, while textPlayer and buttonStartingEleven are the arrays of above.
Theoretically the idea is great, while in practice it doesn't work. It give me the following message: 
TextInputFieldModel>>layoutFrame:

Help me please!

Paolo


> From: [hidden email]

> Date: Wed, 20 Nov 2013 14:38:58 -0300
> To: [hidden email]
> Subject: Re: [Pharo-users] Writing a GUI - Where to start?
> 
> 
> I recommend you to go with Spec. It is the newest and designed to be the most capable. It is also the way forward, it will be the 'standard' GUI builders in the future. We know that the documentation right now is far from optimal. Ben and I will work on that in January. 
> 
> On Nov 20, 2013, at 1:30 PM, Mun Mun <[hidden email]> wrote:
> 
> > Hi everyone,
> > 
> > Nobody mentioned Polymorphic. My understanding is that both Spec and Polymorph are built on top of Morphic. I only looked at code example and brief tutorial for both of them, but it seemed to me that Polymorph was easier to grasp: it's quite obivous in the code where and how the widgets are built. I have trouble understanding how the job is done in Spec. On the other hand, Spec seems to have a lot of users in this mailling list.
> > 
> > To sum up this thread with many different options proposed, what would be the right path for a newbie like me ?
> > 
> > Thanks in advance !
> > 
> 
> 
> 
> ---> Save our in-boxes! http://emailcharter.org <---
> 
> Johan Fabry - http://pleiad.cl/~jfabry
> PLEIAD lab - Computer Science Department (DCC) - University of Chile
> 
>
<PBE-SquadraPROVA.st>

Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Benjamin Van Ryseghem (Pharo)
In reply to this post by Picci Pharo
Here is a working version based on DynamicComposableModel (a subclass dedicated to the cases
where you have a lot, or an undefined number of sub widgets)




Ben

On 22 Nov 2013, at 11:08, prova email <[hidden email]> wrote:

Hi Ben,
here the .st file, there are some comments in italian, i hope it's not a problem. 
I know that Spec is the most used and it will be the standard GUI builders in the future, so i'd like to find a solution here, without changing to Morph and Polymorphic.

Paolo


From: [hidden email]
Date: Fri, 22 Nov 2013 11:04:53 +0100
To: [hidden email]
Subject: Re: [Pharo-users] Writing a GUI - Where to start?

It seems that you return the wrong object somewhere :)

Could you commit your code somewhere so I can have a look ?


Ben

On 22 Nov 2013, at 11:01, prova email <[hidden email]> wrote:

I started to use Spec, i love nested layouts and so on. But i've got a little problem. I'm creating a Window with 14 TextInputFieldModel and 14 ButtonModel and, to avoid the definition of 28 different instance variables (obviously), i created two arrays which contain the ButtonModel and the TextInputFieldModel that i need. 

 ^ SpecLayout composed
       
            newColumn: [ :columnTeam | 
1 to: 14 do:[:i|
columnTeam 
                 newRow: [ :rowPlayer |
                     rowPlayer 
add: (textPlayer at:i) ;
                         add:#captainButton;
add: (buttonStartingEleven at:i). 
].

.....

This is what i did in the defaultSpec of my Player class. captainButton is a RadioButton defined in self instantiateModels: in initializeWidgets, while textPlayer and buttonStartingEleven are the arrays of above.
Theoretically the idea is great, while in practice it doesn't work. It give me the following message: 
TextInputFieldModel>>layoutFrame:

Help me please!

Paolo


> From: [hidden email]

> Date: Wed, 20 Nov 2013 14:38:58 -0300
> To: [hidden email]
> Subject: Re: [Pharo-users] Writing a GUI - Where to start?
> 
> 
> I recommend you to go with Spec. It is the newest and designed to be the most capable. It is also the way forward, it will be the 'standard' GUI builders in the future. We know that the documentation right now is far from optimal. Ben and I will work on that in January. 
> 
> On Nov 20, 2013, at 1:30 PM, Mun Mun <[hidden email]> wrote:
> 
> > Hi everyone,
> > 
> > Nobody mentioned Polymorphic. My understanding is that both Spec and Polymorph are built on top of Morphic. I only looked at code example and brief tutorial for both of them, but it seemed to me that Polymorph was easier to grasp: it's quite obivous in the code where and how the widgets are built. I have trouble understanding how the job is done in Spec. On the other hand, Spec seems to have a lot of users in this mailling list.
> > 
> > To sum up this thread with many different options proposed, what would be the right path for a newbie like me ?
> > 
> > Thanks in advance !
> > 
> 
> 
> 
> ---> Save our in-boxes! http://emailcharter.org <---
> 
> Johan Fabry - http://pleiad.cl/~jfabry
> PLEIAD lab - Computer Science Department (DCC) - University of Chile
> 
>
<PBE-SquadraPROVA.st>


ProvaSquadra.st (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Writing a GUI - Where to start?

Picci Pharo
In reply to this post by Benjamin Van Ryseghem (Pharo)
I knew that the problem was here Ben, but i didn't know how to give to the row a symbol. The only way to make it works was to define the widgets into the instantiateModels (that's why #captainButton doesn't give to me any problem). However thanks for your help!


From: [hidden email]
Date: Sun, 24 Nov 2013 12:21:22 +0100
To: [hidden email]
Subject: Re: [Pharo-users] Writing a GUI - Where to start?

The problem is here

rowPlayer 
add: (textPlayer at:i) ;
                         add:#captainButton;
add: (buttonStartingEleven at:i). 
].

As you see, the argument of add: is a symbol,
but in the first and third add, you add directly a 
TextInputFieldModel

In addition your usage of class inst var is a bit disturbing :)

Ben

On 22 Nov 2013, at 11:08, prova email <[hidden email]> wrote:

Hi Ben,
here the .st file, there are some comments in italian, i hope it's not a problem. 
I know that Spec is the most used and it will be the standard GUI builders in the future, so i'd like to find a solution here, without changing to Morph and Polymorphic.

Paolo


From: [hidden email]
Date: Fri, 22 Nov 2013 11:04:53 +0100
To: [hidden email]
Subject: Re: [Pharo-users] Writing a GUI - Where to start?

It seems that you return the wrong object somewhere :)

Could you commit your code somewhere so I can have a look ?


Ben

On 22 Nov 2013, at 11:01, prova email <[hidden email]> wrote:

I started to use Spec, i love nested layouts and so on. But i've got a little problem. I'm creating a Window with 14 TextInputFieldModel and 14 ButtonModel and, to avoid the definition of 28 different instance variables (obviously), i created two arrays which contain the ButtonModel and the TextInputFieldModel that i need. 

 ^ SpecLayout composed
       
            newColumn: [ :columnTeam | 
1 to: 14 do:[:i|
columnTeam 
                 newRow: [ :rowPlayer |
                     rowPlayer 
add: (textPlayer at:i) ;
                         add:#captainButton;
add: (buttonStartingEleven at:i). 
].

.....

This is what i did in the defaultSpec of my Player class. captainButton is a RadioButton defined in self instantiateModels: in initializeWidgets, while textPlayer and buttonStartingEleven are the arrays of above.
Theoretically the idea is great, while in practice it doesn't work. It give me the following message: 
TextInputFieldModel>>layoutFrame:

Help me please!

Paolo


> From: [hidden email]

> Date: Wed, 20 Nov 2013 14:38:58 -0300
> To: [hidden email]
> Subject: Re: [Pharo-users] Writing a GUI - Where to start?
> 
> 
> I recommend you to go with Spec. It is the newest and designed to be the most capable. It is also the way forward, it will be the 'standard' GUI builders in the future. We know that the documentation right now is far from optimal. Ben and I will work on that in January. 
> 
> On Nov 20, 2013, at 1:30 PM, Mun Mun <[hidden email]> wrote:
> 
> > Hi everyone,
> > 
> > Nobody mentioned Polymorphic. My understanding is that both Spec and Polymorph are built on top of Morphic. I only looked at code example and brief tutorial for both of them, but it seemed to me that Polymorph was easier to grasp: it's quite obivous in the code where and how the widgets are built. I have trouble understanding how the job is done in Spec. On the other hand, Spec seems to have a lot of users in this mailling list.
> > 
> > To sum up this thread with many different options proposed, what would be the right path for a newbie like me ?
> > 
> > Thanks in advance !
> > 
> 
> 
> 
> ---> Save our in-boxes! http://emailcharter.org <---
> 
> Johan Fabry - http://pleiad.cl/~jfabry
> PLEIAD lab - Computer Science Department (DCC) - University of Chile
> 
>
<PBE-SquadraPROVA.st>

12