Re: mico & gtk
- From: Owen Taylor <otaylor gtk org>
- To: George Zervas <gz4 doc ic ac uk>
- Cc: gtk-list redhat com
- Subject: Re: mico & gtk
- Date: 12 May 1998 14:16:53 -0400
George Zervas <gz4@doc.ic.ac.uk> writes:
> Hi all,
>
> I hope some of the CORBA literate amongst you will be able to help me
> with a query I have. Suppose I want to have a simple gtk app which just
> creates a button inside a container. How can I write an interface to the
> function that creates the button so that another CORBA app can call it
> and integrate the button. By integration I mean that the client app will
> show the button inside a container it has created but all the events
> will be routed directly to the server app. I have tried the plugsocket
> code but this requires that you have two apps running fully whereas with
> CORBA you can just invoke certain functions. I hope I am clear enough...
The way I would tackle the problem would be to create a callback
object:
interface Callback {
void invoke();
}
Then your server could have an operation that retrieves the
callback for the button:
interface MyServer {
Callback get_the_button_callback();
}
Then your client code would look like:
my $callback = $server->get_the_button_callback();
my $button = new Gtk::Button "Click the server";
$button->signal_connect ("clicked", sub { $callback->invoke(); });
(Assuming you were using Perl. Translation to C++ should
be straightforward)
If you want to have complicated objects in the client that are
implemented by the server, PlugSocket is the way to go.
I once fooled around with exporting the entire GTK+ interface
as a CORBA interface - but the generated stubs were enormous,
and the result would most likely be quite inefficient anyways.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]