You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by lello <rb...@gmail.com> on 2010/12/05 16:26:09 UTC

How to open two windows

Hi All,
in my application I need to open a second window, a dialog, but I don't like
the idea of having a dialog which ca be moved around only in the main
window. Is it possible to open two windows? 
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2022668.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
>> Did you try modifying DesktopApplicationContext to return a HostFrame instead of a HostDialog when modal = false?

> I think I tried something like that (my experiments in that direction were
> several days ago and I didn't get the results I wanted so I kinda lost track
> of the details during the abandonment... ).

I'd give that another shot. The code in createDisplay() is pretty simple so you should be able to see where it would fit pretty easily.

> What I REALLY meant by "cleaner" and "well integrated" is advice on how to
> (re)write my modifications to the DesktopApplicationContext class so they
> are "more betterer."  

That's what my suggestion was meant to be.  ;-)

> Perhaps some other class altogther?  Perhaps a new
> flag argument to createDisplay(...)?  (Why not even one more??)  

What might such an additional argument do? If, for example, it is a boolean "frame" argument, it wouldn't be compatible with modal. That's not necessarily a show-stopper, but does suggest that maybe a single flag (modal) should be used to determine whether a native frame or a native dialog is opened.

G


Re: How to open two windows

Posted by mukadobo <mu...@gmail.com>.
I think I tried something like that (my experiments in that direction were
several days ago and I didn't get the results I wanted so I kinda lost track
of the details during the abandonment... ).

Anyway, as I recall, overriding shutdown(...) only allowed me to veto the
"Application is Going Away Now" process.  But then I can't ever shut it down
(from the inside - thank the Demons of Kill-9 Lane for other options).  

