I understand that all modifcations to the UI must be performed in the
"main" thread via Application.Invoke() or some such mechanism.
But can widgets be created in another thread and then provided to the
main thread to be added to the UI? Like:
delegate Gtk.VBox SummaryLoader(Whitemice.ZOGI.Entity entity,
IList<Whitemice.ZOGI.ObjectLink> links);
....
Viewport viewport;
viewport.Child = new Label("Loading links...");
SummaryLoader loader = delegate(Whitemice.ZOGI.Entity e,
IList<Whitemice.ZOGI.ObjectLink> l)
{
VBox v = new VBox();
v.Spacing = 2;
foreach(Whitemice.ZOGI.ObjectLink link in l)
{
... compose expensive widget (olf) ...
v.PackStart(olf, false, false, 2);
}
return v;
};
loader.BeginInvoke (entity, links, delegate (IAsyncResult r)
{
viewport.Remove(viewport.Child);
viewport.Child = loader.EndInvoke(r);
}, null);
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list