Roger,

(I assume that you are launching your application using
DesktopApplicationContext
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/DesktopApplicationContext.html)

As the Javadoc state, the Application#shutdown(boolean) method is
called when the application is being shut down.
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Application.html#shutdown(boolean)
It exists as a hook for your applications to use to perform some
housekeeping, tidy up resources, persist preferences, etc, but does
not actually make the application shut down.

I am not at a dev box right now, but it looks like you should be able to use
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/DesktopApplicationContext.html#exit()

The source code is here.
http://svn.apache.org/repos/asf/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java

If you search for 'exit()' you can see how it is used internally,
specifically when it is called by the processWindowEvent(WindowEvent)
method of the 'HostFrame' inner class.  (Each Pivot desktop
application is hosted in a java.awt.Frame, which has listeners
attached which will call exit() when the native window is closed -
triggering the shut down of the Pivot application.)

Chris

On 8 August 2011 13:59, B.L. Zeebub <[email protected]> wrote:
> Hi
>
> I've got a fairly basic frame defined (below). When I instantiate the window
> under Windows 7 with
>
> public void startup(Display display, Map&lt;String, String&gt; properties)
>                        throws Exception {
>
>                WTKXSerializer wtkxSerializer = new WTKXSerializer();
>                window = (Window) wtkxSerializer.readObject(this,
> "GenesisClientStarter.wtkx");
>                window.open(display);
> }
>
> I get my frame which is wrapped in a Windows decorated frame. If I click the
> close icon on the Windows frame then everything shuts down as expected.
> However, if I try to shutdown my app programatically with
>
> Alert.alert(MessageType.ERROR,((ErrorEvent) message).getMessage(), window,
> new DialogCloseListener()
>                                         {
>
>                                public void dialogClosed(Dialog dialog, 
> boolean modal) {
>                                                try {
>                                                        shutdown(true);
>                                                } catch (Exception e) {
>                                                        e.printStackTrace();
>                                                }
>
>                                }
>
>
>                        });
>
> then only my frame closes, leaving a blank Windows 7 decorated window in
> place. How do I close the Windows 7 window?
>
> Regards
>
> <Frame title="Genesis Client" maximized="true"
> styles="{showWindowControls:false}"
>        xmlns:wtkx="http://pivot.apache.org/wtkx"; xmlns="org.apache.pivot.wtk">
>        <content>
>                <Border styles="{color:10, cornerRadii:20}">
>                        <content>
>                                <TablePane>
>                                        <columns>
>                                                <TablePane.Column />
>                                        </columns>
>                                        <rows>
>                                        <TablePane.Row>
>                                        <Border>
>                                        <content>
>                                        <BoxPane orientation="horizontal" >
>                                        <ImageView wtkx:id="car" 
> styles="{verticalAlignment:'center'}"/>
>                                        <ImageView wtkx:id="vci_status" 
> styles="{verticalAlignment:'bottom'}"/>
>                                        <ImageView wtkx:id="pc" 
> styles="{verticalAlignment:'center'}"/>
>                                        <ImageView wtkx:id="pc_status" 
> styles="{verticalAlignment:'bottom'}"/>
>                                        <ImageView wtkx:id="server" 
> styles="{verticalAlignment:'center'}"/>
>                                        </BoxPane>
>                                        </content>
>                                        </Border>
>                                        </TablePane.Row>
>                                        <TablePane.Row>
>                                        <Border>
>                                        <content>
>                                        <BoxPane orientation="horizontal">
>                                        <ImageView wtkx:id="rx" />
>                                        <ImageView wtkx:id="tx" />
>                                        </BoxPane>
>                                        </content>
>                                        </Border>
>                                        </TablePane.Row>
>
>                                                <TablePane.Row height="300">
>                                                        <Border>
>                                                                <content>
>                                                                        
> <ScrollPane horizontalScrollBarPolicy="fill_to_capacity">
>                                                                               
>  <view>
>                                                                               
>          <TableView wtkx:id="tableView" selectMode="single">
>                                                                               
>                  <columns>
>                                                                               
>                          <TableView.Column name="message" width="800"
>                                                                               
>                                  headerData="Header" />
>                                                                               
>                  </columns>
>                                                                               
>          </TableView>
>                                                                               
>  </view>
>                                                                        
> </ScrollPane>
>                                                                </content>
>                                                        </Border>
>                                                </TablePane.Row>
>                                                <TablePane.Row>
>                                                        <Border>
>                                                        <content>
>                                                                
> <ActivityIndicator wtkx:id="activityIndicator"
>                                                                        
> preferredWidth="24" preferredHeight="24" />
>                                                                        
> </content>
>                                                        </Border>
>                                                </TablePane.Row>
>                                        </rows>
>                                </TablePane>
>                        </content>
>                </Border>
>        </content>
> </Frame>
>
>
>
> --
> View this message in context: 
> http://apache-pivot-users.399431.n3.nabble.com/Problem-closing-windows-tp3234719p3234719.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>

Reply via email to