a question with glamour

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

a question with glamour

EstebanLM
Hi,
I'm making my "first steps" with glamour and I have a question (a couple of then, actually).

1) I what to hear some events, like for example when something changes in a list
2) I what to pre-select some item in a list

How I can do this?

Thanks,
Esteban
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

Tudor Girba
Hi,

On 25 Oct 2010, at 12:44, Esteban Lorenzano wrote:

> Hi,
> I'm making my "first steps" with glamour and I have a question (a couple of then, actually).
>
> 1) I what to hear some events, like for example when something changes in a list

You can send #updateOn:from: to any presentation/browser.

You can see a basic example in GLMBasicExamples>>updatableBrowser.

Another example can be found in the MoosePanel, we update the models list when the root MooseModel sends MooseEntityAdded
        updateOn: MooseEntityAdded from: [ :root | root announcer ];

> 2) I what to pre-select some item in a list

Just populate the #select port. See an example in:
GLMBasicExamples>>listsWithUpdatedSelection

Cheers,
Doru


> How I can do this?
>
> Thanks,
> Esteban
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Be rather willing to give than demanding to get."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

EstebanLM
In reply to this post by EstebanLM
Hi,

I'm still lost here :(
What I want is to listen the GLMTreeMorphSelectionChanged event, and I can't find a way to do it... and the example is a little bit confusing for me :(.

Cheers,
Esteban
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

Tudor Girba
Hi,

I do not understand why you would need to do that. This is an internal implementation announcement that should not impact your application.

Perhaps it would be easier if you would describe your scenario, or send us a piece of code.

Cheers,
Doru


On 25 Oct 2010, at 18:54, Esteban Lorenzano wrote:

> Hi,
>
> I'm still lost here :(
> What I want is to listen the GLMTreeMorphSelectionChanged event, and I can't find a way to do it... and the example is a little bit confusing for me :(.
>
> Cheers,
> Esteban
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"When people care, great things can happen."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

EstebanLM
In reply to this post by EstebanLM
Ok... I'll try to explain my scenario, I think I must be something wrong:

1) I'm embedding a browser in my own window (I'm not opening them using #openOn:). btw, this leads to an override in GLMMorphicPaneRenderer>>#render: to check if window is nil)
2) Outside the glamour browser, in another place of the window, I have a bunch of buttons.
3) that buttons should be enabled/disabled depending some of the selections of the browser

I hope this made my needs clearer... and of course, if I'm using glamour in a wrong way, please let me know.

Cheers,
Esteban
 
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

Tudor Girba
Hi Esteban,

On 25 Oct 2010, at 23:50, Esteban Lorenzano wrote:

> Ok... I'll try to explain my scenario, I think I must be something wrong:
>
> 1) I'm embedding a browser in my own window (I'm not opening them using #openOn:). btw, this leads to an override in GLMMorphicPaneRenderer>>#render: to check if window is nil)
> 2) Outside the glamour browser, in another place of the window, I have a bunch of buttons.
> 3) that buttons should be enabled/disabled depending some of the selections of the browser
>
> I hope this made my needs clearer... and of course, if I'm using glamour in a wrong way, please let me know.

As I understand, you need announcements from inside Glamour. In this case you should try to not depend on the announcements specific to Morphic, because those can change all the time (they are supposed to be internal). Instead, if you must react to something inside, you should always go through the model of Glamour. Unfortunately, at the moment, there is no aggregator of all announcements inside a browser, but you can try to hook to the existing announcements. In particular, you are interested in getting GLMContextChanged from the presentations inside the panes of the browser (look at references, in tests).

Still, I would like to ask about the use case. Why would you need to embed this browser in an external context. Is it because that context is not handleable by Glamour?

Cheers,
Doru


> Cheers,
> Esteban
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Value is always contextual."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

Stéphane Ducasse
In reply to this post by EstebanLM

On Oct 25, 2010, at 12:45 PM, Esteban Lorenzano wrote:

> Hi,
> I'm making my "first steps" with glamour and I have a question (a couple of then, actually).

Excellent.
I want to start too.

>
> 1) I what to hear some events, like for example when something changes in a list
> 2) I what to pre-select some item in a list
>
> How I can do this?
>
> Thanks,
> Esteban
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

EstebanLM
In reply to this post by Tudor Girba
Hi,

suppose something like the centralized menus from mac: a bunch of browsers and just one menu, enabling/disabling it's options depending the opened browsers.

