NEWT : dialog frame and transparent frame

classic Classic list List threaded Threaded
8 messages Options
DAO
Reply | Threaded
Open this post in threaded view
|

NEWT : dialog frame and transparent frame

DAO
Hello (again)

I am trying to make somekind of tooltip effect (using NEWT).

So far I made a new frame undecorated over the main frame and display what I want in it.
But I still have 2 problems :

- first it has it's own button in the system toolbar which I don't want, it should be a child of the main frame. like a dialog frame, they don't have any system bar button associated either.

- second, the frame is opaque, I am displaying a small icon (a warning/alert/ok icon) but it doesn't make very nice since the background of my tooltip frame is not transparent. The doc says it's possible (http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/newt/Window.html)
but I haven't found any method to achieve this.
Maybe it's my system too, i don't know ?it's XFCE 4.10.

Any solutions ?

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

gouessej
Administrator
NEWT is very basic, it is not intended to replace Swing. I advise you again to use an higher level third party library for GUIs, for example Ardor3D UI or LibGDX Scene2D.
Julien Gouesse | Personal blog | Website
DAO
Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

DAO
I am not using swing,awt or swt, only newt.
i draw the components myself with shaders.
Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

Sven Gothel
Administrator
On 06/25/2013 02:18 PM, DAO [via jogamp] wrote:
> I am not using swing,awt or swt, only newt.
> i draw the components myself with shaders.
>

If you do all of that in OpenGL,
you only need one GLDrawable and do all your overlaying
via OpenGL .. using RGBA .. etc.

~Sven



signature.asc (911 bytes) Download Attachment
DAO
Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

DAO
I could render it in the same GLDrawable.

But sometimes the tooltip size makes it go out of the frame.
So I would prefer to have a separate frame for it otherwise when I have a small frame the tooltips might not be visible.

So how can I make the NEWT frame translucent and child of another frame ?
Are any of those possible ?
Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

Sven Gothel
Administrator
On 06/25/2013 04:53 PM, DAO [via jogamp] wrote:
> I could render it in the same GLDrawable.
>
> But sometimes the tooltip size makes it go out of the frame.
> So I would prefer to have a separate frame for it otherwise when I have a
> small frame the tooltips might not be visible.
>
> So how can I make the NEWT frame translucent and child of another frame ?
> Are any of those possible ?

Have a look at the unit tests. We also have a translucent applet
on the test web page.

Basically you set opaque=false and no decorations for the NEWT frame,
then use RGBA8888 caps. Thats it.

~Sven



signature.asc (911 bytes) Download Attachment
DAO
Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

DAO
setBackgroundOpaque on GLCapabilities.
took me some time to find it.

Also the clear color must be set to (0,0,0,0) if anything else with a 0 alpha it makes somekind
of foggy translucent background. don't know if it's a bug.


Thanks it works great.

I real like this NEWT framework, no bugs so far and easy to use.
Everything we need of an OpenGL frame.

Keep it simple that's great.

Reply | Threaded
Open this post in threaded view
|

Re: NEWT : dialog frame and transparent frame

gouessej
Administrator
DAO wrote
Also the clear color must be set to (0,0,0,0) if anything else with a 0 alpha it makes somekind
of foggy translucent background. don't know if it's a bug.
No it is the expected behavior.
Julien Gouesse | Personal blog | Website