Yet another "building a GUI" question

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

Yet another "building a GUI" question

Sergi Reyner
Hi everyone!

This is my first message to the list. I've been learning Smalltalk and toying with Pharo 2.0 for some weeks now. One thing that has me puzzled is the many different ways to build GUIs. I´m rewriting an app in Pharo as an exercise. It needs to display images in some parts. So far, I have:

- Sent messages to (UITheme builder)
- Created a SystemWindow, then #addMorph: to it, sending them #model: and so afterwards.
- Tried and somewhat succeeded in building my GUI with Spec, which apparently doesn't know about images.
- Read some stuff about Athens
- Read some stuff about Morphic 3, and wondered if it will make its way into Pharo.
- Read something about how Spec has changed a lot in Pharo 3.0 (which is labelled as alpha)

On top of that, as I understand it, building GUIs with Morphic was originally meant to be a visual live process, however what I've read so far takes a programmatic approach.

So... many questions, few clues, I am lost. I definitely need to use some AlphaImageMorphs in certain parts of the application, and while I find Spec's way easier, I'm at a loss when it comes to that part. On the other hand, it's sold as "the new way to build GUIs" so I'm not sure if these are missing things that will be included later, or if I'm supposed to implement them on top of the Spec framework, or even if there´s already a way to do it and I just don't get it :S

Cheers,
Sergi
Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Stéphane Ducasse

On Nov 2, 2013, at 12:05 PM, Sergi Reyner <[hidden email]> wrote:

> Hi everyone!
>
> This is my first message to the list. I've been learning Smalltalk and toying with Pharo 2.0 for some weeks now.

Excellent

> One thing that has me puzzled is the many different ways to build GUIs. I´m rewriting an app in Pharo as an exercise. It needs to display images in some parts. So far, I have:
>
> - Sent messages to (UITheme builder)
        It is a facade and I do not really facade because they do not scale and are not modular.

> - Created a SystemWindow, then #addMorph: to it, sending them #model: and so afterwards.
        this is the default programmatic way

If you are in a hurry use the two approaches above.





> - Tried and somewhat succeeded in building my GUI with Spec, which apparently doesn't know about images.
        what do you mean about images.
        Spec is what we want to push so

> - Read some stuff about Athens
        Athens is not about building app UI it is a rendering canvas
       
> - Read some stuff about Morphic 3, and wondered if it will make its way into Pharo.
        Forget that. Truly. We are cleaning Morphic but slowly. We had a plan but it failed because people left.

> - Read something about how Spec has changed a lot in Pharo 3.0 (which is labelled as alpha)
        Not that much but it is better


> On top of that, as I understand it, building GUIs with Morphic was originally meant to be a visual live process, however what I've read so far takes a programmatic approach.
        Not necessarily.


> So... many questions, few clues, I am lost. I definitely need to use some AlphaImageMorphs in certain parts of the application, and while I find Spec's way easier, I'm at a loss when it comes to that part.

        Ok Ben will reply better than me.
        One way is to take 30 and extend Spec with support for images.


> On the other hand, it's sold as "the new way to build GUIs" so I'm not sure if these are missing things that will be included later, or if I'm supposed to implement them on top of the Spec framework, or even if there´s already a way to do it and I just don't get it :S
>
> Cheers,
> Sergi


Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sergi Reyner


El 02/11/2013 11:25, "Stéphane Ducasse" <[hidden email]> escribió:

> > - Tried and somewhat succeeded in building my GUI with Spec, which apparently doesn't know about images.
>         what do you mean about images.

JPEG files, mostly

Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

kilon.alios
If the app you are porting already uses GTK or Coccoa , then you may be also interested into Mars


I second what Stephane said that right now Morphic is the King as far as GUIs are concerned, documentation and available code. Spec is too much a moving target and far from replacing Morphic but its definitely a welcome clean up.  Morphic is too messy at some areas but overall works really well considering anything you see inside pharo is build with it. 

