[Gtk-sharp-list] Help needed.

Fredrik Nilsson jymdman@home.se
Sun, 13 Mar 2005 13:25:20 +0100


On ons, 2005-03-09 at 19:09 -0800, Todd Berman wrote:
> On Wed, 2005-03-09 at 23:24 +0100, Fredrik Nilsson wrote:
> >Hi,
> >
> >I'm trying to port e-sidebar from evolution to Gtk#.
> >Have ported most of the code but having problem with the following
> >method that overrides container_class->forall :
> >
> >
> >static void
> >impl_forall (GtkContainer *container,
> >	     gboolean include_internals,
> >	     GtkCallback callback,
> >	     void *callback_data)
> >{
> >	ESidebar *sidebar = E_SIDEBAR (container);
> >	GSList *p;
> >
> >	if (sidebar->priv->selection_widget != NULL)
> >		(* callback) (sidebar->priv->selection_widget, callback_data);
> >
> >	for (p = sidebar->priv->buttons; p != NULL; p = p->next) {
> >		GtkWidget *widget = ((Button *) p->data)->button_widget;
> >		(* callback) (widget, callback_data);
> >	}
> >}
> >
> 
> 
> In this example you want to do:
> 
> protected override void ForAll (bool include_internals, CallbackInvoker
> invoker)
> {
> 	if (selection_widget != null)
> 		invoker.Invoke (selection_widget);
> 
> 	foreach (Widget button in buttons)
> 	{
> 		invoker.Invoke (button);
> 	}
> }
> 
> --Todd
> 

Yes, that certainly did the trick...

Thanks!

/Fredrik