Class Index Cross Index Namespace Index

Class Gtk::Clock

A small text clock widget.
Contained in: Gtk
Derived from: Label
Derived by: none

#include <gtk--/clock.h>


public function member index:

Clock(Type type = REALTIME);
static GtkType get_type();
GtkClock* gtkobj();
const GtkClock* gtkobj() const;
static bool isA(Object* checkcast);
void set_format(const Gtk::string& fmt);
void set_seconds(time_t seconds);
void set_update_interval(gint seconds);
void start();
void stop();
virtual ~Clock();
 

protected function member index:

explicit Clock(GtkClock* castitem);
void initialize_class();
 

private function member index:

Clock(const Clock&);
Clock& operator =(const Clock&);
 

Description:

The GtkClock widget provides an easy way of providing a textual clock in your application. It supports realtime display, as well as count up and count down modes. The clock widget could conceivably be used in such applications as an application's status bar, or as the basis for a panel applet, etc.

Three modes of operation are supported. These are realtime - which displays the current time, count-up/increasing - which counts up from an initial value (like a stopwatch), and count-down/decreasing - which counts down from an initial value.

Note, however, that the accuracy of the gtkclock widget is limited to 1 second.


Function Member Descriptions:

Gtk::Clock::set_format - Set the of a GtkClock widget.

void set_format(const Gtk::string& fmt);
The syntax of the string is identical to that of the function strftime(3). Further information about time strings can be found on this man page. The widget defaults to a string of "%H:%M" in realtime mode, or "%H:%M:%S" in count-up or count-down modes.


Gtk::Clock::set_seconds - Set the current time as displayed by the clock.

void set_seconds(time_t seconds);
Works only in count-up and count-down modes. This function has no effect in realtime mode, as the clock time is determined by the system clock in realtime mode.


Gtk::Clock::set_update_interval - Set the interval at which the GtkClock widget is updated.

void set_update_interval(gint seconds);
The seconds parameter is used to determine how often the time shown on the widget is updated. The default value is to update every second, but you may wish to increase this value. If you set the update interval to 0, the clock is never updated.


Gtk::Clock::start - Start the clock counting.

void start();
The clock will begin counting up or down from the time when this function is called, until gtk_clock_stop is called. This function has no effect in the realtime mode.


Gtk::Clock::stop - Stop the clock counting.

void stop();
The clock ceases counting up or down, and the last time reached remains on the display. This function has no effect in the realtime mode (you can't start and stop real time! :-).



Variable Member Descriptions: