Re: Gtkmm thread example



On Fri, Jun 6, 2008 at 2:43 AM, Damon Register
<damonregister bellsouth net> wrote:
> I am attempting to write a relatively simple gtkmm applicaton that gets and
> displays data from a hardware device.  The hardware part is easy because I
> have several console example apps for that.  I have learned some basic gtkmm
> to allow me to create a simple application.  I think I could even figure
> out how to use a timer to periodically poll the hardware for data.
>
> What I really want to do (I think) is have the main gtkmm app and a separate
> thread that reads the hardware and signals the main app when there is data.
> I have been searching for info and examples.  Perhaps I have found something
> quite close to what I need.
> http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__Threads.html
> shows a link to this dispatcher example.
> http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/thread_2dispatcher_8cc-example.html#a17
>
>
> This might be just what I need but the example is glibmm and I don't know how
> to adapt to a gtkmm.  Is there a relatively simple gtkmm thread dispatcher
> example, or can someone here suggest how to modify the glibmm dispatcher
> example to be a gtkmm example?

You can take a look at this code that I wrote based on glib threading
and Glib::Dispatcher
at an early stage of Paperbox development:
http://svn.gnome.org/svn/paperbox/tags/threaded-approachsnapshot-23-10-07/src/browser.cc
http://svn.gnome.org/svn/paperbox/tags/threaded-approachsnapshot-23-10-07/src/browser.hh

Also check out an example posted here:
http://www.c-plusplus.de/forum/viewtopic-var-p-is-816067.html

    Marko


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