|
|
|
|
|
| Re: Howto dispose an MWindow? [message #959107 is a reply to message #959066] |
Fri, 26 October 2012 09:01   |
Thomas Schindl Messages: 4462 Registered: July 2009 |
Senior Member |
|
|
So you are saying that toBeRendered(false) is only making the Shell
invisible (visible=false)? I would expect toBeRendered to dispose the
resource (=shell).
Remembering the current position makes sense, because the MWindow stays
part of the workbench model and so opens on the next time at the old
position. So if you also want to wipe it from the model you need to
remove it from there manually!
IMHO toBeRendered=false should (and does) dispose the underlying shell.
Tom
Am 26.10.12 14:31, schrieb Alex Kipling:
> The difference is in different window behaviour:
>
> When I use toBeRendered(false), then the Windows remembers its last
> position, when it reapears.
> It won't happen, when closing Windows by the shell-close-button.
>
>
> The other difference is in code:
> When I close the Window by the ShellButton, the shell is disposed, so I
> have to restructure my code, to recreate the Window, when it should
> reapear.
>
> The toBeRendered(false) doesnt dispose teh window, so I doesnt't have to
> recreate the Window on toBeRendered(false).
|
|
|
| Re: Howto dispose an MWindow? [message #959229 is a reply to message #959107] |
Fri, 26 October 2012 10:59   |
Alex Kipling Messages: 211 Registered: July 2012 |
Senior Member |
|
|
I keep a pointer to the Window, and a MWindow still exists, after doing "toBeRendered(false)".
I do not know, if the undelying shell still exists, but I guess so.
I guess so, because of the following effect:
When doing "toBeRendered(false); toBeRendered(true)" - the MWindow disapears and reapears without any problems.
When doing "push-close-button; toBeRendered(true)" - the MWindow disapears and do not reapears. The MWindow still exists, so I guess that the underlying shell is disposed.
[Updated on: Fri, 26 October 2012 11:00] Report message to a moderator
|
|
|
| Re: Howto dispose an MWindow? [message #959291 is a reply to message #959229] |
Fri, 26 October 2012 11:47  |
Thomas Schindl Messages: 4462 Registered: July 2009 |
Senior Member |
|
|
Yes as I said the model element of course is not remove at all but the
SWT-Control is disposed!
I think we here have a misunderstanding on what dispose means. In my
think you can only dispose SWT-Resources and not Model-Objects.
Model-Objects are not disposed but if not needed any more they are
simply removed from the Application Model.
Setting toBeRendered=true:
* does dispose the native resource (SWT-Shell)
* does not remove the model element from the application model
=> if you want to have your additional window to get remove completley
you need to remove it also from the model by calling
((MElementContainer)window.eContainer()).getChildren().remove(window)
Tom
Am 26.10.12 16:59, schrieb Alex Kipling:
> I keep a pointer to the Window, and a MWindow still exists, after doing
> "toBeRendered(false)".
>
> I do not know, if the undelying shell still exists, but I guess so.
>
> I guess so, because of the following effect:
> When doing "toBeRendered(false); toBeRendered(true)" - the MWindow
> disapears and reapears without any problems.
> When doing "push-close-button; toBeRendered(true)" - the MWindow
> disapears and do not reapears. The MWindow still exists, so I guess that
> the underlying shell is disposed.
>
>
> because when I close the MWindow-Shell by pushing the close
> Shell-Close-button the
|
|
|
Powered by
FUDForum. Page generated in 0.02488 seconds