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



Hi

The docking stuff was written by Gustavo, so I'm CC-ing him.

This is just a guess, but:

1) Have you tried ref()ing the widgets that are getting destroyed
explicitly ?
2) Are you using the latest code from libegg, which has seen some memory
management and other fixes in the past week or two ?

Rgds,
Biswa.

Hi,

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 ?)


Thanks,

Mac.


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();
 gtk_container_add(GTK_CONTAINER(display_socket_item),
  display_socket);
 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);

 egg_dock_add_item(EGG_DOCK(dock),
EGG_DOCK_ITEM(display_socket_item),
EGG_DOCK_BOTTOM);
 gtk_widget_show_all(display_socket_item);
 ...

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
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






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