Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Native window and PureMVC  (Read 7670 times)
vladakg85
Full Member
***
Posts: 22


View Profile Email
« on: August 14, 2009, 05:46:35 »

I make NativeWindow component (based on script from TourDeFlex application). But I don't know how to implement PureMVC on native component. Is there any code sample, or can somebody show some simple viewComponent-mediator example. Just how to catch event from button from native component.

Thanks
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: August 15, 2009, 06:27:27 »

It is like any other component that you can reference or place a listener on. You might have a look at the DesktopCitizen utility and the CodePeek and RSS Reader AIR apps that use it.

-=Cliff>
Logged
vladakg85
Full Member
***
Posts: 22


View Profile Email
« Reply #2 on: August 18, 2009, 04:41:30 »

Ok, but my current component is something like popup (it is my update window). Where to register mediator for it? I send notification from startup command to see if  there is new version and based on result this native window should be opened, but I need to register mediator somehow or application break.
:
faca.registerMediator(new myNativeComponent(?));
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: August 18, 2009, 08:09:19 »

Register the mediator at the same time you create the window, just as you would with any other object where instantiation has been deferred.

Have a look at Simon Bailey's post on handling Popups: http://www.nutrixinteractive.com/blog/?p=329

In his case it isn't a native window, but a Flex TitleWindow popup but the concept is the same. You need to create the popup, wrap a mediator around it and then have it removed when the window goes away.


-=Cliff>
Logged
Pages: [1]
Print