Re: Control.setParent() under Windows [message #6771] |
Mon, 26 May 2008 09:02  |
Eclipse User |
|
|
|
If you don't get an answer here I can point you to the albeiro-newsgroup
which deals with Swing/AWT-SWT integration problems and people might
know more about the issues you can run into.
I would also suggest that your message title could have been better by
integrating Swing so people from this project skimming the newsgroups
take a look at your question.
I copied your request to this newsgroup.
See http://www.eclipse.org/albireo/
Tom
Magnus Konze schrieb:
> Sorry for pushing this topic. Perhaps my question was to detailed.
> Basically i'm interested with experiences with setParent() under
> Windows. So in short:
> Do i have to expect problems with setParent()? My application will only
> run under Windows systems.
> Regards Magnus
>
>
> Magnus Konze schrieb:
>> Hi!
>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>> When using the bridge in this direction the Swing Window has to be
>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>> created'-Exception.
>> So i have to call setVisible(), although i don't know the size of the
>> SWT-Controls.
>> Here is my idea:
>> - create a new Shell with the Controls i want to add to the Swing Window
>> - compute the Shells size
>> - setSize() on the Swing Window
>> - setVisible() on the Swing Window
>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>> - set this Shell as the parent of my SWT Controls
>> - dispose first Shell
>>
>> The first Shell is never opened!
>>
>> I'm using Windows XP and it works fine. So my question is:
>> Do i have to expect problems on other systems (especially other
>> Windows systems)? Are there other problems aside from that it's not
>> possible to change the parent on all systems?
>>
>> Regards Magnus
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
|
|
Re: Control.setParent() under Windows [message #6799 is a reply to message #6785] |
Mon, 02 June 2008 04:21  |
Eclipse User |
|
|
|
Yes, this is possible (it was my first approach), but it looks strange.
The Swing frame has to be visible before you can add SWT Components. So,
after calling setVisible() you can see an empty Window. After a moment
the SWT Components are added and the Window is resized... really an ugly
effect.
In my second approach (with reparenting) there is no resizing and the
SWT Components are added so fast, that you can't recognize the empty Window.
Regards
Magnus
Gordon Hirsch schrieb:
> Why do you need to reparent the shell at all? Couldn't you just resize
> the original Swing frame once the preferred size of the shell is known?
>
> Magnus Konze wrote:
>> Thank you very much!
>> Yes my problem is a very special one. It would be great, if anyone has
>> a solution for that.
>> But for now i'm generally interested in the reliability of
>> setParent(). If it isn't recommended even under Windows, i could
>> cancel my current approach.
>>
>> Magnus
>>
>> Tom Schindl schrieb:
>>> If you don't get an answer here I can point you to the
>>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>>> and people might know more about the issues you can run into.
>>>
>>> I would also suggest that your message title could have been better
>>> by integrating Swing so people from this project skimming the
>>> newsgroups take a look at your question.
>>>
>>> I copied your request to this newsgroup.
>>>
>>> See http://www.eclipse.org/albireo/
>>>
>>> Tom
>>>
>>> Magnus Konze schrieb:
>>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>>> Basically i'm interested with experiences with setParent() under
>>>> Windows. So in short:
>>>> Do i have to expect problems with setParent()? My application will
>>>> only run under Windows systems.
>>>> Regards Magnus
>>>>
>>>>
>>>> Magnus Konze schrieb:
>>>>> Hi!
>>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>>> When using the bridge in this direction the Swing Window has to be
>>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>>> created'-Exception.
>>>>> So i have to call setVisible(), although i don't know the size of
>>>>> the SWT-Controls.
>>>>> Here is my idea:
>>>>> - create a new Shell with the Controls i want to add to the Swing
>>>>> Window
>>>>> - compute the Shells size
>>>>> - setSize() on the Swing Window
>>>>> - setVisible() on the Swing Window
>>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>>> - set this Shell as the parent of my SWT Controls
>>>>> - dispose first Shell
>>>>>
>>>>> The first Shell is never opened!
>>>>>
>>>>> I'm using Windows XP and it works fine. So my question is:
>>>>> Do i have to expect problems on other systems (especially other
>>>>> Windows systems)? Are there other problems aside from that it's not
>>>>> possible to change the parent on all systems?
>>>>>
>>>>> Regards Magnus
>>>
>>>
|
|
|
Re: Control.setParent() under Windows [message #574086 is a reply to message #6771] |
Mon, 26 May 2008 11:08  |
Eclipse User |
|
|
|
Thank you very much!
Yes my problem is a very special one. It would be great, if anyone has a
solution for that.
But for now i'm generally interested in the reliability of setParent().
If it isn't recommended even under Windows, i could cancel my current
approach.
Magnus
Tom Schindl schrieb:
> If you don't get an answer here I can point you to the albeiro-newsgroup
> which deals with Swing/AWT-SWT integration problems and people might
> know more about the issues you can run into.
>
> I would also suggest that your message title could have been better by
> integrating Swing so people from this project skimming the newsgroups
> take a look at your question.
>
> I copied your request to this newsgroup.
>
> See http://www.eclipse.org/albireo/
>
> Tom
>
> Magnus Konze schrieb:
>> Sorry for pushing this topic. Perhaps my question was to detailed.
>> Basically i'm interested with experiences with setParent() under
>> Windows. So in short:
>> Do i have to expect problems with setParent()? My application will
>> only run under Windows systems.
>> Regards Magnus
>>
>>
>> Magnus Konze schrieb:
>>> Hi!
>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>> When using the bridge in this direction the Swing Window has to be
>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>> created'-Exception.
>>> So i have to call setVisible(), although i don't know the size of the
>>> SWT-Controls.
>>> Here is my idea:
>>> - create a new Shell with the Controls i want to add to the Swing Window
>>> - compute the Shells size
>>> - setSize() on the Swing Window
>>> - setVisible() on the Swing Window
>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>> - set this Shell as the parent of my SWT Controls
>>> - dispose first Shell
>>>
>>> The first Shell is never opened!
>>>
>>> I'm using Windows XP and it works fine. So my question is:
>>> Do i have to expect problems on other systems (especially other
>>> Windows systems)? Are there other problems aside from that it's not
>>> possible to change the parent on all systems?
>>>
>>> Regards Magnus
>
>
|
|
|
Re: Control.setParent() under Windows [message #574109 is a reply to message #6778] |
Tue, 27 May 2008 13:54  |
Eclipse User |
|
|
|
Why do you need to reparent the shell at all? Couldn't you just resize
the original Swing frame once the preferred size of the shell is known?
Magnus Konze wrote:
> Thank you very much!
> Yes my problem is a very special one. It would be great, if anyone has a
> solution for that.
> But for now i'm generally interested in the reliability of setParent().
> If it isn't recommended even under Windows, i could cancel my current
> approach.
>
> Magnus
>
> Tom Schindl schrieb:
>> If you don't get an answer here I can point you to the
>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>> and people might know more about the issues you can run into.
>>
>> I would also suggest that your message title could have been better by
>> integrating Swing so people from this project skimming the newsgroups
>> take a look at your question.
>>
>> I copied your request to this newsgroup.
>>
>> See http://www.eclipse.org/albireo/
>>
>> Tom
>>
>> Magnus Konze schrieb:
>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>> Basically i'm interested with experiences with setParent() under
>>> Windows. So in short:
>>> Do i have to expect problems with setParent()? My application will
>>> only run under Windows systems.
>>> Regards Magnus
>>>
>>>
>>> Magnus Konze schrieb:
>>>> Hi!
>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>> When using the bridge in this direction the Swing Window has to be
>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>> created'-Exception.
>>>> So i have to call setVisible(), although i don't know the size of
>>>> the SWT-Controls.
>>>> Here is my idea:
>>>> - create a new Shell with the Controls i want to add to the Swing
>>>> Window
>>>> - compute the Shells size
>>>> - setSize() on the Swing Window
>>>> - setVisible() on the Swing Window
>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>> - set this Shell as the parent of my SWT Controls
>>>> - dispose first Shell
>>>>
>>>> The first Shell is never opened!
>>>>
>>>> I'm using Windows XP and it works fine. So my question is:
>>>> Do i have to expect problems on other systems (especially other
>>>> Windows systems)? Are there other problems aside from that it's not
>>>> possible to change the parent on all systems?
>>>>
>>>> Regards Magnus
>>
>>
|
|
|
Re: Control.setParent() under Windows [message #574157 is a reply to message #6785] |
Mon, 02 June 2008 04:21  |
Eclipse User |
|
|
|
Yes, this is possible (it was my first approach), but it looks strange.
The Swing frame has to be visible before you can add SWT Components. So,
after calling setVisible() you can see an empty Window. After a moment
the SWT Components are added and the Window is resized... really an ugly
effect.
In my second approach (with reparenting) there is no resizing and the
SWT Components are added so fast, that you can't recognize the empty Window.
Regards
Magnus
Gordon Hirsch schrieb:
> Why do you need to reparent the shell at all? Couldn't you just resize
> the original Swing frame once the preferred size of the shell is known?
>
> Magnus Konze wrote:
>> Thank you very much!
>> Yes my problem is a very special one. It would be great, if anyone has
>> a solution for that.
>> But for now i'm generally interested in the reliability of
>> setParent(). If it isn't recommended even under Windows, i could
>> cancel my current approach.
>>
>> Magnus
>>
>> Tom Schindl schrieb:
>>> If you don't get an answer here I can point you to the
>>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>>> and people might know more about the issues you can run into.
>>>
>>> I would also suggest that your message title could have been better
>>> by integrating Swing so people from this project skimming the
>>> newsgroups take a look at your question.
>>>
>>> I copied your request to this newsgroup.
>>>
>>> See http://www.eclipse.org/albireo/
>>>
>>> Tom
>>>
>>> Magnus Konze schrieb:
>>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>>> Basically i'm interested with experiences with setParent() under
>>>> Windows. So in short:
>>>> Do i have to expect problems with setParent()? My application will
>>>> only run under Windows systems.
>>>> Regards Magnus
>>>>
>>>>
>>>> Magnus Konze schrieb:
>>>>> Hi!
>>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>>> When using the bridge in this direction the Swing Window has to be
>>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>>> created'-Exception.
>>>>> So i have to call setVisible(), although i don't know the size of
>>>>> the SWT-Controls.
>>>>> Here is my idea:
>>>>> - create a new Shell with the Controls i want to add to the Swing
>>>>> Window
>>>>> - compute the Shells size
>>>>> - setSize() on the Swing Window
>>>>> - setVisible() on the Swing Window
>>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>>> - set this Shell as the parent of my SWT Controls
>>>>> - dispose first Shell
>>>>>
>>>>> The first Shell is never opened!
>>>>>
>>>>> I'm using Windows XP and it works fine. So my question is:
>>>>> Do i have to expect problems on other systems (especially other
>>>>> Windows systems)? Are there other problems aside from that it's not
>>>>> possible to change the parent on all systems?
>>>>>
>>>>> Regards Magnus
>>>
>>>
|
|
|
Powered by
FUDForum. Page generated in 0.27922 seconds