51 String *classNames = $((Object *) this->classNames,
description);
52 String *
description = str(
"%s@%p \"%s\" %s [%d, %d, %d, %d]",
53 this->identifier ?: classnameof(self),
55 ((
Label *) self)->text->text,
57 this->frame.x, this->frame.y, this->frame.w, this->frame.h);
78 $(self,
bind, inlets, dictionary);
110#pragma mark - Class lifecycle
117 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
118 ((ObjectInterface *) clazz->interface)->description =
description;
121 ((ViewInterface *) clazz->interface)->init =
init;
123 ((LabelInterface *) clazz->interface)->initWithText =
initWithText;
135 clazz = _initialize(&(
const ClassDef) {
137 .superclass =
_View(),
138 .instanceSize =
sizeof(
Label),
139 .interfaceOffset = offsetof(
Label, interface),
140 .interfaceSize =
sizeof(LabelInterface),
static String * description(const Object *self)
static void dealloc(Object *self)
static void initialize(Class *clazz)
#define MakeInlets(...)
Creates a null-termianted array of Inlets.
#define MakeInlet(name, type, dest, data)
Creates an Inlet with the specified parameters.
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
Inlets enable inbound data binding of View attributes through JSON.
Labels provide a configurable container for Text.
Text * text
The Label Text.
Label * initWithText(Label *self, const char *text, Font *font)
Initializes this Label with the given text and Font.
Class * _Label(void)
The Label archetype.
Text rendered with TrueType fonts.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
_Bool bind(View *self, const Inlet *inlets, const Dictionary *dictionary)
Performs data binding for the Inlets described in dictionary.
_Bool needsLayout
If true, this View will layout its subviews before it is drawn.
Class * _View(void)
The View archetype.
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
void awakeWithDictionary(View *self, const Dictionary *dictionary)
Wakes this View with the specified Dictionary.