Perhaps you meant something otherwise, but that was my experience.  I
suppose I could somehow "get into" the underlying list of Displays who's
closing signals Application Termination and modify / intercept / twistify it
- but that seems even less clean (even if I don't have to modify any code).

What I REALLY meant by "cleaner" and "well integrated" is advice on how to
(re)write my modifications to the DesktopApplicationContext class so they
are "more betterer."  Perhaps some other class altogther?  Perhaps a new
flag argument to createDisplay(...)?  (Why not even one more??)  My larger
concern is that I'm somehow missing something important in how everthing all
fits together and that I'm creating some subtle problem - but unless some
Hero of Pivot can help resolve that concern I'll be moving on for now...

PS - I can post a diff / patch if peoples are interested, especially one of
those Heroes .

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2646021.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by lello <rb...@gmail.com>.
Can't you use DesktopApplicationContext.main() and overwrite the shutdown()
method?
You could also instantiate an undecorated window and then open a Pivot frame
inside it.
This might be a little cleaner if it is what you need.


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2645443.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
Did you try modifying DesktopApplicationContext to return a HostFrame instead of a HostDialog when modal = false? If that works, you could consider submitting your patch for inclusion in the codebase.

On Mar 6, 2011, at 9:02 PM, mukadobo wrote:

> Yes.  Very simple:  a second fully-decorated native frame.  That can be
> properly minimized (iconified).  That stacks under or over other Pivot
> managed host displays.  That doesn't trigger application shutdown when X'ed
> (as does a discarded "solution" I tried along the lines of lello's recent
> suggestion on this tread to use multiple invocations of
> DesktopApplicationContext.main(...)).
> 
> Actually, I hacked the code and made the standard 100-Cheeto sacrifice to
> the gods of OpenSource in thanks.  My solution is fugly:  Within my own copy
> of DesktopApplicationContext.java I added a new method
> createDisplayFrame(...) which takes identical args as createDisplay.  The
> new one is a simple copy/paste/name-change with one change: instead of
> instantiating a HostDialog (extends java.awt.Dialog), the new method
> instantiages a HostFrame2 (extends java.awt.Frame).  HostFrame2 is a new
> class that is another copy/paste/name-change rippoff - this time of
> HostDialog with the primary modification of extending java.awt.Frame rather
> than java.awt.Dialog.  (It's also slightly simpler than it's rippoff-source
> HostDialog, since native Frame objects are simpler themselves to instantiate
> (fewer arguments)).
> 
> Needless to say, it all works well.  I get all the behaviors I want without
> any of the confuxions and hedicks.  Still, I would love a better (read:
> "cleaner" and "well integrated") solution...
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2644310.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: How to open two windows

Posted by mukadobo <mu...@gmail.com>.
Yes.  Very simple:  a second fully-decorated native frame.  That can be
properly minimized (iconified).  That stacks under or over other Pivot
managed host displays.  That doesn't trigger application shutdown when X'ed
(as does a discarded "solution" I tried along the lines of lello's recent
suggestion on this tread to use multiple invocations of
DesktopApplicationContext.main(...)).

Actually, I hacked the code and made the standard 100-Cheeto sacrifice to
the gods of OpenSource in thanks.  My solution is fugly:  Within my own copy
of DesktopApplicationContext.java I added a new method
createDisplayFrame(...) which takes identical args as createDisplay.  The
new one is a simple copy/paste/name-change with one change: instead of
instantiating a HostDialog (extends java.awt.Dialog), the new method
instantiages a HostFrame2 (extends java.awt.Frame).  HostFrame2 is a new
class that is another copy/paste/name-change rippoff - this time of
HostDialog with the primary modification of extending java.awt.Frame rather
than java.awt.Dialog.  (It's also slightly simpler than it's rippoff-source
HostDialog, since native Frame objects are simpler themselves to instantiate
(fewer arguments)).

Needless to say, it all works well.  I get all the behaviors I want without
any of the confuxions and hedicks.  Still, I would love a better (read:
"cleaner" and "well integrated") solution...

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2644310.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by lello <rb...@gmail.com>.
What about using DesktopAppicationContext.main().
Is it possible to call it more several times? Something like having your
Dialog class which implements Application. In this way you could create a
modal display using a proper argument in the caller.
This is just an idea.

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2643465.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
OK. I assume you are talking about native (AWT) Frame windows vs. Pivot Frames?

On Mar 5, 2011, at 10:17 PM, mukadobo wrote:

> Sorry about the missing context - I use the Nabble.com website which threads
> the topic.  It may be easier to read it there:
> http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-td2022668.html 
> http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-td2022668.html 
> 
> Remember, what I'm looking for is a way to have secondary Frame-windows (not
> Dialog-windows).  Sometimes a Modal dialog is fine, but in this case I want
> sometime with independent minimization (iconification) - Dialog objects
> can't ever be minimized... (by frame decoration button or programatically,
> either)
> 
> 
> If the link doesn't suit you, here's a recapitulation by copy'n'paste
> (mostly between "lello" and "Greg Brown-2"):
> 
> 
> Greg Brown-2 wrote:
>> 
>> Note that opening multiple displays is only possible if you are deploying
>> your application to the desktop. In a web browser, your application will
>> still be constrained to the bounds of the applet. If you plan to deploy to
>> the web as well, you are probably better off using a Sheet.
>> 
>> On Dec 5, 2010, at 10:47 AM, Greg Brown wrote:
>> 
>>>> in my application I need to open a second window, a dialog, but I don't
>>>> like
>>>> the idea of having a dialog which ca be moved around only in the main
>>>> window. Is it possible to open two windows? 
>>> 
>>> Pivot windows are all contained within a single display. If you are using
>>> Pivot 2.0, you can open multiple displays, each of which is contained in
>>> a
>>> native host window. See this example:
>>> 
>>> http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/displays/multiple_display_example.bxml
>>> 
>>> Another option is to use a Sheet or Prompt instead of a Dialog or Alert.
>>> These windows still only exist within the Pivot display, but they can't
>>> be
>>> moved by the user, which may offer a better user experience depending on
>>> your needs.
>>> 
>>> G
>>> 
>>> 
>> 
>> 
>> 
> 
> 
> Greg Brown-2 wrote:
>> 
>> A Pivot window, or an AWT window? If the latter, are you opening it with
>> modal = true?
>> 
>> On Dec 5, 2010, at 11:38 AM, lello wrote:
>> 
>>> 
>>> I managed to open a second window, but it always stays on the top of the
>>> first one. Is this behaviour normal?
>>> -- 
>>> View this message in context:
>>> http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2022963.html
>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> 
> Greg Brown-2 wrote:
>> 
>> What I meant was, are you seeing this behavior with the AWT host window or
>> with a Pivot (internal) window. I assume the former.
>> 
>> When a Pivot window is opened with an owner, it always appears on top of
>> its
>> owner. Not sure what the defined AWT behavior is in this case. Did you try
>> passing null for the owner argument?
>> 
>> On Dec 5, 2010, at 2:31 PM, lello wrote:
>> 
>>> 
>>> On the top of a pivot window, and I am opening it with modal=false.
>>> -- 
>>> View this message in context:
>>> http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2023630.html
>>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> 
> Greg Brown-2 wrote:
>> 
>>> The host window is on the back.
>>> If I pass null I get an Illegal Argument Exception.
>>> Tell me there is a solution...
>> 
>> You are building Pivot from trunk, right? Try commenting out the check for
>> owner == null. Let me know how that goes.
>> 
>>> By the way, why does the function createDisplay() needs an AWT Window? we
>>> are all using pivot Windows...
>> 
>> As I mentioned earlier, all Pivot windows live in an instance of Display
>> that is hosted by a single native window (or applet), and are constrained
>> to
>> the bounds of that display. The createDisplay() method creates another
>> Display (and corresponding native host window) on which Pivot windows can
>> be
>> opened. That native (AWT) window may or may not need a parent. It depends
>> on
>> the needs of your application.
>> 
>>> and why does it need a parent window at all?
>> 
>> It probably doesn't. I think the null check is invalid. Let me know what
>> you
>> find out.
>> 
>> 
>> 
> 
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2640586.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: How to open two windows

