plug/socket



Hi. I was hoping you could hepl me on why this doesnt work?

 I want to create two apps, and have one display a button from the other.

 my code is below. both apps seem to work, but I see no button show up.

 TIA

 #include <gtk/gtk.h>

 int main( int   argc,
           char *argv[] )
 {
     GtkWidget *btn, *plug;

     gtk_init (&argc, &argv);

     btn = gtk_button_new ();

         plug = gtk_plug_new(0x808aad8); /* change this before compiling */

         gtk_container_add(GTK_CONTAINER(plug), btn);


     gtk_widget_show (btn);
         gtk_widget_show(plug);

     gtk_main ();

     return 0;
 }



 --------------------------------------------

 #include <gtk/gtk.h>

 int main( int   argc,
           char *argv[] )
 {
     GtkWidget *window, *socket;

     gtk_init (&argc, &argv);

     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

         gtk_window_set_default_size(GTK_WINDOW(window), 1600, 48);

     gtk_container_set_border_width (GTK_CONTAINER (window), 10);

         socket = gtk_socket_new();
         gtk_widget_show(socket);
         gtk_container_add(GTK_CONTAINER(window), socket);


     gtk_widget_show (window);

         gdk_window_move (window->window, 0, 1200-96);
         g_print("XID=%x\n", socket->window);
     gtk_main ();

     return 0;
 }



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