[Pollock] some questions

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

[Pollock] some questions

Guillermo Sapaya
Hi,
I´m beggining with pollock and I have some questions in mind...
1- Are there a rule for setting the actions definitions when subclassing from UserInterface? I think that the indicated message for doing this is #hookupInterface. Am I right?
i.e: I have the following method and it works:

hookupInterface

    (self paneAt: #(#formLeft #add) ) when: #pressed do: [self add].
    (self paneAt:  #(#formLeft #remove) ) when: #pressed do: [self remove].
    self aspectsList when: #selectionChanged do: [self selectedAspectChanged].

2- I have to think in generate the class #windowSpec method (wich works with literals) or the instance createInterface method (wich works with objects)?
I like the second option but... I can´t see if I am missing something here. For example, If in the future, when save the changes in the GUI Builder (Splash). It will construct the class #windowSpec method (I suppose), then, Wich is the right way?

--
Best Regards,
Guillermo Sapaya
Reply | Threaded
Open this post in threaded view
|

Re: [Pollock] some questions

Samuel S. Shuster <sames@interaccess.com>
Guillermo,

> 1- Are there a rule for setting the actions definitions when  
> subclassing from UserInterface? I think that the indicated message  
> for doing this is #hookupInterface. Am I right?

Yes.

> 2- I have to think in generate the class #windowSpec method (wich  
> works with literals) or the instance createInterface method (wich  
> works with objects)?
> I like the second option but... I can´t see if I am missing  
> something here. For example, If in the future, when save the  
> changes in the GUI Builder (Splash). It will construct the class  
> #windowSpec method (I suppose), then, Wich is the right way?

"Specs" are something that are translated into actual user  
interfaces. As far as Pollock and Splash are concerned, so is code.  
Splash will be multi-way. It will allow you to translate your user  
interface into a LiteralArray, XML, or Code. It will then allow you  
to save that translated thing.

We call these things Fluff. Fluff is simply a (dead) representation  
(code, XML or literal array) of the real user interface. Fluff can be  
then reified either directly into a user interface, or a live  
representation of the user interface via Specification objects. AND  
visa versa. A real user interface can be transformed into live  
Specification objects, and then stored as code, XML or literal arrays.

So, the right way is whatever is the easiest for you to use. Hand  
coding Literal Arrays or XML seems not easy to use, so, I suggest  
code. Travis will probably continue to hand code literal arrays, but  
there's no accounting for him. :)

                                 And So It Goes
                                      Sames
______________________________________________________________________

Samuel S. Shuster [|]
VisualWorks Engineering, GUI Project
Smalltalk Enables Success -- What Are YOU Using?