Hi again,
On 01/04/2013 07:29 PM, Sandro Martini wrote:
I'm also still confused about pivot Windows. These seem to be a strange mix
between a 'virtual desktop' and an actual window, eg if I extend a Hello
World example with "window.setPreferredSize(200,500)" I'm getting strange
results. The *window* isn't resized, but the way the Label is displayed
inside the window is affected by this. Manually resizing the window by
dragging the bottom right corner on the other hand seems to be have just as
you would expect.
I understand, I try to explain:
- Window is a Top-level container representing the entry point into a
user interface.
Windows are direct descendants of the display.
- otherwise for a typical desktop application you could use: Frame
(which extends Window) has an empty menu bar, etc ...
Ah, so a wtk.Window "runs inside" a wtk.Display, which represents an
awt.Frame or awt.Dialog (in the desktop case).... I see.
I've read the links you provided. I personally think that
DesktopApplicationContext.createDisplay() is slightly inconvenient because:
1) It's based on a DesktopApplicationContext.HostDialog, which extends
awt.Dialog, which, as somebody else already mentioned in 2010 does not
have minimize/maximize buttons etc. Instead there should be a version
that is based on an awt.Frame.
2) You still need to manually create an awt.Frame/Dialog first to have
createDisplay() create, on top of that, another awt.Dialog...
There's also some considerations about splash screens and fullscreen
mode that I haven't looked at yet.
Last, to open more windows (like a Window and an Alert), in some cases
you should instead use the following extension of Pivot:
http://code.google.com/a/apache-extras.org/p/pivot-contrib/wiki/GuretzkiFeatures
-- this was a candidate to be included in Pivot core (2.1 or later),
but we have to hear from the original author, get an ICLA from he, do
a vote, etc ...
Yeah, I had a look at that. Seems a little bit of a kludge to me to be
honest. If I understand the proposed feature correctly, this is really
about being able to present a dialog to the user which can be placed
outside of the wtk.Display. But from the screenshot it still looks like
the full rendering of the decorations is done by Pivot, which makes
sense in a Browser Context, but not so much in a Desktop context.
In fact, in a Desktop Context I would expect *any* dialog/prompt/alert
to be opened in a awt.Dialog-like 'window', which native OS window
decorations etc.
Finally, and I don't know if this is a bug or not, but if I create 2 windows
and call window.close() on one of them, pivot closes both windows instead
and my application exits.
for this I have to look ... but for previous reasons I don't think it's a bug.
Roger, have you never seen this ?
Hmmm, maybe the call to System.exit(0) in
DesktopApplicationContext.HostFrame.processWindowEvent() for the
WindowEvent.WINDOW_CLOSED case? ;-)
yes, could be good ... I know that the great Griffon framework has a
Pivot Builder, but don't know if it's still updated.
Ah, didn't know about that one. Trying to reach the original author of
that one. Seems that there have been no updates to that since 2010 though...
On the implementation side of such a PivotBuilder, I don't have any specific
ideas yet. I know I don't particularly like using DesktopApplicationContext,
it doesn't seem to fit the model very well to me (but again I need to look
deeper into this). So any suggestions would be appreciated.
ok, but I know very little on Groovy Builders, probably it would be
better for us to update on this after some study time :-) ...
Oh, I wasn't expecting groovy-specific suggestions :) I'm mainly looking
for suggestions on:
(1) how to avoid any calls to Class.forName() anywhere
(2) how to create top-level windows/dialogs/alerts/etc that have a
behavior that is familiar to desktop GUI programmers, eg more in the
line of how awt.Frame/Dialog behave.
I suspect that (1) would require extensions to the
DesktopApplicationContext class. For (2), that would basically mean that
whenever a wtk.Dialog/Window is opened, a n native awt.Dialog/Frame is
created which is then used as the Display for the wtk.Display/Window.
All controlled by some configuration option of course so as not to break
backwards compatibility.
Note that if you want, I could grant you write access to one of our
secondary projects (like a sandbox) for example here:
http://code.google.com/a/apache-extras.org/p/pivot-contrib/ and work
in a dedicated subproject (I can do the initial setup of an eclipse
project (you like pivot-groovy-builder ?) with Groovy support, and
references to latest released Pivot jars). I only need your Google
account name (and of course you have to follow usual rules for open
source software at Apache), you can send me via private email if you
want. So we could make some experiments there and maybe see later what
to do with that code. Let's update. Bye, Sandro
Oh, that's really not necessary at this point :)
Maarten