Re: libegg (egg-dock) and gtksocket/gtkplug

Just a wild guess: Have you tried ref()ing your widgets ?



I'm using the docking widget framework from libegg and most (if not all)
of the docked widgets need to be embedded from other processes.
Everything works fine with the libegg stuff when using both non-embedded
and embedded widgets until I actually interact with the docked items and
move them around.  Then the gtkplug attached to the embedded widgets
gets destroyed.  This happens both when the embedded widget is pulled
out and floated as well as when it's moved around the docking area.

From what I understand, there's some kind of re-parenting going on when
the gtksocket widget gets moved around, but that's the extent of my
understanding here !

I'd be grateful if anyone who's used any of the docking libegg stuff
with embedded widgets could help me out or advise me of a better way of
doing this kind of thing (other docking frameworks which work better
with embedded widgets, maybe from bonobo ?)



Some test code from plug process:

 plug = gtk_plug_new(0);
 (widgets added to plug)
 g_print("Plug ID = %d\n", gtk_plug_get_id(GTK_PLUG(plug)));

 (printed on command-line for now)

Test code from socket process:

 table = gtk_vbox_new(FALSE, 5);
 gtk_container_add(GTK_CONTAINER(win), table);
 gtk_container_set_border_width(GTK_CONTAINER(table), 10);

 dock = egg_dock_new();
 gtk_box_pack_start(GTK_BOX(table), dock, TRUE, TRUE, 0);

 (items added to dock)

 display_socket_item = egg_dock_item_new("display_socket_item",
  "Display Socket Item", EGG_DOCK_ITEM_BEH_NORMAL);
 display_socket = gtk_socket_new();
 g_signal_connect(display_socket, "plug_added",
  G_CALLBACK(plug_added), display_socket);
 g_signal_connect(display_socket, "plug_removed",
  G_CALLBACK(plug_removed), display_socket);


I put the XID from the plug on the command line and in the "realize"
callback for the main window, I do:

 gtk_socket_add_id(GTK_SOCKET(display_socket), xid);

I check the plug_window member of the gtksocket struct in the callbacks
(plug_added, plug_removed) so I know when the plug gets destroyed.

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

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