GtkComponentPeer realization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mark,


> OK, I see now where the trouble comes from. In GtkComponentPeer
> constructor we have:
> 
>     // Only set our parent on the GTK side if our parent on the AWT
>     // side is not showing.  Otherwise the gtk peer will be shown
>     // before we've had a chance to position and size it properly.
>     if (awtComponent instanceof Window
>         || (parent != null && ! parent.isShowing ()))
>       setParentAndBounds ();
> 
> So if a component is added to an already showing Container its parent is
> not set. We try to set it later in GtkContainerPeer.endValidate(). But
> 1) There is a small bug that doesn't setParentAndBounds for direct
> children of a Window. (That is easily fixed though.)
> 2) That only works if the Container is actually revalidated before the
> just added Component is painted.
> 
> I don't see how/if 2) ever happens/should happen after a
> Container.add(Component). The Container is invalid after an add().
> When/Where should validate[Tree]() be called after a new component has
> been added?

This is not performed automatically in AWT. We used to do it in
setVisible somewhere if I remember correctly, but tests have shown that
this is not right (and in fact leads to strange interactions with Swing,
where we _do_ perform validation automatically). The GTK peers therefore
should initialize correctly even when the component is not validated and
not try to defer things. (Actually, the AWT itself defers initialization
of the peers themselves, they are not created with the component, but
instead when the component receives a call to addNotify).

I hope this helps,
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://developer.classpath.org/pipermail/classpath/attachments/20060220/c5a745bd/attachment.pgp

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux