Gambas Documentation - /dev/api/name/gb_base

/dev/api/name/gb_base

# GB_BASE

typedef struct { GB_CLASS klass; intptr_t ref; } GB_BASE;

This structure represents the base of every Gambas object. It must be placed in the beginning of all object structure defined in a component.

- The klass field is the class of the object.

- The ref field is its reference counter.

Do not touch them ! They are managed by the interpreter.

### Examples

    /* Here is the definition of a Control object in the =gb.qt4= component */

    typedef
      struct CWIDGET {
        GB_BASE ob;
        QWidget *widget;
        struct {
          unsigned short f;
          unsigned expand : 1;
          unsigned ignore : 1;
          unsigned notified : 1;
          unsigned visible : 1;
          unsigned fillBackground : 1;
          unsigned noBackground : 1;
          unsigned shown : 1;
          unsigned tracking : 1;
          unsigned old_tracking : 1;
          unsigned grab : 1;
          unsigned dragging: 1;
          unsigned _reserved : 5;
          } flag;
        GB_VARIANT_VALUE tag;
        char *name;
        void *cursor;
        void *font;
        char *popup;
        void *proxy;
        void *proxy_for;
        char *action;
        int level;
        int fg;
        int bg;
      }
      CWIDGET;