I am also working on a new GUI API using Athens and Morphic. My focus is in custom drawn GUIs which is the exact opposite of Mars native look and some crazy ideas I have about gui design.   


On Sat, Nov 2, 2013 at 2:53 PM, Sergi Reyner <[hidden email]> wrote:


El 02/11/2013 11:25, "Stéphane Ducasse" <[hidden email]> escribió:

> > - Tried and somewhat succeeded in building my GUI with Spec, which apparently doesn't know about images.
>         what do you mean about images.

JPEG files, mostly


Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sven Van Caekenberghe-2
In reply to this post by Sergi Reyner
Hi Sergi,

On 02 Nov 2013, at 13:53, Sergi Reyner <[hidden email]> wrote:

>
> El 02/11/2013 11:25, "Stéphane Ducasse" <[hidden email]> escribió:
>
> > > - Tried and somewhat succeeded in building my GUI with Spec, which apparently doesn't know about images.
> >         what do you mean about images.
>
> JPEG files, mostly

It is trivially easy to open a JPEG (or GIF or PNG) and turn it into a Morph:

'/Users/Sven/Desktop/test.jpg' asFileReference readStreamDo: [ :in |
  (JPEGReadWriter on: in) nextImage asMorph openInWindow ].

Maybe this is not directly available at the Spec level, I just don’t know.

HTH,

Sven



Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Ben Coman
In reply to this post by Sergi Reyner
Sergi Reyner wrote:

> Hi everyone!
>
> This is my first message to the list. I've been learning Smalltalk and
> toying with Pharo 2.0 for some weeks now. One thing that has me puzzled is
> the many different ways to build GUIs. I´m rewriting an app in Pharo as an
> exercise. It needs to display images in some parts. So far, I have:
>
> - Sent messages to (UITheme builder)
> - Created a SystemWindow, then #addMorph: to it, sending them #model: and
> so afterwards.
> - Tried and somewhat succeeded in building my GUI with Spec, which
> apparently doesn't know about images.
> - Read some stuff about Athens
> - Read some stuff about Morphic 3, and wondered if it will make its way
> into Pharo.
> - Read something about how Spec has changed a lot in Pharo 3.0 (which is
> labelled as alpha)
>
> On top of that, as I understand it, building GUIs with Morphic was
> originally meant to be a visual live process, however what I've read so far
> takes a programmatic approach.
>
> So... many questions, few clues, I am lost. I definitely need to use some
> AlphaImageMorphs in certain parts of the application, and while I find
> Spec's way easier, I'm at a loss when it comes to that part. On the other
> hand, it's sold as "the new way to build GUIs" so I'm not sure if these are
> missing things that will be included later, or if I'm supposed to implement
> them on top of the Spec framework, or even if there´s already a way to do
> it and I just don't get it :S
>
> Cheers,
> Sergi
>
>  
As a new framework, sometimes it is just a use-case that has not been
considered or prioritized.  If you can describe your situation in detail
with a simple script that you would "expect" to work, "sometimes" you
can be surprised at how fast your needs can be met.  Obviously I say
sometimes because variable factors are many (problem complexity, other
peoples priorities) - but (not to get your hopes up too much) I
personally have been surprised at time by the speed of response from the
Pharo community.

Developers can only see-what-they-see from their own perspective. Users
are a great asset to a framework to identify gaps. If you can detail
your needs with sample code then I'm sure that would be appreciated.  I
might even give it a go, even though I am not so intimate with Spec.

cheers -ben


Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sergi Reyner



2013/11/2 <[hidden email]>
Sergi Reyner wrote:

- Tried and somewhat succeeded in building my GUI with Spec, which
apparently doesn't know about images.
  
