• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Glibmm Main Event Loop

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to understand and use Glibmm Main Event Loop. I find it difficult to understand what it actually do.
A program that wants to use the Main Event Loop first defines it like this:
Glib::RefPtr<Glib::MainLoop> _mainloop;

Then the constructor creates it like this:
Application::Application () :
_mainloop (Glib::MainLoop::create())
{...}

The application must implement a run function where it calls on mainloop->run().
void
Application::run()
{
_mainloop->run();
}

Now: What exactly is it its doing?
I have read http://en.wikipedia.org/wiki/Event_loop, but I am still lost, don't know why. Maybe I need a dumbed down explanation...
I have also tried to understand the following example: http://developer.gnome.org/glibmm/unstable/thread_2dispatcher_8cc-example.html#a15
From Java I am familiar with event listeners that listens for specific events. Don't know if this is similar.

Anyway from this code I cannot see what the mainloop actually does for this Application...
 
Rancher
Posts: 280
VI Editor C++ Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glibmm is a C++ wrapper for GLib's GObjects.

To understand Glibmm's Main Event Loop, you may want to read Glib's documentation of Main Event Loop: http://developer.gnome.org/glib/2.32/glib-The-Main-Event-Loop.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic