[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: gtk socket and plug
- From: "Sebastian Geerken" <S Geerken ping de>
- To: "lista gtk" <gtk-app-devel-list gnome org>
- Subject: Re: gtk socket and plug
- Date: 2 Jul 2001 12:57:22 +0200
On Sat, Jun 30, Danilo Luajmbio wrote:
> where can I find a good example using gtk-socket and gtk-plug ?
I think they are supposed to work like in the example I've
attached. The program client starts the program server, passing the
window ID by command line (may be replaced by an other mechanism).
There are still some questions open, but I hope this helps you a bit.
Sebastian
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
GtkWidget *window, *socket;
char command[1024];
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
socket = gtk_socket_new ();
gtk_container_add (GTK_CONTAINER (window), socket);
gtk_widget_show_all (window);
sprintf (command, "./server %ld &", GDK_WINDOW_XWINDOW (socket->window));
system (command);
gtk_main ();
return 0;
}
#include <gtk/gtk.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
GtkWidget *plug, *label;
gtk_init (&argc, &argv);
plug = gtk_plug_new (atoi (argv[1]));
label = gtk_label_new ("Hello, world!");
gtk_container_add (GTK_CONTAINER (plug), label);
gtk_widget_show_all (plug);
gtk_main ();
return 0;
}
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]