Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [albireo-dev] How to paint parent SWT widget?

Hello,

Mark Millard wrote:
> I have a SwingControl that center's itself relative to the parent SWT
> Composite widget. The parent widget doesn't seem to get the SWT paint or
> resize event. How do I repaint the parent widget

I'm not sure I understand the question right. It appears to be a question
purely about SWT widgets.
  - Paint events are sent by SWT to the affected SWT control only, not
    to its parents (assuming the parent is opaque). If you want that
    notification, you'll have to add a PaintListener to the control
    explicitly.
  - Notification about resized controls happens like this: The code that
    changes the size of a Control is also responsible for picking one
    of the ancestor of the control and invoking
      ancestor.layout(new Control[] { control });
    on it. The control is not supposed to propagate its size changes to
    its parent automatically.

If this does not answer your question, you may give a code sample to
highlight what you mean.

Bruno


Back to the top