Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to show an non-rectangular window in task bar
How to show an non-rectangular window in task bar [message #442656] Fri, 10 September 2004 01:20 Go to next message
Eclipse UserFriend
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 #442670 is a reply to message #442656] Fri, 10 September 2004 15:58 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
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 #442700 is a reply to message #442670] Sun, 12 September 2004 03:11 Go to previous messageGo to next message
lwj is currently offline lwjFriend
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 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
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?
> > >
> > >
>
>
Previous Topic:I want to use Swing on my PocketPC.
Next Topic:Caret at beginning of text selection
Goto Forum:
  


Current Time: Tue Apr 23 16:02:23 GMT 2024

Powered by FUDForum. Page generated in 0.03371 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top