Class: Nuklear::UIBuilder

Inherits:
Object
  • Object
show all
Defined in:
ext/nuklear/nkrb_ui_builder.c

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Object



7
8
9
10
# File 'ext/nuklear/nkrb_ui_builder.c', line 7

VALUE nkrb_ui_initialize(VALUE self, VALUE context) {
  rb_ivar_set(self, rb_intern("@context"), context);
  return self;
}

Instance Method Details

#list_view(id, flags, row_height, row_count) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'ext/nuklear/nkrb_ui_builder.c', line 13

VALUE nkrb_ui_list_view_begin(VALUE self, VALUE id, VALUE flags, VALUE row_height, VALUE row_count) {
  UNPACK_CONTEXT(ctx);
  struct nk_list_view view;
  if (nk_list_view_begin(ctx, &view, StringValueCStr(id), FIX2INT(flags), FIX2INT(row_height), FIX2INT(row_count))) {
    if (rb_block_given_p()) {
      instance_eval_block(self);
    }
    nk_list_view_end(&view);
  }
  return self;
}