File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,15 @@ impl BoxControl {
273
273
}
274
274
}
275
275
276
+ #[ inline]
277
+ pub fn append_ref ( & self , child : & Control , stretchy : bool ) {
278
+ ffi_utils:: ensure_initialized ( ) ;
279
+ unsafe {
280
+ assert ! ( child. parent( ) . is_none( ) ) ;
281
+ ui_sys:: uiBoxAppend ( self . ui_box , child. ui_control , stretchy as c_int )
282
+ }
283
+ }
284
+
276
285
/// FIXME(pcwalton): This will leak the deleted control! We have no way of actually getting it
277
286
/// to decrement its reference count per `libui`'s UI as of today, unless we maintain a
278
287
/// separate list of children ourselves…
@@ -997,6 +1006,16 @@ impl RustAreaHandler {
997
1006
998
1007
define_control ! ( Area , uiArea, ui_area) ;
999
1008
1009
+ impl < ' a > From < & ' a Area > for Control {
1010
+ fn from ( area : & Area ) -> Control {
1011
+ unsafe {
1012
+ let control = Control :: from_ui_control ( area. ui_area as * mut uiControl ) ;
1013
+ // mem::forget(self);
1014
+ control
1015
+ }
1016
+ }
1017
+ }
1018
+
1000
1019
impl Area {
1001
1020
#[ inline]
1002
1021
pub unsafe fn from_ui_area ( ui_area : * mut uiArea ) -> Area {
You can’t perform that action at this time.
0 commit comments