Home Help Center

Ice with GUI

mwilsonmwilson Member Mark WilsonOrganization: Integrated Computer Solutions, Inc.Project: TBD ✭✭✭
I am using Ice with Gtk. I have my GUI running in its own thread; it reads a mutex protected queue on every idle event. When other threads want to update the GUI, they dump a function object on the thread (and so on, active object pattern). This works pretty well, but I'm wondering if I can use an Ice::Connection somehow to hook Ice into the Gtk main loop. This would make networked GUI clients a lot easier to write...

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    No, this is not possible. Ice is inherently multi-threaded, and doesn't have any kind of "main loop".
  • mwilsonmwilson Member Mark WilsonOrganization: Integrated Computer Solutions, Inc.Project: TBD ✭✭✭
    Have you guys done any work with X Windows type GUI's?
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    You mean in combination with Ice? We used Qt from Trolltech in one project. This was under Windows, but it was supposedly portable to X11 as well. Most of us have some experience with X11 from former (non-Ice) projects.
  • mwilsonmwilson Member Mark WilsonOrganization: Integrated Computer Solutions, Inc.Project: TBD ✭✭✭
    Yes. How did you handle the threading?
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    We used the same pattern that you use, that is, have the dispatch threads that trigger GUI activity pass function objects to the main thread.

    For long-running client->server invocations, we used a separate thread to send requests (so that the GUI does not block), and had the GUI main thread pass a function object to this thread.
Sign In or Register to comment.