Largest Provider of Commercial Smalltalk
Cincom is one of the largest commercial providers of Smalltalk, with twice as many customers and partners as other commercial providers.

Tom Nies

Get Started

The New Class ‒ PowerState

Posted on in Categories ObjectStudio

The power-management functions and messages retrieve the system power status, notify applications of power-management events and notify the system of each application’s power requirements.

PowerState represents the state of the current power system, such as:

  • The presence of a battery
  • The state of the battery
  • Whether or not the system is charging

Also, if you subscribe to the Announcements of the class, you will receive announcements regarding events for major state changes, such as when the battery is low, etc.  You will also receive announcements when the operating system changes to sleep, hibernate and shut down and also when operation is resumed after a sleep or hibernate.

Using these announcements, you can save the image, disconnect from the database or do other cleanup before the system goes to sleep. When the system resumes, you can reconnect to the database or open a login dialog.

The BatteryMeter is just a small sample that shows the properties of the new class “PowerState.”

These are some of the highlights of the class itself.

Desktop BatteryMeter Fully Charged
Desktop BatteryMeter Fully Charged

 

Laptop BatteryMeter Fully Charged
Laptop BatteryMeter Fully Charged

 

Laptop BatteryMeter at 74%
Laptop BatteryMeter at 74%

Laptop BatteryMeter at 66%
Laptop BatteryMeter at 66%

Laptop Battery Meter Charging at 66%
Laptop Battery Meter Charging at 66%