<HTML
><HEAD
><TITLE
>GtkClock</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="Gnome User Interface Library Reference Manual"
HREF="book1.html"><LINK
REL="UP"
TITLE="GNOME Widgets and Objects"
HREF="gnome-objects.html"><LINK
REL="PREVIOUS"
TITLE="GnomeStock"
HREF="gnomestock.html"><LINK
REL="NEXT"
TITLE="GtkTed"
HREF="gtkted.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
COLSPAN="4"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="5"
>Gnome User Interface Library Reference Manual</FONT
></TH
></TR
><TR
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
><A
HREF="gnomestock.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="gnome-objects.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="gtkted.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
></TABLE
></DIV
><H1
><A
NAME="GTKCLOCK"
>GtkClock</A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN25095"
></A
><H2
>Name</H2
>GtkClock&nbsp;--&nbsp;A small text clock widget, capable of realtime, count-up and count-down modes</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN25098"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
>&#13;#include &lt;gnome.h&gt;


struct      <A
HREF="gtkclock.html#GTKCLOCK-STRUCT"
>GtkClock</A
>;
enum        <A
HREF="gtkclock.html#GTKCLOCKTYPE"
>GtkClockType</A
>;
<GTKDOCLINK
HREF="GTKWIDGET"
>GtkWidget</GTKDOCLINK
>*  <A
HREF="gtkclock.html#GTK-CLOCK-NEW"
>gtk_clock_new</A
>                   (<A
HREF="gtkclock.html#GTKCLOCKTYPE"
>GtkClockType</A
> type);
void        <A
HREF="gtkclock.html#GTK-CLOCK-SET-FORMAT"
>gtk_clock_set_format</A
>            (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock,
                                             <GTKDOCLINK
HREF="GCHAR"
>gchar</GTKDOCLINK
> *fmt);
void        <A
HREF="gtkclock.html#GTK-CLOCK-SET-SECONDS"
>gtk_clock_set_seconds</A
>           (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock,
                                             <GTKDOCLINK
HREF="TIME-T"
>time_t</GTKDOCLINK
> seconds);
void        <A
HREF="gtkclock.html#GTK-CLOCK-SET-UPDATE-INTERVAL"
>gtk_clock_set_update_interval</A
>   (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock,
                                             <GTKDOCLINK
HREF="GINT"
>gint</GTKDOCLINK
> seconds);
void        <A
HREF="gtkclock.html#GTK-CLOCK-START"
>gtk_clock_start</A
>                 (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock);
void        <A
HREF="gtkclock.html#GTK-CLOCK-STOP"
>gtk_clock_stop</A
>                  (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock);&#13;</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN25119"
></A
><H2
>Object Hierarchy</H2
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
>&#13;  <GTKDOCLINK
HREF="GTKOBJECT"
>GtkObject</GTKDOCLINK
>
   +----<GTKDOCLINK
HREF="GTKWIDGET"
>GtkWidget</GTKDOCLINK
>
         +----<GTKDOCLINK
HREF="GTKMISC"
>GtkMisc</GTKDOCLINK
>
               +----<GTKDOCLINK
HREF="GTKLABEL"
>GtkLabel</GTKDOCLINK
>
                     +----GtkClock</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN25126"
