pub fn insert(&self, index: usize, item: D) {
        use winapi::um::winuser::LB_INSERTSTRING;

        let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE);
        let display = format!("{}", item);
        let display_os = to_utf16(&display);

        let mut col = self.collection.borrow_mut();
        if index == std::usize::MAX {
            col.push(item);
        } else {
            col.insert(index, item);
        }

        unsafe {
            wh::send_message(handle, LB_INSERTSTRING, index, mem::transmute(display_os.as_ptr()));
        }
    }
/// Insert an item in the collection and the control. 
///
/// SPECIAL behaviour! If index is `std::usize::MAX`, the item is added at the end of the collection.
/// The method will still panic if `index > len` with every other values.
Insert an item in the collection and the control.
SPECIAL behaviour. If index is `std::usize::MAX`, the item is added at the end of the collection.
The method will still panic if `index > len` with every other values.
Insert an item in the collection and the control . SPECIAL behaviour . If index is ` std :: usize :: MAX ` the item is added at the end of the collection . The method will still panic if ` index > len ` with every other values .
pub fn insert(&self, index: usize, item: D) {
        use winapi::um::winuser::LB_INSERTSTRING;
        let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE);
        let display = format!("{}", item);
        let display_os = to_utf16(&display);
        let mut col = self.collection.borrow_mut();
        if index == std::usize::MAX {
            col.push(item);
        } else {
            col.insert(index, item);
        }
        unsafe {
            wh::send_message(handle, LB_INSERTSTRING, index, mem::transmute(display_os.as_ptr()));
        }
    }
pub fn insert ( & self , index : usize , item : D ) { use winapi :: um :: winuser :: LB_INSERTSTRING ; let handle = check_hwnd ( & self . handle , NOT_BOUND , BAD_HANDLE ) ; let display = format ! ( " " item ) ; let display_os = to_utf16 ( & display ) ; let mut col = self . collection . borrow_mut ( ) ; if index == std :: usize :: MAX { col . push ( item ) ; } else { col . insert ( index , item ) ; } unsafe { wh :: send_message ( handle , LB_INSERTSTRING , index , mem :: transmute ( display_os . as_ptr ( ) ) ) ; } }
Insert an item in the collection and the control.
Insert an item in the collection and the control .
&self
index
usize
item
D