[UFO-devel] BoUfo widget deleter
Status: Beta
Brought to you by:
schmidtjf
From: Andreas B. <b_...@gm...> - 2005-12-01 07:52:36
|
Hi the attached patch is pretty controversial, but I decided to give it a try anyway. In Boson we cannot use libufo directly, due to a) conflicting toolkits b) different APIs Therefore I have written a BoUfo library that provides the required widgets in wrapper classes. However this solution has one major problem: destruction. A statement such as ufoWidget->removeAll(); would delete all ufo widgets, however not the corresponding wrapper objects. Therefore I have patched our libufo copy to introduce a "widget deleter". This is simply an object that is deleted at the beginning of the ufo::UWidget d'tor. Any class deriving from this class can do cleanup tasks that may be necessary before the widget actually is deleted. A normal ufo::UObject that is added to the widget using trackPointer() is _not_ sufficient, as this is deleted by the ufo::UObject d'tor only and at this point the ufo::UWidget has already been destroyed. Of course this patch does not introduce any direct functionality for libufo, however it does provide an important feature for projects that need to implement wrapper classes. CU Andi |