# lv_obj_private.h (/api/core/lv_obj_private_h)



<RelatedHeaders name="lv_obj.h" isPrivate="true" />

<ApiSummary functions="3" structs="2" typedefs="1" />

Functions [#functions]

<ApiMember kind="function" name="lv_obj_allocate_spec_attr" file="core/lv_obj_private.h" line="102" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_private.h#L102">
  lv_obj_allocate_spec_attr [#lv_obj_allocate_spec_attr]

  Allocate special data for an object if not allocated yet.

  ```c title=" " lineNumbers=1
  lv_obj_spec_attr_t * lv_obj_allocate_spec_attr(lv_obj_t *obj)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name  | Type                                             | Description          |
  | ----- | ------------------------------------------------ | -------------------- |
  | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an object |

  **Returns:** <ApiLink name="lv_obj_spec_attr_t" display="lv_obj_spec_attr_t *" /> — the spec\_attr created or NULL if something went wrong
</ApiMember>

<ApiMember kind="function" name="lv_obj_add_child" file="core/lv_obj_private.h" line="104" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_private.h#L104">
  lv_obj_add_child [#lv_obj_add_child]

  ```c title=" " lineNumbers=1
  lv_result_t lv_obj_add_child(lv_obj_t *parent, lv_obj_t *child)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name     | Type                                             |
  | -------- | ------------------------------------------------ |
  | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> |
  | `child`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> |
</ApiMember>

<ApiMember kind="function" name="lv_obj_remove_child" file="core/lv_obj_private.h" line="105" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_private.h#L105">
  lv_obj_remove_child [#lv_obj_remove_child]

  ```c title=" " lineNumbers=1
  void lv_obj_remove_child(lv_obj_t *parent, lv_obj_t *child)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name     | Type                                             |
  | -------- | ------------------------------------------------ |
  | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> |
  | `child`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="_lv_obj_spec_attr_t">
  \_lv_obj_spec_attr_t [#_lv_obj_spec_attr_t]

  Special, rarely used attributes. They are allocated automatically if any elements is set.

  | Member           | Type                                                 | Description                                                                |
  | ---------------- | ---------------------------------------------------- | -------------------------------------------------------------------------- |
  | `children`       | <ApiLink name="lv_obj_t" display="lv_obj_t **" />    | Store the pointer of the children in an array.                             |
  | `group_p`        | <ApiLink name="lv_group_t" display="lv_group_t *" /> |                                                                            |
  | `event_list`     | <ApiLink name="lv_event_list_t" />                   |                                                                            |
  | `name`           | `const char *`                                       | Pointer to the name                                                        |
  | `scroll`         | <ApiLink name="lv_point_t" />                        | The current X/Y scroll offset                                              |
  | `ext_click_pad`  | <ApiLink name="int32_t" />                           | Extra click padding in all direction                                       |
  | `ext_draw_size`  | <ApiLink name="int32_t" />                           | EXTend the size in every direction for drawing.                            |
  | `child_cnt`      | <ApiLink name="uint16_t" />                          | Number of children                                                         |
  | `scrollbar_mode` | <ApiLink name="uint16_t" />                          | How to display scrollbars, see `lv_scrollbar_mode_t`                       |
  | `scroll_snap_x`  | <ApiLink name="uint16_t" />                          | Where to align the snappable children horizontally, see `lv_scroll_snap_t` |
  | `scroll_snap_y`  | <ApiLink name="uint16_t" />                          | Where to align the snappable children vertically                           |
  | `scroll_dir`     | <ApiLink name="uint16_t" />                          | The allowed scroll direction(s), see `lv_dir_t`                            |
  | `layer_type`     | <ApiLink name="uint16_t" />                          | Cache the layer type here. Element of lv\_intermediate\_layer\_type\_t     |
  | `name_static`    | <ApiLink name="uint16_t" />                          | 1: `name` was not dynamically allocated                                    |
</ApiMember>

<ApiMember kind="struct" name="_lv_obj_t">
  \_lv_obj_t [#_lv_obj_t]

  | Member                         | Type                                                                 | Description                                                                                         |
  | ------------------------------ | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
  | `ext_data`                     | <ApiLink name="lv_ext_data_t" />                                     |                                                                                                     |
  | `class_p`                      | <ApiLink name="lv_obj_class_t" display="const lv_obj_class_t *" />   |                                                                                                     |
  | `parent`                       | <ApiLink name="lv_obj_t" display="lv_obj_t *" />                     |                                                                                                     |
  | `spec_attr`                    | <ApiLink name="lv_obj_spec_attr_t" display="lv_obj_spec_attr_t *" /> |                                                                                                     |
  | `styles`                       | <ApiLink name="lv_obj_style_t" display="lv_obj_style_t *" />         |                                                                                                     |
  | `user_data`                    | `void *`                                                             |                                                                                                     |
  | `id`                           | `void *`                                                             |                                                                                                     |
  | `coords`                       | <ApiLink name="lv_area_t" />                                         |                                                                                                     |
  | `flags`                        | <ApiLink name="lv_obj_flag_t" />                                     |                                                                                                     |
  | `state`                        | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `layout_inv`                   | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `readjust_scroll_after_layout` | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `scr_layout_inv`               | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `skip_trans`                   | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `style_cnt`                    | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `h_layout`                     | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `w_layout`                     | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `h_ignore_size`                | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `w_ignore_size`                | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `is_deleting`                  | <ApiLink name="uint16_t" />                                          |                                                                                                     |
  | `radio_button`                 | <ApiLink name="uint16_t" />                                          | Allow only one RADIO\_BUTTON sibling to be checked                                                  |
  | `rendered`                     | <ApiLink name="uint16_t" />                                          | The widget is rendered at least once already. It's used to skip initial animations and transitions. |
</ApiMember>

<TypeUsedBy name="_lv_obj_t" count="1">
  * `lv_screen_load` — param `scr`
</TypeUsedBy>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_obj_spec_attr_t" file="core/lv_obj_private.h" line="53" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_private.h#L53">
  lv_obj_spec_attr_t [#lv_obj_spec_attr_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_obj_spec_attr_t lv_obj_spec_attr_t
  ```

  Special, rarely used attributes. They are allocated automatically if any elements is set.
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_ext_data.h&#x22;, &#x22;lv_obj.h&#x22;]" includedBy="[&#x22;lv_file_explorer_private.h&#x22;, &#x22;lv_3dtexture_private.h&#x22;, &#x22;lv_arc_private.h&#x22;, &#x22;lv_arclabel_private.h&#x22;, &#x22;lv_bar_private.h&#x22;, &#x22;lv_button_private.h&#x22;, &#x22;lv_buttonmatrix_private.h&#x22;, &#x22;lv_calendar_private.h&#x22;, &#x22;lv_chart_private.h&#x22;, &#x22;lv_checkbox_private.h&#x22;, &#x22;lv_dropdown_private.h&#x22;, &#x22;lv_image_private.h&#x22;, &#x22;lv_imagebutton_private.h&#x22;, &#x22;lv_ime_pinyin_private.h&#x22;, &#x22;lv_label_private.h&#x22;, &#x22;lv_led_private.h&#x22;, &#x22;lv_line_private.h&#x22;, &#x22;lv_menu_private.h&#x22;, &#x22;lv_msgbox_private.h&#x22;, &#x22;lv_roller_private.h&#x22;, &#x22;lv_scale_private.h&#x22;, &#x22;lv_span_private.h&#x22;, &#x22;lv_switch_private.h&#x22;, &#x22;lv_table_private.h&#x22;, &#x22;lv_tabview_private.h&#x22;, &#x22;lv_textarea_private.h&#x22;, &#x22;lv_tileview_private.h&#x22;, &#x22;lv_win_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