Posted by mukadobo <mu...@gmail.com>.
Sorry about the missing context - I use the Nabble.com website which threads
the topic.  It may be easier to read it there:
http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-td2022668.html 
http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-td2022668.html 

Remember, what I'm looking for is a way to have secondary Frame-windows (not
Dialog-windows).  Sometimes a Modal dialog is fine, but in this case I want
sometime with independent minimization (iconification) - Dialog objects
can't ever be minimized... (by frame decoration button or programatically,
either)


If the link doesn't suit you, here's a recapitulation by copy'n'paste
(mostly between "lello" and "Greg Brown-2"):


Greg Brown-2 wrote:
> 
> Note that opening multiple displays is only possible if you are deploying
> your application to the desktop. In a web browser, your application will
> still be constrained to the bounds of the applet. If you plan to deploy to
> the web as well, you are probably better off using a Sheet.
> 
> On Dec 5, 2010, at 10:47 AM, Greg Brown wrote:
> 
>>> in my application I need to open a second window, a dialog, but I don't
>>> like
>>> the idea of having a dialog which ca be moved around only in the main
>>> window. Is it possible to open two windows? 
>> 
>> Pivot windows are all contained within a single display. If you are using
>> Pivot 2.0, you can open multiple displays, each of which is contained in
>> a
>> native host window. See this example:
>> 
>> http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/displays/multiple_display_example.bxml
>> 
>> Another option is to use a Sheet or Prompt instead of a Dialog or Alert.
>> These windows still only exist within the Pivot display, but they can't
>> be
>> moved by the user, which may offer a better user experience depending on
>> your needs.
>> 
>> G
>> 
>> 
> 
> 
> 


Greg Brown-2 wrote:
> 
> A Pivot window, or an AWT window? If the latter, are you opening it with
> modal = true?
> 
> On Dec 5, 2010, at 11:38 AM, lello wrote:
> 
>> 
>> I managed to open a second window, but it always stays on the top of the
>> first one. Is this behaviour normal?
>> -- 
>> View this message in context:
>> http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2022963.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 
> 
> 


Greg Brown-2 wrote:
> 
> What I meant was, are you seeing this behavior with the AWT host window or
> with a Pivot (internal) window. I assume the former.
> 
> When a Pivot window is opened with an owner, it always appears on top of
> its
> owner. Not sure what the defined AWT behavior is in this case. Did you try
> passing null for the owner argument?
> 
> On Dec 5, 2010, at 2:31 PM, lello wrote:
> 
>> 
>> On the top of a pivot window, and I am opening it with modal=false.
>> -- 
>> View this message in context:
>> http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2023630.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 
> 
> 


Greg Brown-2 wrote:
> 
>> The host window is on the back.
>> If I pass null I get an Illegal Argument Exception.
>> Tell me there is a solution...
> 
> You are building Pivot from trunk, right? Try commenting out the check for
> owner == null. Let me know how that goes.
> 
>> By the way, why does the function createDisplay() needs an AWT Window? we
>> are all using pivot Windows...
> 
> As I mentioned earlier, all Pivot windows live in an instance of Display
> that is hosted by a single native window (or applet), and are constrained
> to
> the bounds of that display. The createDisplay() method creates another
> Display (and corresponding native host window) on which Pivot windows can
> be
> opened. That native (AWT) window may or may not need a parent. It depends
> on
> the needs of your application.
> 
>> and why does it need a parent window at all?
> 
> It probably doesn't. I think the null check is invalid. Let me know what
> you
> find out.
> 
> 
> 


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2640586.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
I used Dialogs because they can be either modal or non-modal, whereas a Frame can only be non-modal.

