|
Re: How can I create a "Group" with no space for the title? [message #467177 is a reply to message #467173] |
Thu, 26 January 2006 05:31 |
Edward Kuns Messages: 14 Registered: July 2009 |
Junior Member |
|
|
I found part of a custom answer by fiddling -- I have the following
Listener and I add an instance of this listener for Event SWT.Paint to
every Composite that I want to have a border around it.
public final class GroupBorderPainter implements Listener {
public void handleEvent(Event e) {
Composite composite = (Composite) e.widget;
Point size = composite.getSize();
GC gc = e.gc;
gc.setForeground(black);
gc.drawRoundRectangle(0, 0, size.x-1, size.y-1, 10, 10);
}
}
where "black" is formed by:
black = new Color(display, new RGB(0,0,0));
Is this a reasonable way to go about this? Is this guaranteed to be
stable across mouse and keyboard actions, redraws, and so on?
There is only one problem with this, which is that I want to set the
area outside the border to the background color of the parent, not leave
it at the background color of the Composite.
Thanks,
Eddie
|
|
|
Powered by
FUDForum. Page generated in 0.03622 seconds