Cheers,
Esteban

pd: nevertheless, first thing I have to do is to review my design, to see if I can overcome this problem :)

El 26/10/2010, a las 8:18a.m., Tudor Girba escribió:

> Hi Esteban,
>
> On 25 Oct 2010, at 23:50, Esteban Lorenzano wrote:
>
>> Ok... I'll try to explain my scenario, I think I must be something wrong:
>>
>> 1) I'm embedding a browser in my own window (I'm not opening them using #openOn:). btw, this leads to an override in GLMMorphicPaneRenderer>>#render: to check if window is nil)
>> 2) Outside the glamour browser, in another place of the window, I have a bunch of buttons.
>> 3) that buttons should be enabled/disabled depending some of the selections of the browser
>>
>> I hope this made my needs clearer... and of course, if I'm using glamour in a wrong way, please let me know.
>
> As I understand, you need announcements from inside Glamour. In this case you should try to not depend on the announcements specific to Morphic, because those can change all the time (they are supposed to be internal). Instead, if you must react to something inside, you should always go through the model of Glamour. Unfortunately, at the moment, there is no aggregator of all announcements inside a browser, but you can try to hook to the existing announcements. In particular, you are interested in getting GLMContextChanged from the presentations inside the panes of the browser (look at references, in tests).
>
> Still, I would like to ask about the use case. Why would you need to embed this browser in an external context. Is it because that context is not handleable by Glamour?
>
> Cheers,
> Doru
>
>
>> Cheers,
>> Esteban
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "Value is always contextual."
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

EstebanLM
In reply to this post by Tudor Girba
Hi,

Ok, so I suppose that GLMContextChanged (or some "model" announcement) should be triggered when a #selection: message is sent... the only problem is that the announcer is being reset each time a copy is made (and I thing presenter copies are being used a lot inside glamour)... and the announcement is lost.
Of course, I can call an announcer *outside* glamour, but that feels veeeeeeery hacky...
any idea of how to solve this issue will be very welcome :)

cheers,
Esteban

El 26/10/2010, a las 8:18a.m., Tudor Girba escribió:

> Hi Esteban,
>
> On 25 Oct 2010, at 23:50, Esteban Lorenzano wrote:
>
>> Ok... I'll try to explain my scenario, I think I must be something wrong:
>>
>> 1) I'm embedding a browser in my own window (I'm not opening them using #openOn:). btw, this leads to an override in GLMMorphicPaneRenderer>>#render: to check if window is nil)
>> 2) Outside the glamour browser, in another place of the window, I have a bunch of buttons.
>> 3) that buttons should be enabled/disabled depending some of the selections of the browser
>>
>> I hope this made my needs clearer... and of course, if I'm using glamour in a wrong way, please let me know.
>
> As I understand, you need announcements from inside Glamour. In this case you should try to not depend on the announcements specific to Morphic, because those can change all the time (they are supposed to be internal). Instead, if you must react to something inside, you should always go through the model of Glamour. Unfortunately, at the moment, there is no aggregator of all announcements inside a browser, but you can try to hook to the existing announcements. In particular, you are interested in getting GLMContextChanged from the presentations inside the panes of the browser (look at references, in tests).
>
> Still, I would like to ask about the use case. Why would you need to embed this browser in an external context. Is it because that context is not handleable by Glamour?
>
> Cheers,
> Doru
>
>
>> Cheers,
>> Esteban
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "Value is always contextual."
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

R Some Moose questions

Guillermo Schwarz
Hello Moosers,

By mistake I was trying to load a project from SqueakSource in which I
had forgot to load some classes. The project is called XUnitTest and its
main objective is to make Moose aware of unit tests, which in some cases
it already is aware, but anyway, one of my tests was trying to load some
class called Example1Test into Moose and then perform some assertions.

It turns out I'm really starting to use Monticello and there are certain
things I still don't quite understand well, for example that it doesn't
automatically realize all the classes I've changed and include them in
the project XUnitTest, I didn't quite understand the message protocol
part yet (method category). I guess doing that automatically would be
dangerous.

Then I tried to load XUnitTest in a clean image (with Moose loaded of
course) and I got this error:

"Sets can't meaningful contain nil as an element" at:

MooseimportClassesTask>>addClass: aClass
         
        ^classes add: aClass

Then I changed the code from this:

MooseSqueakClassPackageImporterTask>>initialize

        super initialize.
        importerClass := SmalltalkImporter.
        classes := OrderedCollection new.
        classExtensions := OrderedCollection new.
        packages := OrderedCollection new.