></A
><H2
>Description</H2
><P
>The <SPAN
CLASS="TYPE"
>GtkClock</SPAN
> 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.</P
><P
>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.</P
><P
>Note, however, that the accuracy of the gtkclock widget is limited to 1 second.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN25132"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
NAME="AEN25134"
></A
><H3
><A
NAME="GTKCLOCK-STRUCT"
></A
>struct GtkClock</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>struct GtkClock;</PRE
></TD
></TR
></TABLE
><P
>You should not access the members of the GtkClock struct directly, instead,
access them through the gtk_clock_* functions.</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25139"
></A
><H3
><A
NAME="GTKCLOCKTYPE"
></A
>enum GtkClockType</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>typedef enum
{
	GTK_CLOCK_INCREASING,
	GTK_CLOCK_DECREASING,
	GTK_CLOCK_REALTIME
} GtkClockType;</PRE
></TD
></TR
></TABLE
><P
>Three modes are supported - realtime (GTK_CLOCK_REALTIME), count-up (GTK_CLOCK_INCREASING) and count-down (GTK_CLOCK_DECREASING). In realtime mode, the widget displays the current local machine time. In count-up mode, the widget counts up either from an initial value (as specified with gtk_clock_set_seconds) or from the default of 0 seconds. In count-down mode, the widget counts down from a specified value or 0 seconds. Note that negative times are possible, and that the clock does not stop at 0 seconds in count down mode.</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25144"
></A
><H3
><A
NAME="GTK-CLOCK-NEW"
></A
>gtk_clock_new ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
><GTKDOCLINK
HREF="GTKWIDGET"
>GtkWidget</GTKDOCLINK
>*  gtk_clock_new                   (<A
HREF="gtkclock.html#GTKCLOCKTYPE"
>GtkClockType</A
> type);</PRE
></TD
></TR
></TABLE
><P
>Creates a new <SPAN
CLASS="TYPE"
>GtkClock</SPAN
> widget.</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>type</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A GtkClockType value, specifying what mode this widget is to display in. There are three options: GTK_CLOCK_INCREASING, GTK_CLOCK_DECREASING, GTK_CLOCK_REALTIME. These options are described above.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>GtkWidget * on success, NULL on failure.
&#13;</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25165"
></A
><H3
><A
NAME="GTK-CLOCK-SET-FORMAT"
></A
>gtk_clock_set_format ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gtk_clock_set_format            (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock,
                                             <GTKDOCLINK
HREF="GCHAR"
>gchar</GTKDOCLINK
> *fmt);</PRE
></TD
></TR
></TABLE
><P
>Set the format of a <SPAN
CLASS="TYPE"
>GtkClock</SPAN
> widget. The syntax of the format string is identical to that of the function strftime(3). Further information about time format strings can be found on this man page. The widget defaults to a format string of "%<TT
CLASS="LITERAL"
>H</TT
>:%<TT
CLASS="LITERAL"
>M</TT
>" in realtime mode, or "%<TT
CLASS="LITERAL"
>H</TT
>:%<TT
CLASS="LITERAL"
>M</TT
>:%<TT
CLASS="LITERAL"
>S</TT
>" in count-up or count-down modes.</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gclock</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A pointer to a GtkClock widget.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>fmt</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A time format string, as described by the man page strftime(3).
&#13;</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25191"
></A
><H3
><A
NAME="GTK-CLOCK-SET-SECONDS"
></A
>gtk_clock_set_seconds ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gtk_clock_set_seconds           (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock,
                                             <GTKDOCLINK
HREF="TIME-T"
>time_t</GTKDOCLINK
> seconds);</PRE
></TD
></TR
></TABLE
><P
>Set the current time as displayed by the clock 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.</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gclock</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A pointer to a GtkClock widget.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>seconds</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>The time to display on the clock, measured in seconds.
&#13;</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25211"
></A
><H3
><A
NAME="GTK-CLOCK-SET-UPDATE-INTERVAL"
></A
>gtk_clock_set_update_interval ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gtk_clock_set_update_interval   (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock,
                                             <GTKDOCLINK
HREF="GINT"
>gint</GTKDOCLINK
> seconds);</PRE
></TD
></TR
></TABLE
><P
>Set the interval at which the <SPAN
CLASS="TYPE"
>GtkClock</SPAN
> widget is updated. 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.</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gclock</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A pointer to a GtkClock widget.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>seconds</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>The interval at which to update the clock widget, measured in seconds.
&#13;</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25232"
></A
><H3
><A
NAME="GTK-CLOCK-START"
></A
>gtk_clock_start ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gtk_clock_start                 (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock);</PRE
></TD
></TR
></TABLE
><P
>Start the clock counting in count-up or count-down modes. 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 (you can't start and stop real time! :-).</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gclock</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A pointer to a GtkClock widget.
&#13;</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN25247"
></A
><H3
><A
NAME="GTK-CLOCK-STOP"
></A
>gtk_clock_stop ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gtk_clock_stop                  (<A
HREF="gtkclock.html"
>GtkClock</A
> *gclock);</PRE
></TD
></TR
></TABLE
><P
>Stop the clock counting in count-up or count-down modes. 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! :-).</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gclock</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>A pointer to a GtkClock widget.&#13;</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><BR
CLEAR="all"><BR><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
><A
HREF="gnomestock.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="gnome-objects.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="gtkted.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="left"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>GnomeStock</B
></FONT
></TD
><TD
COLSPAN="2"
ALIGN="right"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>GtkTed</B
></FONT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>