# lv_obj_class.h (/api/core/lv_obj_class_h)



<RelatedHeaders name="lv_obj_class_private.h" isPrivate="false" />

<ApiSummary functions="5" enums="3" typedefs="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Other (4)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_obj_set_external_data" file="core/lv_obj_class.h" line="78" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L78">
      lv_obj_set_external_data [#lv_obj_set_external_data]

      Associates an array of external data pointers with an LVGL object.

      Associates custom user data with an LVGL object and specifies a destructor function that will be automatically invoked when the object is deleted to properly clean up the associated resources.

      ```c title=" " lineNumbers=1
      void lv_obj_set_external_data(lv_obj_t *obj, void *data, void(*free_cb)(void *data))
      ```

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

      | Name      | Type                                             | Description                                                                                                                                                |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | Target LVGL object                                                                                                                                         |
      | `data`    | `void *`                                         | User-defined data pointer to associate with a object                                                                                                       |
      | `free_cb` | `void(*)(void *data)`                            | Cleanup function called for each non-NULL data pointer during object deletion. Receives single data pointer as parameter. NULL means no automatic cleanup. |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (4)">
    <ApiMember kind="function" name="lv_obj_class_create_obj" file="core/lv_obj_class.h" line="56" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L56">
      lv_obj_class_create_obj [#lv_obj_class_create_obj]

      Create an object form a class descriptor

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t *class_p, lv_obj_t *parent)
      ```

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

      | Name      | Type                                                               | Description                                                 |
      | --------- | ------------------------------------------------------------------ | ----------------------------------------------------------- |
      | `class_p` | <ApiLink name="lv_obj_class_t" display="const lv_obj_class_t *" /> | pointer to a class                                          |
      | `parent`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />                   | pointer to an object where the new object should be created |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created object
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_class_init_obj" file="core/lv_obj_class.h" line="58" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L58">
      lv_obj_class_init_obj [#lv_obj_class_init_obj]

      ```c title=" " lineNumbers=1
      void lv_obj_class_init_obj(lv_obj_t *obj)
      ```

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

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

    <ApiMember kind="function" name="lv_obj_is_editable" file="core/lv_obj_class.h" line="60" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L60">
      lv_obj_is_editable [#lv_obj_is_editable]

      ```c title=" " lineNumbers=1
      bool lv_obj_is_editable(lv_obj_t *obj)
      ```

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

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

    <ApiMember kind="function" name="lv_obj_is_group_def" file="core/lv_obj_class.h" line="62" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L62">
      lv_obj_is_group_def [#lv_obj_is_group_def]

      ```c title=" " lineNumbers=1
      bool lv_obj_is_group_def(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             |
      | ----- | ------------------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_obj_class_editable_t" file="core/lv_obj_class.h" line="28" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L28">
  lv_obj_class_editable_t [#lv_obj_class_editable_t]

  | Name                            | Description                                                                   |
  | ------------------------------- | ----------------------------------------------------------------------------- |
  | `LV_OBJ_CLASS_EDITABLE_INHERIT` | Check the base class. Must have 0 value to let zero initialized class inherit |
  | `LV_OBJ_CLASS_EDITABLE_TRUE`    |                                                                               |
  | `LV_OBJ_CLASS_EDITABLE_FALSE`   |                                                                               |
</ApiMember>

<ApiMember kind="enum" name="lv_obj_class_group_def_t" file="core/lv_obj_class.h" line="34" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L34">
  lv_obj_class_group_def_t [#lv_obj_class_group_def_t]

  | Name                             | Description                                                                   |
  | -------------------------------- | ----------------------------------------------------------------------------- |
  | `LV_OBJ_CLASS_GROUP_DEF_INHERIT` | Check the base class. Must have 0 value to let zero initialized class inherit |
  | `LV_OBJ_CLASS_GROUP_DEF_TRUE`    |                                                                               |
  | `LV_OBJ_CLASS_GROUP_DEF_FALSE`   |                                                                               |
</ApiMember>

<ApiMember kind="enum" name="lv_obj_class_theme_inheritable_t" file="core/lv_obj_class.h" line="40" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L40">
  lv_obj_class_theme_inheritable_t [#lv_obj_class_theme_inheritable_t]

  | Name                                   | Description                           |
  | -------------------------------------- | ------------------------------------- |
  | `LV_OBJ_CLASS_THEME_INHERITABLE_FALSE` | Do not inherit theme from base class. |
  | `LV_OBJ_CLASS_THEME_INHERITABLE_TRUE`  |                                       |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_obj_class_event_cb_t" file="core/lv_obj_class.h" line="45" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_class.h#L45">
  lv_obj_class_event_cb_t [#lv_obj_class_event_cb_t]

  ```c title=" " lineNumbers=1
  typedef void(* lv_obj_class_event_cb_t) (lv_obj_class_t *class_p, lv_event_t *e)
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_types.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_obj_property.h&#x22;]" includedBy="[&#x22;lv_obj.h&#x22;, &#x22;lv_obj_class_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.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_draw_buf.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_palette.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;]" />
