pub unsafe fn lone_message_box(
  box_type: MessageBox, title: &str, message: &str,
) -> Result<(), String> {
  let title_null: Vec<u8> = title.bytes().chain(Some(0)).collect();
  let message_null: Vec<u8> = message.bytes().chain(Some(0)).collect();
  let output = SDL_ShowSimpleMessageBox(
    box_type as u32,
    title_null.as_ptr() as *const c_char,
    message_null.as_ptr() as *const c_char,
    null_mut(),
  );
  if output == 0 {
    Ok(())
  } else {
    Err(get_error())
  }
}
/// Shows a basic, stand alone message box.
///
/// This doesn't require SDL2 to be initialized. If initialization was attempted
/// and then failed because of no possible video target then this call is very
/// likely to also fail.
///
/// # Safety
///
/// As with all GUI things, you must only call this from the main thread.
Shows a basic, stand alone message box.
This doesn't require SDL2 to be initialized. If initialization was attempted
and then failed because of no possible video target then this call is very
likely to also fail.
Shows a basic stand alone message box . This doesn ' t require SDL2 to be initialized . If initialization was attempted and then failed because of no possible video target then this call is very likely to also fail .
pub unsafe fn lone_message_box(
  box_type: MessageBox, title: &str, message: &str,
) -> Result<(), String> {
  let title_null: Vec<u8> = title.bytes().chain(Some(0)).collect();
  let message_null: Vec<u8> = message.bytes().chain(Some(0)).collect();
  let output = SDL_ShowSimpleMessageBox(
    box_type as u32,
    title_null.as_ptr() as *const c_char,
    message_null.as_ptr() as *const c_char,
    null_mut(),
  );
  if output == 0 {
    Ok(())
  } else {
    Err(get_error())
  }
}
pub unsafe fn lone_message_box ( box_type : MessageBox , title : & str , message : & str , ) -> Result < ( ) , String > { let title_null : Vec < u8 > = title . bytes ( ) . chain ( Some ( 0 ) ) . collect ( ) ; let message_null : Vec < u8 > = message . bytes ( ) . chain ( Some ( 0 ) ) . collect ( ) ; let output = SDL_ShowSimpleMessageBox ( box_type as u32 , title_null . as_ptr ( ) as * const c_char , message_null . as_ptr ( ) as * const c_char , null_mut ( ) , ) ; if output == 0 { Ok ( ( ) ) } else { Err ( get_error ( ) ) } }
Shows a basic, stand alone message box.
Shows a basic stand alone message box .
box_type
MessageBox
title
&str
message
&str
box_type
MessageBox
title
&str
message
&str
safety
As with all GUI things, you must only call this from the main thread.
As with all GUI things you must only call this from the main thread .