Sha256: bec131b879eaf9cb7043562bc208559dfc2ab6f4b6046825baf2131f79c1a5b7

Contents?: true

Size: 561 Bytes

Versions: 4

Compression:

Stored size: 561 Bytes

Contents

#include "nkrb.h"

VALUE nkrb_ui_progress(VALUE self, VALUE context, VALUE rcurrent, VALUE rmax, VALUE rmodifiable) {
  struct nk_context *ctx = nkrb_context_get(context);
  nk_size current = (nk_size) NUM2LL(rcurrent);
  nk_size max     = (nk_size) NUM2LL(rmax);
  int modifiable  = nk_false;
  if (RTEST(rmodifiable)) modifiable = nk_true;

  if (nk_progress(ctx, &current, max, modifiable)) {
    return LL2NUM(current);
  }

  return Qnil;
}

void nkrb_ui_progress_init(void) {
  rb_define_method(mNuklearUIContainer, "ui_progress", nkrb_ui_progress, 4);
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nuklear-0.1.3 ext/nuklear/nkrb_ui_progress.c
nuklear-0.1.2 ext/nuklear/nkrb_ui_progress.c
nuklear-0.1.1 ext/nuklear/nkrb_ui_progress.c
nuklear-0.1.0 ext/nuklear/nkrb_ui_progress.c