How to show an non-rectangular window in task bar [message #442656] |
Fri, 10 September 2004 01:20 |
Eclipse User |
|
|
|
Originally posted by: lwj.hz.cn
When I tried to create an non-rectangular window with a statement like
"Shell shell = new Shell(display, SWT.NO_TRIM)", although it works but
didn't show in the windows' task bar. How can I make it possible?
|
|
|
|
Re: How to show an non-rectangular window in task bar [message #442700 is a reply to message #442670] |
Sun, 12 September 2004 03:11 |
lwj Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Thanks for your post. Maybe I can describe the problem with the sample
codes listed below.
The only thing I want is that This application should show in the windows
task bar just like other application windows.
Anyone can help me?
////////////////////////////////////////////////////
/*
* Created on 2004-9-10
*
*/
package snippets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.Region;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* @author lvweijian
*
*/
public class TestNoneRectangleWindow {
public static void main(String[] args) {
TestNoneRectangleWindow window = new TestNoneRectangleWindow();
window.open();
}
public void open() {
final Display display = new Display();
final Shell shell = new Shell(display, SWT.NO_TRIM);
shell.setText("SWT Application");
Region region = new Region();
region.add(new int[]{100,0,200,150,0,150});
shell.setRegion(region);
shell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BA CKGROUND));
shell.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
shell.close();
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
}
}
///////////////////////////////////////////////////////
Steve Northover wrote:
> Did you call shell.open() or shell.setVisible()? Did you call
> Shell.setText()? If your the parent of your shell is another shell, it
> won't show up.
> "lvweijian" <lwj@hz.cn> wrote in message news:chqval$icv$1@eclipse.org...
> > When I tried to create an non-rectangular window with a statement like
> > "Shell shell = new Shell(display, SWT.NO_TRIM)", although it works but
> > didn't show in the windows' task bar. How can I make it possible?
> >
> >
|
|
|
Re: How to show an non-rectangular window in task bar [message #442803 is a reply to message #442700] |
Mon, 13 September 2004 17:05 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
WORKSFORME.
I see an item in the task bar called 'SWT Application'. Are you running
3.0?
"lwj" <lvweijian@hz.cn> wrote in message news:ci0epn$dei$1@eclipse.org...
> Thanks for your post. Maybe I can describe the problem with the sample
> codes listed below.
> The only thing I want is that This application should show in the windows
> task bar just like other application windows.
> Anyone can help me?
>
>
> ////////////////////////////////////////////////////
> /*
> * Created on 2004-9-10
> *
> */
> package snippets;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.events.MouseAdapter;
> import org.eclipse.swt.events.MouseEvent;
> import org.eclipse.swt.graphics.Region;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> /**
> * @author lvweijian
> *
> */
> public class TestNoneRectangleWindow {
>
> public static void main(String[] args) {
> TestNoneRectangleWindow window = new TestNoneRectangleWindow();
> window.open();
> }
>
> public void open() {
> final Display display = new Display();
> final Shell shell = new Shell(display, SWT.NO_TRIM);
> shell.setText("SWT Application");
> Region region = new Region();
> region.add(new int[]{100,0,200,150,0,150});
> shell.setRegion(region);
>
> shell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BA CKGROUND));
>
> shell.addMouseListener(new MouseAdapter() {
>
> public void mouseDoubleClick(MouseEvent e) {
> shell.close();
> }
> });
>
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) display.sleep();
> }
> }
> }
>
>
> ///////////////////////////////////////////////////////
>
> Steve Northover wrote:
>
> > Did you call shell.open() or shell.setVisible()? Did you call
> > Shell.setText()? If your the parent of your shell is another shell, it
> > won't show up.
>
> > "lvweijian" <lwj@hz.cn> wrote in message
news:chqval$icv$1@eclipse.org...
> > > When I tried to create an non-rectangular window with a statement like
> > > "Shell shell = new Shell(display, SWT.NO_TRIM)", although it works but
> > > didn't show in the windows' task bar. How can I make it possible?
> > >
> > >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03371 seconds