Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Mouse cursor
Mouse cursor [message #445230] Fri, 29 October 2004 09:57 Go to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
Hi!

I have an application where I change the mouse cursor to SWT.CURSOR_WAIT
while information is being gathered from a database. When the retrieval is
done, I'm setting the cursor to SWT.CURSOR_ARROW. But after this is done,
the cursor does not change look when I for example hoover the cursor over a
Sash. Question is, how do I reset the cursor to 'default' behaviour ?

Thanks.

/Henrik
Re: Mouse cursor [message #445255 is a reply to message #445230] Fri, 29 October 2004 18:03 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
In which widget are you changing the cursor?

"Henrik Skovgaard" <hsk@reklamedata.dk.no.spam> wrote in message
news:clt471$php$1@eclipse.org...
> Hi!
>
> I have an application where I change the mouse cursor to SWT.CURSOR_WAIT
> while information is being gathered from a database. When the retrieval is
> done, I'm setting the cursor to SWT.CURSOR_ARROW. But after this is done,
> the cursor does not change look when I for example hoover the cursor over
a
> Sash. Question is, how do I reset the cursor to 'default' behaviour ?
>
> Thanks.
>
> /Henrik
>
>
Re: Mouse cursor [message #445268 is a reply to message #445255] Mon, 01 November 2004 07:53 Go to previous messageGo to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:clu0kq$ito$1@eclipse.org...
> In which widget are you changing the cursor?

I'm changing it on the Shell.

/Henrik
Re: Mouse cursor [message #445275 is a reply to message #445268] Mon, 01 November 2004 14:31 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
If you disable the shell then set the cursor, it will change for every
control in the shell. The way that cursors work is that if a control
defines a cursor, that cursor is used. Otherwise, the inherited cursor is
used. When a control is disabled, the cursor of the parent is used.

"Henrik Skovgaard" <hsk@reklamedata.dk.no.spam> wrote in message
news:cm4q1p$j2f$1@eclipse.org...
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:clu0kq$ito$1@eclipse.org...
> > In which widget are you changing the cursor?
>
> I'm changing it on the Shell.
>
> /Henrik
>
>
Re: Mouse cursor [message #445278 is a reply to message #445275] Mon, 01 November 2004 15:02 Go to previous messageGo to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cm5hc5$i4v$1@eclipse.org...
> If you disable the shell then set the cursor, it will change for every
> control in the shell. The way that cursors work is that if a control
> defines a cursor, that cursor is used. Otherwise, the inherited cursor is
> used. When a control is disabled, the cursor of the parent is used.

I have a table I fill data into, and while waiting for the database
containing the data, I want to show a waiting cursor. So should I add the
cursor to the table or what? And after the table has been updated, what do I
do then? Should the entire table be redrawn in order to 'reset' the cursor
to standard behavior? I'm not sure I understand you completely...

/Henrik
Re: Mouse cursor [message #445326 is a reply to message #445278] Tue, 02 November 2004 15:22 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Is the table being filled from a background thread or from the UI thread?

"Henrik Skovgaard" <hsk@reklamedata.dk.no.spam> wrote in message
news:cm5j5k$llg$1@eclipse.org...
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:cm5hc5$i4v$1@eclipse.org...
> > If you disable the shell then set the cursor, it will change for every
> > control in the shell. The way that cursors work is that if a control
> > defines a cursor, that cursor is used. Otherwise, the inherited cursor
is
> > used. When a control is disabled, the cursor of the parent is used.
>
> I have a table I fill data into, and while waiting for the database
> containing the data, I want to show a waiting cursor. So should I add the
> cursor to the table or what? And after the table has been updated, what do
I
> do then? Should the entire table be redrawn in order to 'reset' the cursor
> to standard behavior? I'm not sure I understand you completely...
>
> /Henrik
>
>
Re: Mouse cursor [message #445342 is a reply to message #445326] Wed, 03 November 2004 13:46 Go to previous messageGo to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cm88nu$b9o$1@eclipse.org...
> Is the table being filled from a background thread or from the UI thread?

It's being filled from a UI thread.
Re: Mouse cursor [message #445346 is a reply to message #445342] Wed, 03 November 2004 14:50 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
So input is blocked to the shell while the table is filling because the UI
thread is filling the table, not reading and dispatching events. You should
set the cursor in the shell and disable the shell while the operation is
running then enable the shell and restore the cursor. If you can't get it
to work, I'll make you a snippet.

"Henrik Skovgaard" <hsk@reklamedata.dk.no.spam> wrote in message
news:cmanfj$l81$1@eclipse.org...
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:cm88nu$b9o$1@eclipse.org...
> > Is the table being filled from a background thread or from the UI
thread?
>
> It's being filled from a UI thread.
>
>
Re: Mouse cursor [message #445357 is a reply to message #445346] Thu, 04 November 2004 08:55 Go to previous messageGo to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cmar7j$u3p$1@eclipse.org...
> So input is blocked to the shell while the table is filling because the UI
> thread is filling the table, not reading and dispatching events. You
> should
> set the cursor in the shell and disable the shell while the operation is
> running then enable the shell and restore the cursor. If you can't get it
> to work, I'll make you a snippet.

How do I restore the cursor? As far as I can see, there is no getCursor
method available?

Would be happy to see an example :-) Thanks.

/Henrik
Re: Mouse cursor [message #445382 is a reply to message #445357] Thu, 04 November 2004 18:03 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Set to "null". That will restore the default cursor. There is no
getCursor() method because it's not possible to query the default cursor on
some platforms. For example, text widgets often use an i-beam (motif
doesn't) but there's no API to query the this.

Still need the snippet?

"Henrik Skovgaard" <hsk@reklamedata.dk.no.spam> wrote in message
news:cmcqp0$osd$1@eclipse.org...
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:cmar7j$u3p$1@eclipse.org...
> > So input is blocked to the shell while the table is filling because the
UI
> > thread is filling the table, not reading and dispatching events. You
> > should
> > set the cursor in the shell and disable the shell while the operation is
> > running then enable the shell and restore the cursor. If you can't get
it
> > to work, I'll make you a snippet.
>
> How do I restore the cursor? As far as I can see, there is no getCursor
> method available?
>
> Would be happy to see an example :-) Thanks.
>
> /Henrik
>
>
Re: Mouse cursor [message #445403 is a reply to message #445382] Fri, 05 November 2004 08:12 Go to previous message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cmdqsb$60v$1@eclipse.org...
> Set to "null". That will restore the default cursor. There is no
> getCursor() method because it's not possible to query the default cursor
> on
> some platforms. For example, text widgets often use an i-beam (motif
> doesn't) but there's no API to query the this.
> Still need the snippet?

Doh! :-) No.. thanks I got it now.. How silly I didn't figure that out!

/Henrik
Previous Topic:Why StyledText dose not word-wrap in SWT3.0
Next Topic:Help needed on FormAttachment
Goto Forum:
  


Current Time: Sat Nov 28 14:50:54 GMT 2020

Powered by FUDForum. Page generated in 0.02607 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top