Hi, On Sep 12, 2009, at 15:26, Cjacker wrote:
> Hello, everybuddy, > > Here is webkit binding patch for gtk2hs > and tested with gtk2hs.darcs/gtk2hs-0.10.1 and webkit-1.1.13. > > To see how to use, check demo/webkit. > > Hope it can be merged:-) It certainly can. That's quite an amazing patch! Before I apply this patch, I'd like to check if you used the right functions to construct objects. I see you use makeNewObject throughout. This is correct if all the objects you're creating are GtkObjects or GtkWidgets (more likely). Many object that do not represent widgets are mere GObjects. In this case you need to use constructGObject or makeGObject. This might explain why you had to use castPtr in many places. Note that there is only one constructor function for GtkObject/GtkWidget but two for GObject. The constructGObject function is used when a new object is created, the makeGObject function is when you extract a GObject from an existing data structure in Webkit. The difference between the two lies in the way reference counting is done. Could you review you patch with respect to this? You could start to change webSettingsNew = do makeNewObject mkWebSettings $ liftM castPtr ${#call web_settings_new#} webSettingsNew = do constructNewGObject mkWebSettings {#call web_settings_new#} and see if this works. Thanks a lot in advance, Axel. > <add-webkit-binding.dpatch> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gtk2hs-devel mailing list Gtk2hs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel