Re: interrupting gtk_main



--- Gus Koppel <gtk spamkiller bytechase cx> wrote: 


2.
if your server-type structure just runs in another
thread of the same
process as your frontend is in and if you need only
basic signalling
then you may want to use GSignals. Those are the
means which are
identified by names as you connect callback
functions to them. They are
automatically invoked on emission of the signal
(which would be
triggered by your server thread). For a description
see:


http://developer.gnome.org/doc/API/2.0/gobject/gobject-Signals.html


Thank you very much for the ideas.  I think GSignal
might be useful.
What I am wondering now is if I can implement this
while still having the server-type part of the
application (let's call this the gateway) be unaware
of GTK?
Basically the application is set up as an EXE (the
gateway) with a bunch of DLLs (interfaces, including
GTK, and backend logic stuff).  Everything is able to
communicate because all DLLs expose an object that is
written to our simple API.  The idea is that a user
can choose to run the application with whatever types
of interfaces suit them best - it is aimed at disabled
users so some may want a gamepad interface or large
font or just a command line.  others will want to use
a standard GUI.  The toughest scenario is if a user is
running a joystick along with the GUI, and sends a
command (like "next chapter") using the joystick.  The
GUI should be updated to reflect this.
But since the GUI is not a requisite component, the
Gateway (which syncs everything) is unaware of GTK and
GSignals.

The simple API looks like this:
AmisComponentBaseObj->ReceiveData(const char* data,
AmisComponentBase* pSender);

This is the function that needs to cause an
interruption of gtk_main.  So when something in the
system has triggered a new data event, the gateway
broadcasts data to all listeners by calling their
instance of this function.  Seems simple...!

It seems now that my path should be to make a special
version of the gateway which emits GSignals, along
with regular ReceiveData events.  But I would be
grateful for a way around this.

Thanks again
Marisa



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