On Mar 5, 2011, at 8:03 AM, Chris Bartlett wrote:

> 
> On 5 March 2011 14:48, mukadobo <mu...@gmail.com> wrote:
> I think whole state of affairs is because Pivot is using an extension of
> java.awt.Dialog (the HostDialog)  as the basis for the Display.  (Is this to
> make it work consistently between desktop and applet?).
> 
> I only started experimenting with multiple windows recently, and wondered the same thing.  I was expecting it to be a java.awt.Frame like the primary window.
> 
> Greg - Are there technical reasons why additional native windows are Dialogs rather than Frames?
> 
> Chris 


Re: How to open two windows

Posted by Chris Bartlett <cb...@gmail.com>.
On 5 March 2011 14:48, mukadobo <mu...@gmail.com> wrote:

> I think whole state of affairs is because Pivot is using an extension of
> java.awt.Dialog (the HostDialog)  as the basis for the Display.  (Is this
> to
> make it work consistently between desktop and applet?).
>

I only started experimenting with multiple windows recently, and wondered
the same thing.  I was expecting it to be a java.awt.Frame like the primary
window.

Greg - Are there technical reasons why additional native windows are Dialogs
rather than Frames?

Chris

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
Can you paste in the background of this thread? It's kind of hard to follow without it. Thanks.

On Mar 5, 2011, at 2:48 AM, mukadobo wrote:

> Not quite what I want...
> 
> I, too, can get multiple windows, and by sending a new java.awt.Frame as the
> owner argument to DesktopAplicationContext.createDisplay(...) I get a new
> window that stacks independently from my main application window
> &lt;hooray!>.
> 
> BUT - There is no minimization capability.   Not only can't I minimize the
> secondary display frame (not even programmatically, say within a button
> Action), it doesn't even "auto minimize" with the main application window
> (which makes sense since I'm specifically trying to avoid a parent
> relationship to eliminate stacking restrictions).  This leaves me with a
> "permanently raised" window on the screen (unless I close/terminate/kill
> it).  The best solution I constructed is to have an in-window button whose
> Action delegate does this:
> 
> ((MainWindow)
> source.getWindow()).getDisplay().getHostWindow().setVisible(false);
> 
> 
> (Which complifikates my application by requiring some other window, e.g. the
> "truly main window", to be able to turn the visibility back on.  I suppose
> this could be handled using a DisplayListener delegate - but that all seems
> so... well, complifikated... &lt;sigh>.)
> 
> I think whole state of affairs is because Pivot is using an extension of
> java.awt.Dialog (the HostDialog)  as the basis for the Display.  (Is this to
> make it work consistently between desktop and applet?).
> 
> Needless to say, the situation is quite annoying &lt;grrr>.  I have no
> concern about applets for this application (at least not yet).  I hope
> there's something I'm doing wrong or have missed or misunderstood or some
> secret sauce you can share...
> 
> TIA
> 
> PS - Despite this frustration, I'm liking Pivot very much.
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2637226.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: How to open two windows

Posted by mukadobo <mu...@gmail.com>.
Not quite what I want...

I, too, can get multiple windows, and by sending a new java.awt.Frame as the
owner argument to DesktopAplicationContext.createDisplay(...) I get a new
window that stacks independently from my main application window
&lt;hooray!>.

BUT - There is no minimization capability.   Not only can't I minimize the
secondary display frame (not even programmatically, say within a button
Action), it doesn't even "auto minimize" with the main application window
(which makes sense since I'm specifically trying to avoid a parent
relationship to eliminate stacking restrictions).  This leaves me with a
"permanently raised" window on the screen (unless I close/terminate/kill
it).  The best solution I constructed is to have an in-window button whose
Action delegate does this:

((MainWindow)
source.getWindow()).getDisplay().getHostWindow().setVisible(false);


(Which complifikates my application by requiring some other window, e.g. the
"truly main window", to be able to turn the visibility back on.  I suppose
this could be handled using a DisplayListener delegate - but that all seems
so... well, complifikated... &lt;sigh>.)

I think whole state of affairs is because Pivot is using an extension of
java.awt.Dialog (the HostDialog)  as the basis for the Display.  (Is this to
make it work consistently between desktop and applet?).

