[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How to make SWT application appear in task bar on Windows XP

Thanks Steve

You are right, also I figured out that all I had to do was pass a null to ApplicationWindow constructor, it would internally create a top level shell for me if one is not already there.

this was a classic case of RTFM, sorry to bother you and thanks for all your help.

-daya

Steve Northover wrote:

The problem is that the shell in the first example is a dialog shell (a
shell whose parent is another shell).  Dialog shells don't appear in the
task list.

"Daya Sharma" <daya.sharma@xxxxxxxxx> wrote in message
news:ct3b2h$77c$1@xxxxxxxxxxxxxxxxxx
Hi Steve

My main class extends org.eclipse.jface.window.ApplicationWindow which
accepts a shell parameter in its constructor and doesn't give me much
control in terms of taskbar. Here is the code snippet...

public class BaseJFace extends ApplicationWindow {

    public static void main(String[] args) {
        final Display display = Display.getDefault();
        shell = new Shell(display);
        // I can add the TrayItem code here....
        BaseJFace baseJFace = new BaseJFace(shell);
        baseJFace.setBlockOnOpen(true);
        baseJFace.open();
        display.dispose();
    }

    public BaseJFace(Shell shell) {
        super(shell);
    }

.
.
.
}

However if I do something like this

Display display = new Display();

Image large = new Image(display, 32, 32);

gc = new GC(large);
gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
gc.fillArc(0, 0, 32, 32, 45, 270);
gc.dispose();


Shell shell = new Shell(display); shell.setText("Large icons"); shell.setImages(new Image[] {large});


shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); }

I can see the shell in taskbar, the key difference here is shell.open().

So my understanding is that the ApplicationWindow creates a new instance
of shell somewhere and since the parent shell was never opened, it doesn't
show up in the taskbar.

Lemme know yor thoughts...

-daya


Steve Northover wrote:

> Don't use the system tray.  Do you have a small stand alone snippet that
> shows the problem?

> "Day" <daya.sharma@xxxxxxxxx> wrote in message
> news:csrrdp$3uj$1@xxxxxxxxxxxxxxxxxx
>> Hi All
>>
>> I have developed a SWT application. When I run it I donot see it in the
>> Windows Task Bar, the only way I can see the application is using
ALT-TAB
>> keys or if code specifically for a system tray item.
>>
>>         final Tray tray = Display.getDefault().getSystemTray();
>>         trayItem = new TrayItem(tray, SWT.Show);
>>
>>
>> But using system tray item as the primary indicator for a running
>> application is just not feasible.
>>
>> Can anyone please help me?
>>
>> thanks
>>
>> -daya
>>
>>