As a new framework, sometimes it is just a use-case that has not been considered or prioritized.  If you can describe your situation in detail with a simple script that you would "expect" to work, "sometimes" you can be surprised at how fast your needs can be met.  Obviously I say sometimes because variable factors are many (problem complexity, other peoples priorities) - but (not to get your hopes up too much) I personally have been surprised at time by the speed of response from the Pharo community.
Developers can only see-what-they-see from their own perspective. Users are a great asset to a framework to identify gaps. If you can detail your needs with sample code then I'm sure that would be appreciated.  I might even give it a go, even though I am not so intimate with Spec.

cheers -ben


Something like this:

initializeWidgets
self
instantiateModels:
{ (#listModel -> #ListComposableModel).
(#pictureModel -> #AlphaImageModel).


I tried to follow how Spec "thingies" are constructed but somewhere along the chain I lost the trail.

Cheers,
Sergi
Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sergi Reyner
2013/11/3 Sergi Reyner <[hidden email]>

Something like this:

initializeWidgets
self
instantiateModels:
{ (#listModel -> #ListComposableModel).
(#pictureModel -> #AlphaImageModel).

I gave it another try, and after a few attempts I managed to put together a working example of what I meant, in Pharo 3.0. I attach the .mcz file.

Cheers,
Sergi

Raytests-SergiReyner.1.mcz (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Benjamin Van Ryseghem (Pharo)
I think I missed the beginning of this thread :)
So my question is what do you want to do ? :)

I tried your ImageSpecTest, and after a minor fix, it opens :)
But expect displaying an ImageMorph, it is not really usable :)

Ben

On 03 Nov 2013, at 21:37, Sergi Reyner <[hidden email]> wrote:

2013/11/3 Sergi Reyner <[hidden email]>

Something like this:

initializeWidgets
self
instantiateModels:
{ (#listModel -> #ListComposableModel).
(#pictureModel -> #AlphaImageModel).

I gave it another try, and after a few attempts I managed to put together a working example of what I meant, in Pharo 3.0. I attach the .mcz file.

Cheers,
Sergi
<Raytests-SergiReyner.1.mcz>

Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sergi Reyner


El 03/11/2013 21:45, "Benjamin" <[hidden email]> escribió:
>
> I think I missed the beginning of this thread :)
> So my question is what do you want to do ? :)

I want to have a way to get an AlphaImageMorph linked to a ValueHolder(?) holding a Form(?), and having it update automatically, for example in response to selecting an item from a list.

Cheers,
Sergi

Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Benjamin Van Ryseghem (Pharo)
In reply to this post by Benjamin Van Ryseghem (Pharo)
After a bit of research I found the beginning of the thread :)

I integrated your code in Spec (after minor fixes).

Thanks :)

Ben


2013/11/3 Benjamin <[hidden email]>
I think I missed the beginning of this thread :)
So my question is what do you want to do ? :)

I tried your ImageSpecTest, and after a minor fix, it opens :)
But expect displaying an ImageMorph, it is not really usable :)

Ben

On 03 Nov 2013, at 21:37, Sergi Reyner <[hidden email]> wrote:

2013/11/3 Sergi Reyner <[hidden email]>

Something like this:

initializeWidgets
self
instantiateModels:
{ (#listModel -> #ListComposableModel).
(#pictureModel -> #AlphaImageModel).

I gave it another try, and after a few attempts I managed to put together a working example of what I meant, in Pharo 3.0. I attach the .mcz file.

Cheers,
Sergi
<Raytests-SergiReyner.1.mcz>


Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Stéphane Ducasse
Excellent!
I will integrate it.
Now I'm back from a really cool turn into buenos aires.

There are really cool places :)

On Nov 3, 2013, at 11:10 PM, Benjamin Van Ryseghem <[hidden email]> wrote:

After a bit of research I found the beginning of the thread :)

I integrated your code in Spec (after minor fixes).

Thanks :)

Ben


2013/11/3 Benjamin <[hidden email]>
I think I missed the beginning of this thread :)
So my question is what do you want to do ? :)

