pub fn create_button(bar_name: &str, on_change: crate::highgui::ButtonCallback, typ: i32, initial_button_state: bool) -> Result<i32> {
	string_arg!(bar_name);
	callback_arg!(on_change_trampoline(state: i32, userdata: *mut c_void) -> () => userdata in callbacks => on_change(state: i32) -> ());
	userdata_arg!(userdata in callbacks => on_change);
	unsafe { sys::cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name.as_ptr(), on_change_trampoline, userdata, typ, initial_button_state) }.into_result()
}
/// Attaches a button to the control panel.
/// 
/// The function createButton attaches a button to the control panel. Each button is added to a
/// buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the
/// control panel before, or if the last element attached to the control panel was a trackbar or if the
/// QT_NEW_BUTTONBAR flag is added to the type.
/// 
/// See below various examples of the cv::createButton function call: :
/// ```ignore
///    createButton(NULL,callbackButton);//create a push button "button 0", that will call callbackButton.
///    createButton("button2",callbackButton,NULL,QT_CHECKBOX,0);
///    createButton("button3",callbackButton,&value);
///    createButton("button5",callbackButton1,NULL,QT_RADIOBOX);
///    createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1);
///    createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON|QT_NEW_BUTTONBAR);// create a push button in a new row
/// ```
/// 
/// 
/// ## Parameters
/// * bar_name: Name of the button.
/// * on_change: Pointer to the function to be called every time the button changes its state.
/// This function should be prototyped as void Foo(int state,\*void); . *state* is the current state
/// of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.
/// * userdata: Pointer passed to the callback function.
/// * type: Optional type of the button. Available types are: (cv::QtButtonTypes)
/// * initial_button_state: Default state of the button. Use for checkbox and radiobox. Its
/// value could be 0 or 1. (__Optional__)
/// 
/// ## C++ default parameters
/// * userdata: 0
/// * typ: QT_PUSH_BUTTON
/// * initial_button_state: false
Attaches a button to the control panel.
The function createButton attaches a button to the control panel. Each button is added to a
buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the
control panel before, or if the last element attached to the control panel was a trackbar or if the
QT_NEW_BUTTONBAR flag is added to the type.

See below various examples of the cv::createButton function call: :
```ignore
createButton(NULL,callbackButton);//create a push button "button 0", that will call callbackButton.
Attaches a button to the control panel . The function createButton attaches a button to the control panel . Each button is added to a buttonbar to the right of the last button . A new buttonbar is created if nothing was attached to the control panel before or if the last element attached to the control panel was a trackbar or if the QT_NEW_BUTTONBAR flag is added to the type . See below various examples of the cv :: createButton function call : : ` ` ` ignore createButton ( NULL callbackButton ) ; // create a push button " button 0 " that will call callbackButton .
pub fn create_button(bar_name: &str, on_change: crate::highgui::ButtonCallback, typ: i32, initial_button_state: bool) -> Result<i32> {
	string_arg!(bar_name);
	callback_arg!(on_change_trampoline(state: i32, userdata: *mut c_void) -> () => userdata in callbacks => on_change(state: i32) -> ());
	userdata_arg!(userdata in callbacks => on_change);
	unsafe { sys::cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name.as_ptr(), on_change_trampoline, userdata, typ, initial_button_state) }.into_result()
}
pub fn create_button ( bar_name : & str , on_change : crate :: highgui :: ButtonCallback , typ : i32 , initial_button_state : bool ) -> Result < i32 > { string_arg ! ( bar_name ) ; callback_arg ! ( on_change_trampoline ( state i32 userdata mut c_void ) ( ) userdata in callbacks on_change ( state i32 ) ( ) ) ; userdata_arg ! ( userdata in callbacks on_change ) ; unsafe { sys :: cv_createButton_const_StringX_ButtonCallback_voidX_int_bool ( bar_name . as_ptr ( ) , on_change_trampoline , userdata , typ , initial_button_state ) } . into_result ( ) }
Attaches a button to the control panel.
Attaches a button to the control panel .
bar_name
&str
on_change
crate::highgui::ButtonCallback
typ
i32
initial_button_state
bool
c++ default parameters
0
typ: QT_PUSH_BUTTON
initial_button_state: false
0 typ : QT_PUSH_BUTTON initial_button_state : false