fn create_tab_header(&self, ctx: &mut Context, text: String, body: Entity) -> Entity {
        let cloned_entity = ctx.entity();
        TabHeader::new()
            .close_button(if self.close_button_visibility {
                Visibility::Visible
            } else {
                Visibility::Collapsed
            })
            .text(text)
            .on_header_mouse_down(move |states, _| {
                states
                    .get_mut::<TabWidgetState>(cloned_entity)
                    .select_by_body(body);
                true
            })
            .on_close_click(move |states, _| {
                states
                    .get_mut::<TabWidgetState>(cloned_entity)
                    .remove_by_body(body);
                true
            })
            .build(&mut ctx.build_context())
    }
//Create a new TabHeader entity and return it. For internal use.
Create a new TabHeader entity and return it. For internal use.
Create a new TabHeader entity and return it . For internal use .
fn create_tab_header(&self, ctx: &mut Context, text: String, body: Entity) -> Entity {
        let cloned_entity = ctx.entity();
        TabHeader::new()
            .close_button(if self.close_button_visibility {
                Visibility::Visible
            } else {
                Visibility::Collapsed
            })
            .text(text)
            .on_header_mouse_down(move |states, _| {
                states
                    .get_mut::<TabWidgetState>(cloned_entity)
                    .select_by_body(body);
                true
            })
            .on_close_click(move |states, _| {
                states
                    .get_mut::<TabWidgetState>(cloned_entity)
                    .remove_by_body(body);
                true
            })
            .build(&mut ctx.build_context())
    }
fn create_tab_header ( & self , ctx : & mut Context , text : String , body : Entity ) -> Entity { let cloned_entity = ctx . entity ( ) ; TabHeader :: new ( ) . close_button ( if self . close_button_visibility { Visibility :: Visible } else { Visibility :: Collapsed } ) . text ( text ) . on_header_mouse_down ( move | states , _ | { states . get_mut :: < TabWidgetState > ( cloned_entity ) . select_by_body ( body ) ; true } ) . on_close_click ( move | states , _ | { states . get_mut :: < TabWidgetState > ( cloned_entity ) . remove_by_body ( body ) ; true } ) . build ( & mut ctx . build_context ( ) ) }
Create a new TabHeader entity and return it.
Create a new TabHeader entity and return it .
&self
ctx
&mut Context
text
String
body
Entity