|
Re: Custom-Drawing in first Tree-Column problem on Windows [message #655817 is a reply to message #655126] |
Tue, 22 February 2011 16:53 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Manuel,
This is probably a bug that could be fixed in swt, so feel free to log a
report at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=SWT
and provide the snippet from this post.
In the meantime, a workaround you could use would be to detect this case and
redraw the first column, like the lines I've pasted below. If your real
case resembles the snippet you've provided then this should work reasonably
well.
/* work around swt bug... */
if (SWT.getPlatform().equals("win32")) {
tree.getColumn(0).addListener(SWT.Resize, new Listener() {
public void handleEvent(Event event) {
tree.getDisplay().asyncExec(new Runnable() {
public void run() {
if (tree.isDisposed()) return;
/* assumes logical column 0 is also first physical
column */
tree.redraw(0, 0, tree.getColumn(0).getWidth(),
tree.getBounds().height, true);
}
});
}
});
}
HTH,
Grant
"Manuel Steurer" <manuel.steurer@quattro-soft.de> wrote in message
news:ijlom1$j40$1@news.eclipse.org...
> Hi,
>
> I've modified the SWT Snippet 230 to use a Tree instead of a Table and
> also mixed in the drawing logic from Jface Snippet 51 to draw an image
> in the center of each column, see attached snippet. When you resize the
> columns the Image moves along with it in all columns but the first.
> Once you "dip" the window outside the screen and get it back it is
> correctly painted.
>
> The problem does not exist on Linux, and also not when using a Table
> instead of a Tree.
>
> Is this a known Windows bug I have to live with or is this something
> that can be fixed in SWT?
>
> Greetings,
> Manuel
>
|
|
|
Re: Custom-Drawing in first Tree-Column problem on Windows [message #655977 is a reply to message #655817] |
Wed, 23 February 2011 15:35 |
Manuel Steurer Messages: 37 Registered: July 2009 |
Member |
|
|
Hi,
thanks for your answer, I tried the workaround and it works for me.
I also logged this bug report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337985
Greetings,
Manuel
Grant Gayed wrote:
> Hi Manuel,
>
> This is probably a bug that could be fixed in swt, so feel free to
> log a report at
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component
> =SWT and provide the snippet from this post.
>
> In the meantime, a workaround you could use would be to detect this
> case and redraw the first column, like the lines I've pasted below.
> If your real case resembles the snippet you've provided then this
> should work reasonably well.
>
> /* work around swt bug... */
> if (SWT.getPlatform().equals("win32")) {
> tree.getColumn(0).addListener(SWT.Resize, new Listener() {
> public void handleEvent(Event event) {
> tree.getDisplay().asyncExec(new Runnable() {
> public void run() {
> if (tree.isDisposed()) return;
> /* assumes logical column 0 is also first physical
> column */ tree.redraw(0, 0,
> tree.getColumn(0).getWidth(), tree.getBounds().height, true);
> } });
> }
> });
> }
>
> HTH,
> Grant
>
>
> "Manuel Steurer" <manuel.steurer@quattro-soft.de> wrote in message
> news:ijlom1$j40$1@news.eclipse.org...
> > Hi,
> >
> > I've modified the SWT Snippet 230 to use a Tree instead of a Table
> > and also mixed in the drawing logic from Jface Snippet 51 to draw
> > an image in the center of each column, see attached snippet. When
> > you resize the columns the Image moves along with it in all columns
> > but the first. Once you "dip" the window outside the screen and
> > get it back it is correctly painted.
> >
> > The problem does not exist on Linux, and also not when using a Table
> > instead of a Tree.
> >
> > Is this a known Windows bug I have to live with or is this something
> > that can be fixed in SWT?
> >
> > Greetings,
> > Manuel
> >
--
|
|
|
Powered by
FUDForum. Page generated in 0.02638 seconds