What does "/** Ext. of ancestor*/" in extended data mean?

For example, in lv_btn.h

/** Extended data of button*/
typedef struct
    /** Ext. of ancestor*/
    lv_cont_ext_t cont;

    /** 1: Toggle enabled*/
    uint8_t checkable : 1;
} lv_btn_ext_t;

I don’t know what does ‘cont’ do, because I can’t find it in lv_btn.c

It’s in lv_cont.h.

yes. I know, but button how to use cont extended data?

The button overrides lv_cont_signal, where all the container logic happens. That way, it can be a container with special features added. The container logic happens in lv_cont.c.

oh,I understand. Because it use cont obj, and it extend cont obj. This is IS-A, not has-A.

1 Like