Ok, I finally got the time to review the patch.

I was a bit hesitant at the beginning, as glade_command_{create,delete}
were not supposed to create or delete the widget, but just account for a
created or deleted widget on the project, but the change of meaning
makes sense, as the other glade_command_* really execute the action that
they are supposed to account for.

I just removed the glade_command_create_toplevel function, as it look a
bit too ad hoc to me, so I keep the creation of a widget with only
glade_command_create.

I also applied your no-warn patch, along with a fix to release allocated
GladeWidgets (not related to your code).

I will review your other patches asap.

Thank you for your work!

Cheers,

> -----Message d'origine-----
> De : [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] De la part de 
> paolo borelli
> Envoy� : vendredi 23 mai 2003 18:35
> � : [EMAIL PROTECTED]
> Objet : [Glade-devel] [patch, glade3] rework widget creation
> 
> 
> Hi!
> 
> The attached patch is a rework of how a GladeWidget is created. 
> After the patch the code path to create a widget IMHO makes 
> more sense and matches better the one of widget deletion: the 
> fundamental change is that galde_command_create calls 
> glade_widget_new_from_class to create a widget and then adds 
> it to the project instead of being called by it.
> 
> The patch isn't small and touches various files, so I'm going 
> to explain the changes in detail below.
> 
> * glade-command.c: glade_command_create now takes the widget 
> class and the placeholder it should replace as args; it 
> creates the widget with glade_widget_new_from_class. Toplevel 
> widget are created with glade_command_create_toplevel.
> 
> * glade-placeholder.c: the placeholder (if present) is passed 
> to glade_command_create and then is passed on till 
> create_execute which takes care of replacing it, this way we 
> can delete glade_placeholder_replace_widget and simply call 
> glade_command_create.
> 
> * glade-widget.c: glade_widget_new now only take the widget 
> class as argument; glade_new_from_class takes also a project 
> arg so special casing for toplevels (which don't have 
> parent->project) is not needed anymore. I also deleted 
> glade_widget_new_from_class_name since it was not used 
> anywhere and a bad idea to begin with (if ever needed just 
> get the class from its name and then call 
> glade_widget_new_from_class).
> 
> * glade_project_window.c: use glade_command_create_toplevel
> 
> * glade_property.c: fix up the caller of 
> glade_widget_new_from_class (I was a little unsure about this 
> little change since I am not familiar with property.c, but I 
> noticed that even if before widget->project was not 
> explicitly passed to the called function, there was a 
> g_return_if_fail (GLADE_IS_PROJECT (parent->project))... )
> 
> 
> It seems to work here, but at the moment adding widget to 
> vbox etc it's broken so the patch isn't tested a lot, if you 
> see any problems let me know.
> 
> Sorry for being so verbose, I hope it all makes sense and it 
> doesn't conflict with your current work.
> 
> 
> ciao
>       paolo
> 


_______________________________________________
Glade-devel maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/glade-devel

Reply via email to