For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > May 2006 > WindowSpec









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author WindowSpec
Roberto Allende

2006-05-23, 10:03 pm

Hello

I'm running:

Tools.UIPainter new openOnLiteralArray: MyClass windowSpec.

and i'd like to get just the windows without the Painter.

That's because i'd like to manipulate the windowSpec array to define my
windows and all its components and then open it. I've been looking at
the class browser and didn't find the way to open it without the
painter. I just was able to get the FullSpec but i wasn't to get a
window from there.

Is possible to create a window just from a windowSpec array or i'm
missing something ?

regards
r.

Denis Johnson

2006-05-24, 4:14 am

Hi Roberto,

The following will give you the spec instance.

MyClass interfaceSpecFor: #windowSpec

Hope that helps,

regards Denis

Roberto Allende wrote:
> Hello
>
> I'm running:
>
> Tools.UIPainter new openOnLiteralArray: MyClass windowSpec.
>
> and i'd like to get just the windows without the Painter.
>
> That's because i'd like to manipulate the windowSpec array to define my
> windows and all its components and then open it. I've been looking at
> the class browser and didn't find the way to open it without the
> painter. I just was able to get the FullSpec but i wasn't to get a
> window from there.
>
> Is possible to create a window just from a windowSpec array or i'm
> missing something ?
>
> regards
> r.
>

Roberto Allende

2006-05-24, 7:07 pm

Hello

Thanks for your answer. Unfortunatelly this doesn't seems to be what
i'm looking. In other words, when i run

anArray := MyClass windowSpec

i'd like to use this array to create a GUI, i'm looking something like:

AUIClass open: anArray

and just get the windows. Also would be ok if i can use something like

AUIClass open: aFullSpec

That's because i'd like to generate a windowspec in the painter and
then manipulate it as an array but not binded to any class. I'm not
sure if that's possible, i think i could use reflection but i'll have
to edit a class windowSpec.

regards
r.

Denis Johnson

2006-05-25, 7:06 pm

I'm a little from your description as to what you are trying to
do and asking for. But I'm guessing you wish to open the actual window
by providing the specification as a parameter.

It is only a convention/default that the specifications generated by the
UIPainter are stored as class methods on subclasses of ApplicationModel.
The spec representing the window and corresponding widgets does not have
to be on the AppplicationModel subclass. It does not need to exist as a
static/literal method at all, and could even be dynamically/
programmatically built.

If you look at ApplicationModel class >>open and follow the methods
calls through, you will see the chain as I have listed bellow. At each
point you have the opportunity to hook in depending on what you are
trying to achieve. This may be as simple as specifying a different
selector for the spec instead of #windowSpec e.g.

MyClass openOn: MyClass new withSpec: #mySpecialArraySpec

ApplicationModel class methods:

1. >>open
2. >>openOn: anInstance
3. >>openOn: anInstance withSpec: aSymbol

ApplicationModel instance methods:
4. >>openInterface: aSymbol
5. >>openInterface: aSymbol withPolicy: aPolicy
6. >>openInterface: aSymbol withPolicy: aPolicy inSession: appContext

The real work of building an actual instance and displaying the window
happens in 6. above, so with your own variation of this, the spec array
could come from anywhere and does not have to be in the same class.

I hope this gets you closer to your goal.

regards Denis

Roberto Allende wrote:
> Hello
>
> Thanks for your answer. Unfortunatelly this doesn't seems to be what
> i'm looking. In other words, when i run
>
> anArray := MyClass windowSpec
>
> i'd like to use this array to create a GUI, i'm looking something like:
>
> AUIClass open: anArray
>
> and just get the windows. Also would be ok if i can use something like
>
> AUIClass open: aFullSpec
>
> That's because i'd like to generate a windowspec in the painter and
> then manipulate it as an array but not binded to any class. I'm not
> sure if that's possible, i think i could use reflection but i'll have
> to edit a class windowSpec.
>
> regards
> r.
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com