Date: Tue, 22 Jun 2004 11:31:27 +0900 (JST) Message-Id: <20040622.113127.125104019.garrigue at kurims.kyoto-u.ac.jp> To: md5i at cs.cmu.edu Cc: lablgtk at kaba.or.jp Subject: Re: First cut at adding BonoboDock From: Jacques GARRIGUE In-Reply-To: <87fz8o8io1.fsf at cs.cmu.edu> References: <87fz8o8io1.fsf at cs.cmu.edu> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Michael Welsh Duggan > I really wanted docking widgets, so I added BonoboDock, > BonoboDockItem, and BonoboDockLayout from bonoboui-2.0 to lablgtk. > This is an initial cut at the code, and I would appreciate any > constructive criticism. This looks good enough to me. When you think you are ready, we could include it in the distribution. (lablgtk is still weak with external addons... need an infrastructure for that) Note however that you must be very careful with the GC. I see at least one error in Val_BonoboDockLayoutItem + v = alloc_small(3, 0); + Field(v, 0) = Val_GtkAny(it->item); Your v is not registered as a root, but Val_GtkAny causes an allocation: the block pointed by v may be moved around. Better to register all your variables if you're not really sure of where allocation occurs. And you must also use the Store_field macro when allocation may occur in the right hand side: Store_field(v, 0, Val_GtkAny(it->item)); (Actually, your code is probably correct, because Val_GtkAny creates a custom block, which must go in the old generation, while small blocks like v go to the small generation. But I'd rather not depend on this kind of reasonning...) Jacques