I tried your ImageSpecTest, and after a minor fix, it opens :)
But expect displaying an ImageMorph, it is not really usable :)

Ben

On 03 Nov 2013, at 21:37, Sergi Reyner <[hidden email]> wrote:

2013/11/3 Sergi Reyner <[hidden email]>

Something like this:

initializeWidgets
self
instantiateModels:
{ (#listModel -> #ListComposableModel).
(#pictureModel -> #AlphaImageModel).

I gave it another try, and after a few attempts I managed to put together a working example of what I meant, in Pharo 3.0. I attach the .mcz file.

Cheers,
Sergi
<Raytests-SergiReyner.1.mcz>



Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Stéphane Ducasse
In reply to this post by Sergi Reyner
Sergi

could you sign the Pharo license agreement and send it to us (scanned for example)?

Stef

On Nov 3, 2013, at 11:10 PM, Sergi Reyner <[hidden email]> wrote:


El 03/11/2013 21:45, "Benjamin" <[hidden email]> escribió:
>
> I think I missed the beginning of this thread :)
> So my question is what do you want to do ? :)

I want to have a way to get an AlphaImageMorph linked to a ValueHolder(?) holding a Form(?), and having it update automatically, for example in response to selecting an item from a list.

Cheers,
Sergi


Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sergi Reyner
Sent to your mail, Stef!


2013/11/3 Stéphane Ducasse <[hidden email]>
Sergi

could you sign the Pharo license agreement and send it to us (scanned for example)?

Stef

On Nov 3, 2013, at 11:10 PM, Sergi Reyner <[hidden email]> wrote:


El 03/11/2013 21:45, "Benjamin" <[hidden email]> escribió:
>
> I think I missed the beginning of this thread :)
> So my question is what do you want to do ? :)

I want to have a way to get an AlphaImageMorph linked to a ValueHolder(?) holding a Form(?), and having it update automatically, for example in response to selecting an item from a list.

Cheers,
Sergi



Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Stéphane Ducasse
tx and archived!
And your enh is in the new integration :)

On Nov 4, 2013, at 12:56 AM, Sergi Reyner <[hidden email]> wrote:

Sent to your mail, Stef!


2013/11/3 Stéphane Ducasse <[hidden email]>
Sergi

could you sign the Pharo license agreement and send it to us (scanned for example)?

Stef

On Nov 3, 2013, at 11:10 PM, Sergi Reyner <[hidden email]> wrote:


El 03/11/2013 21:45, "Benjamin" <[hidden email]> escribió:
>
> I think I missed the beginning of this thread :)
> So my question is what do you want to do ? :)

I want to have a way to get an AlphaImageMorph linked to a ValueHolder(?) holding a Form(?), and having it update automatically, for example in response to selecting an item from a list.

Cheers,
Sergi




Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Sergi Reyner
2013/11/4 Stéphane Ducasse <[hidden email]>
tx and archived!
And your enh is in the new integration :)


Yay! Scratching an itch and contributing something feels great :) 
Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Stéphane Ducasse

On Nov 4, 2013, at 2:37 AM, Sergi Reyner <[hidden email]> wrote:

2013/11/4 Stéphane Ducasse <[hidden email]>
tx and archived!
And your enh is in the new integration :)


Yay! Scratching an itch and contributing something feels great :) 

:)
Yes pay attention when you start to like that you learn and lot and you start to be addict :)

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Yet another "building a GUI" question

Ben Coman
In reply to this post by Sergi Reyner
Sergi Reyner wrote:
2013/11/4 Stéphane Ducasse [hidden email]

  
tx and archived!
And your enh is in the new integration :)


    
Yay! Scratching an itch and contributing something feels great :)

  
Well done Sergi.  Your initiation is complete ;) 

Late last night I had marked your first sample script to have a go after work today - but its already done and integrated!  So it obviously can't always be so fast, but more often than not it is pretty amazing.  Great to see.

And btw, welcome. Can't wait to see you next itch.
cheers -ben