|
Re: Background application is getting activated. [message #482926 is a reply to message #482862] |
Fri, 28 August 2009 14:48 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Raghava,
That shouldn't happen, I don't know what swt would be doing to cause that.
Does the snippet below show the problem? And if not, can you change it to
make it show the problem? And which platform are you on?
public static void main (String [] args) {
final Display display = new Display ();
final Shell shell = new Shell (display);
shell.setLayout(new GridLayout(2, true));
// left pane
final Tree tree = new Tree(shell, SWT.NONE);
// right pane
final Composite composite = new Composite(shell, SWT.NONE);
composite.setLayout(new StackLayout());
new Label(composite, SWT.BORDER).setText("zero");
new Button(composite, SWT.PUSH).setText("one");
new Text(composite, SWT.SINGLE).setText("two");
new Combo(composite, SWT.NONE).setText("three");
// init tree
for (int i = 0; i < composite.getChildren().length; i++) {
new TreeItem(tree, SWT.NONE).setText("item " + i);
}
tree.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
int index = tree.indexOf(tree.getSelection()[0]);
((StackLayout)composite.getLayout()).topControl =
composite.getChildren()[index];
composite.layout();
}
});
((StackLayout)composite.getLayout()).topControl =
composite.getChildren()[0];
shell.pack();
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
Grant
"Raghava Rao" <raghavadasyam@gmail.com> wrote in message
news:2abd4d154ab01e857f8a38df2e4c45fa$1@www.eclipse.org...
> Hello All,
>
> I created two views in workbecnappilcation.
>
> Based on selection in first view ,Some UI controls will be created in
> other view.
>
> While switching selection between the tree items in first view,some times
> Back ground application is getting activated.i.e wat ever i sthere in back
> ground window gets activated.
>
> please suggest me to avoid above behaviour.
>
> Advance thanks for you reply.
>
> Thanks,
> Raghava
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02204 seconds