Needless to say, the situation is quite annoying &lt;grrr>.  I have no
concern about applets for this application (at least not yet).  I hope
there's something I'm doing wrong or have missed or misunderstood or some
secret sauce you can share...

TIA

PS - Despite this frustration, I'm liking Pivot very much.

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2637226.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
Done.

On Dec 6, 2010, at 3:49 PM, lello wrote:

> 
> Greg, you are perfectly right. I have just commented out the owner == null
> and the application works fine.
> I can move the windows in front or back as I like.
> Do you think this change can e made in the trunk?
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2029894.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: How to open two windows

Posted by lello <rb...@gmail.com>.
Greg, you are perfectly right. I have just commented out the owner == null
and the application works fine.
I can move the windows in front or back as I like.
Do you think this change can e made in the trunk?
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2029894.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
> The host window is on the back.
> If I pass null I get an Illegal Argument Exception.
> Tell me there is a solution...

You are building Pivot from trunk, right? Try commenting out the check for owner == null. Let me know how that goes.

> By the way, why does the function createDisplay() needs an AWT Window? we
> are all using pivot Windows...

As I mentioned earlier, all Pivot windows live in an instance of Display that is hosted by a single native window (or applet), and are constrained to the bounds of that display. The createDisplay() method creates another Display (and corresponding native host window) on which Pivot windows can be opened. That native (AWT) window may or may not need a parent. It depends on the needs of your application.

> and why does it need a parent window at all?

It probably doesn't. I think the null check is invalid. Let me know what you find out.


Re: How to open two windows

Posted by lello <rb...@gmail.com>.
The host window is on the back.
If I pass null I get an Illegal Argument Exception.
Tell me there is a solution...

By the way, why does the function createDisplay() needs an AWT Window? we
are all using pivot Windows...
and why does it need a parent window at all?
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2025791.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
What I meant was, are you seeing this behavior with the AWT host window or with a Pivot (internal) window. I assume the former.

When a Pivot window is opened with an owner, it always appears on top of its owner. Not sure what the defined AWT behavior is in this case. Did you try passing null for the owner argument?

On Dec 5, 2010, at 2:31 PM, lello wrote:

> 
> On the top of a pivot window, and I am opening it with modal=false.
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2023630.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: How to open two windows

Posted by lello <rb...@gmail.com>.
On the top of a pivot window, and I am opening it with modal=false.
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2023630.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
A Pivot window, or an AWT window? If the latter, are you opening it with modal = true?

On Dec 5, 2010, at 11:38 AM, lello wrote:

> 
> I managed to open a second window, but it always stays on the top of the
> first one. Is this behaviour normal?
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2022963.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: How to open two windows

Posted by lello <rb...@gmail.com>.
I managed to open a second window, but it always stays on the top of the
first one. Is this behaviour normal?
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2022963.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by lello <rb...@gmail.com>.
Thanks, I had completely missed the example.

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/How-to-open-two-windows-tp2022668p2022833.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
Note that opening multiple displays is only possible if you are deploying your application to the desktop. In a web browser, your application will still be constrained to the bounds of the applet. If you plan to deploy to the web as well, you are probably better off using a Sheet.

On Dec 5, 2010, at 10:47 AM, Greg Brown wrote:

>> in my application I need to open a second window, a dialog, but I don't like
>> the idea of having a dialog which ca be moved around only in the main
>> window. Is it possible to open two windows? 
> 
> Pivot windows are all contained within a single display. If you are using Pivot 2.0, you can open multiple displays, each of which is contained in a native host window. See this example:
> 
> http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/displays/multiple_display_example.bxml
> 
> Another option is to use a Sheet or Prompt instead of a Dialog or Alert. These windows still only exist within the Pivot display, but they can't be moved by the user, which may offer a better user experience depending on your needs.
> 
> G
> 
> 


Re: How to open two windows

Posted by Greg Brown <gk...@verizon.net>.
> in my application I need to open a second window, a dialog, but I don't like
> the idea of having a dialog which ca be moved around only in the main
> window. Is it possible to open two windows? 

Pivot windows are all contained within a single display. If you are using Pivot 2.0, you can open multiple displays, each of which is contained in a native host window. See this example:

http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/displays/multiple_display_example.bxml

Another option is to use a Sheet or Prompt instead of a Dialog or Alert. These windows still only exist within the Pivot display, but they can't be moved by the user, which may offer a better user experience depending on your needs.

G