WindowType::DialogWindow => ui_dialog_window_create(parent, args)
}
};
- // because we use additional reference counting in the Rust UiObject wrapper,
- // we always increase the reference counter here
- unsafe {
- ui_object_ref(objptr);
- }
-
- let ctxptr = unsafe {
- ui_object_get_context(objptr)
- };
// create local UiObject
- let mut obj = toolkit::UiObject::<T> {
- ptr: objptr,
- ctx: toolkit::UiContext::from_ptr(ctxptr),
- _data: PhantomData
- };
+ let mut obj = toolkit::UiObject::from_ptr(objptr);
// store windowdata object in the UiObject
let window_data = Box::new(data);