|
Re: SWT fullscreen [message #503942 is a reply to message #503799] |
Wed, 16 December 2009 10:08 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi,
I assume when you say "display" that you mean "monitor", as there's only one
Display ever used in your snippet. I don't currently have access to a Mac
with multiple monitors, but it sounds like a bug in swt, so I would suggest
logging a report at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=SWT .
The only workaround I can think of in the meantime is to create a Shell with
no trim and set its size to the monitor's size.
Grant
"larsk" <larsk7@gmail.com> wrote in message
news:hg8qdt$7fs$1@build.eclipse.org...
> I am writing an application that is supposed to open a window in
fullscreen. It works fine if I run it on the primary display. But if I open
it on any of the other displays the window does'nt turn fullscreen. I run it
on Mac OS 10.6 with SWT-cocoa64.
> Does anyone know how to solve this?
>
> package testApp;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.events.KeyAdapter;
> import org.eclipse.swt.events.KeyEvent;
> import org.eclipse.swt.events.KeyListener;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.events.SelectionListener;
>
> public class Main
> {
> Display display = new Display();
> Shell shell = new Shell(display);
> Button buttonOpen = new Button(shell, SWT.NONE);
> Button buttonClose = new Button(shell, SWT.NONE);
> Shell shellFS;
>
> public static void main(String[] args)
> {
> new Main();
> }
>
> Main()
> {
> shell.setBounds(150, 50, 800, 400);
>
> buttonOpen.setText("Open");
> buttonOpen.setLocation(40, 150);
> buttonOpen.pack();
> buttonOpen.addSelectionListener(openListener);
>
> buttonClose.setText("Close");
> buttonClose.setLocation(240, 150);
> buttonClose.pack();
> buttonClose.addSelectionListener(closeListener);
>
> shell.addKeyListener(closeFSWithQ);
> shell.open();
>
> while (!shell.isDisposed())
> {
> if (!display.readAndDispatch())
> display.sleep();
> }
> }
>
> SelectionListener openListener = new SelectionListener()
> {
> @Override
> public void widgetSelected(SelectionEvent event)
> {
> open();
> }
>
> @Override
> public void widgetDefaultSelected(SelectionEvent event)
> {
>
> }
> };
>
> SelectionListener closeListener = new SelectionListener()
> {
> @Override
> public void widgetSelected(SelectionEvent event)
> {
> shell.close();
> }
>
> @Override
> public void widgetDefaultSelected(SelectionEvent event)
> {
>
> }
> };
>
> KeyListener closeFSWithQ = new KeyAdapter()
> {
> @Override
> public void keyPressed(KeyEvent e)
> {
> if (e.keyCode == 113)
> {
> close();
> }
> }
> };
>
> void close()
> {
> shellFS.setFullScreen(false);
> shellFS.close();
> }
>
> void open()
> {
> shellFS = new Shell(display);
> shellFS.addKeyListener(closeFSWithQ);
> shellFS.setFullScreen(true);
> shellFS.open();
> }
> }
|
|
|
|
Re: SWT fullscreen [message #504560 is a reply to message #504441] |
Mon, 21 December 2009 14:25 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Yes, the trim is the top bar, resize handles, etc. Do this by creating the
Shell with style SWT.NO_TRIM or SWT.ON_TOP.
Grant
"larsk" <larsk7@gmail.com> wrote in message
news:hgiatb$b63$1@build.eclipse.org...
> Thanks for your answer!
> Yes, I mean monitor.
> What do you mean with "no trim"? Is that so the "bar" in the top
disappears? I that case how do I make this happen?
> Thanks!
>
> Grant Gayed wrote on Wed, 16 December 2009 11:08
> > Hi,
> >
> > I assume when you say "display" that you mean "monitor", as there's only
one
> > Display ever used in your snippet. I don't currently have access to a
Mac
> > with multiple monitors, but it sounds like a bug in swt, so I would
suggest
> > logging a report at
> > https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform
&component=SWT .
> > The only workaround I can think of in the meantime is to create a Shell
with
> > no trim and set its size to the monitor's size.
> >
> > Grant
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03277 seconds