Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Detecting system idle time
Detecting system idle time [message #443981] Tue, 05 October 2004 10:36 Go to next message
Grant Slender is currently offline Grant SlenderFriend
Messages: 14
Registered: July 2009
Junior Member
G'day - was wondering what steps I'd need to take to detect when the
underlying OS is idle.

I'm kinda hoping that SWT might sorta support this kind of event detection -
if not, I suppose I'm gonna have to write a OS specific hook to detect when
mouse/keyboard events stop and then start a counter for a grace period and
then after, say 30 seconds, assume the system is indeed idle.

The trick is to ensure that the system is indeed idle and not that my app is
switched away and the user is really using another app.

Any tips really appreciated.

Grant
Re: Detecting system idle time [message #443989 is a reply to message #443981] Tue, 05 October 2004 13:43 Go to previous messageGo to next message
Tiberiu Caprita is currently offline Tiberiu CapritaFriend
Messages: 68
Registered: July 2009
Member
A way to find when a app is idle:
Swt "get" in Idle, when is doing display.sleep().
Practically, every application has a loop as
while(!shell.isDisposed()) {
if(!display.readAndDispatch())
display.sleep();
}

Doing display.sleep(), the thread gives possibility to other applictaion
to use CPU.

Tiberiu
Re: Detecting system idle time [message #444039 is a reply to message #443989] Tue, 05 October 2004 14:02 Go to previous messageGo to next message
Tiberiu Caprita is currently offline Tiberiu CapritaFriend
Messages: 68
Registered: July 2009
Member
Sorry,
I didn't get from first time your request.
It seems indeed for a Task Shceduler you have no other choice than to
listen mouse/keyboard.

Tiberiu
Change the background colour ofa check box? [message #444298 is a reply to message #443981] Mon, 11 October 2004 15:56 Go to previous message
Anthony Bennis is currently offline Anthony BennisFriend
Messages: 17
Registered: July 2009
Junior Member
Hi,

I'm attempting to achieve the "half selected" effect by changing the
colour of a check buttons background in SWT.

"setBackground(Color color)" only changes the parent composite's colour
of the text component.

Any help appreciated,
Anthony Bennis.
Previous Topic:Simple Combo w/ Data Question
Next Topic:swt tree: setSelection
Goto Forum:
  


Current Time: Wed Sep 25 07:47:13 GMT 2024

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

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

Back to the top