To this:

MooseSqueakClassPackageImporterTask>>initialize

        super initialize.
        importerClass := SmalltalkImporter.
        classes := IdentitySet new.
        classExtensions := OrderedCollection new.
        packages := OrderedCollection new.

Now, the test correctly fails indicating that my class is missing (I'm
ataching a picture of it), which I think is the intended behavior. So my
questions are:

1. Is this the intended behavior?
2. If it is, who should I contact with this patch? (or how can I know
who to contact)

Cheers,
Guillermo.

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

moose-correct-error.png (181K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: R Some Moose questions

Alexandre Bergel
Hi Guillermo

> By mistake I was trying to load a project from SqueakSource in which I
> had forgot to load some classes. The project is called XUnitTest and its
> main objective is to make Moose aware of unit tests, which in some cases
> it already is aware, but anyway, one of my tests was trying to load some
> class called Example1Test into Moose and then perform some assertions.
>
> It turns out I'm really starting to use Monticello and there are certain
> things I still don't quite understand well, for example that it doesn't
> automatically realize all the classes I've changed and include them in
> the project XUnitTest, I didn't quite understand the message protocol
> part yet (method category). I guess doing that automatically would be
> dangerous.

You should show that to me.

> Then I tried to load XUnitTest in a clean image (with Moose loaded of
> course) and I got this error:
>
> "Sets can't meaningful contain nil as an element" at:

[...]

As far as I understand, the problem is Example1Test does not exist. Since you probably renamed it after your test has been written, then Example1Test points to nil. It does not make sense to send "addClass: nil"

Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question with glamour

Tudor Girba
In reply to this post by EstebanLM
Hi,

As I said, the problem is that Glamour does not aggregate these internal announcements through one announcer that can be accessible from outside. A solution here would be to make the browser always propagate the internal announcements. Like this, you should be able to listen to the outer browser.

However, I am not sure I would like to do that :). The idea of Glamour is that if you want a piece of data from somewhere, you should explicitly model it with transmissions. So, if you want to be notified from some #selection port of a #pane, what you want is to create a transmission from that port to the outer pane:

browser transmit from: #page; toOutside: #selectionFromPane.

Then, if you listen to the GLMContextChanged of the outer browser, you should get announcements for changes in the #selectionFromPane port.

Cheers,
Doru


On 27 Oct 2010, at 00:50, Esteban Lorenzano wrote:

> Hi,
>
> Ok, so I suppose that GLMContextChanged (or some "model" announcement) should be triggered when a #selection: message is sent... the only problem is that the announcer is being reset each time a copy is made (and I thing presenter copies are being used a lot inside glamour)... and the announcement is lost.
> Of course, I can call an announcer *outside* glamour, but that feels veeeeeeery hacky...
> any idea of how to solve this issue will be very welcome :)
>
> cheers,
> Esteban
>
> El 26/10/2010, a las 8:18a.m., Tudor Girba escribió:
>
>> Hi Esteban,
>>
>> On 25 Oct 2010, at 23:50, Esteban Lorenzano wrote:
>>
>>> Ok... I'll try to explain my scenario, I think I must be something wrong:
>>>
>>> 1) I'm embedding a browser in my own window (I'm not opening them using #openOn:). btw, this leads to an override in GLMMorphicPaneRenderer>>#render: to check if window is nil)
>>> 2) Outside the glamour browser, in another place of the window, I have a bunch of buttons.
>>> 3) that buttons should be enabled/disabled depending some of the selections of the browser
>>>
>>> I hope this made my needs clearer... and of course, if I'm using glamour in a wrong way, please let me know.
>>
>> As I understand, you need announcements from inside Glamour. In this case you should try to not depend on the announcements specific to Morphic, because those can change all the time (they are supposed to be internal). Instead, if you must react to something inside, you should always go through the model of Glamour. Unfortunately, at the moment, there is no aggregator of all announcements inside a browser, but you can try to hook to the existing announcements. In particular, you are interested in getting GLMContextChanged from the presentations inside the panes of the browser (look at references, in tests).
>>
>> Still, I would like to ask about the use case. Why would you need to embed this browser in an external context. Is it because that context is not handleable by Glamour?
>>
>> Cheers,
>> Doru
>>
>>
>>> Cheers,
>>> Esteban
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>>
>> "Value is always contextual."
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Value is always contextual."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev