Re: Timers



Will the function gtk_timeout_add() do what you need? It is referred to on page 
65 of Havoc's book.

Padraig


Delivered-To: gtk-app-devel-list gnome org
To: "G Hasse" <gh raditex se>
Cc: <gtk-app-devel-list gnome org>
Subject: Re: Timers
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
X-BeenThere: gtk-app-devel-list gnome org
X-Loop: gtk-app-devel-list gnome org
X-Mailman-Version: 2.0.5
List-Help: <mailto:gtk-app-devel-list-request gnome org?subject=help>
List-Post: <mailto:gtk-app-devel-list gnome org>
List-Subscribe: <http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list>, 
<mailto:gtk-app-devel-list-request gnome org?subject=subscribe>
List-Id: Writing Apps with GTK+ <gtk-app-devel-list.gnome.org>
List-Unsubscribe: <http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list>, 
<mailto:gtk-app-devel-list-request gnome org?subject=unsubscribe>
List-Archive: <http://mail.gnome.org/archives/gtk-app-devel-list/>

Hi Göran

You should *never* need to poll something. When the other application
have information to you it should send it on a file descriptor
(or socket).

Yeah the problem is that I am developing a Maintenance application that
communicates with a device. This device has an interface module that my
application 'talks to'. This interface module then 'talks to' the device
sounds a bit like a driver doesn't it. Anyway my application has to report
on any alarms generated by this device and it does this by reading a message
stack stored within this interface hence the need to poll it periodically.
Its not ideal but you can only work with what you are given.

(or socket).

The application has also got to 'talk' to some other modules that we have
developed in house. This has been implemented using sockets.

Thanks for your advice

Ian

----- Original Message -----
From: "G Hasse" <gh raditex se>
To: "Ian Frawley" <ifrawley opaltelecom co uk>
Cc: <gtk-app-devel-list gnome org>
Sent: Tuesday, May 29, 2001 2:13 PM
Subject: Re: Timers


On Tue, 29 May 2001, Ian Frawley wrote:

Hi

I am trying to develop an application on Linux. This application has a
GUI which I have implemented using GTK written in C++. The problem is
that I have to periodically poll another application so a timer widget
or something would be great but I don't think timers exist. Hopefully
I am wrong and someone could point me in the right direction.

You should *never* need to poll something. When the other application
have information to you it should send it on a file descriptor
(or socket).

You could then decide if you whant that information or disregard it.

In your application you do something like

gdk_input_add( mySocket, GDK_INPUT_READ, GTK_SIGNAL_FUNC(file_function),
&cmdinfo );

where mySocket is the socket (or filedescriptor).

Don't use poll. You don't need it.

Göran Hasse



Any help would be greatly appreciated

Thanks in advance

Ian Frawley
Software Engineer
Opal Telecom
Tel: 0161 222 2122
E-Mail: ifrawley opaltelecom co uk



----------------------------------------------------------------
Göran Hasse            email: gh raditex se     Tel: +46 8 694 92 70
Raditex AB             http://www.raditex.se    Fax: +46 8 442 05 91
Sickla Alle 7, 1tr                              Mob: 070-5530148
131 34  NACKA, SWEDEN





_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]