Skip to content

Commit

Permalink
add refresh_slot method to canvas. #152. Experimental.
Browse files Browse the repository at this point in the history
* Need tests
  • Loading branch information
Cecil committed Oct 5, 2015
1 parent e489bae commit b1c1318
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shoes/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,12 @@ shoes_canvas_remove(VALUE self)
return self;
}

VALUE
shoes_canvas_refresh_slot(VALUE self)
{
shoes_canvas_repaint_all(self);
}

static void
shoes_canvas_place(shoes_canvas *self_t)
{
Expand Down
2 changes: 2 additions & 0 deletions shoes/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ VALUE shoes_canvas_children(VALUE);
void shoes_canvas_size(VALUE, int, int);
VALUE shoes_canvas_clear_contents(int, VALUE *, VALUE);
VALUE shoes_canvas_remove(VALUE);
VALUE shoes_canvas_refresh_slot(VALUE); // 3.3.0
VALUE shoes_canvas_draw(VALUE, VALUE, VALUE);
VALUE shoes_canvas_after(int, VALUE *, VALUE);
VALUE shoes_canvas_before(int, VALUE *, VALUE);
Expand Down Expand Up @@ -482,6 +483,7 @@ VALUE shoes_canvas_dialog_plain(VALUE);
VALUE shoes_canvas_snapshot(int, VALUE *, VALUE);
VALUE shoes_canvas_download(int, VALUE *, VALUE);


SHOES_SLOT_OS *shoes_slot_alloc(shoes_canvas *, SHOES_SLOT_OS *, int);
VALUE shoes_slot_new(VALUE, VALUE, VALUE);
VALUE shoes_flow_new(VALUE, VALUE);
Expand Down
1 change: 1 addition & 0 deletions shoes/ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -4596,6 +4596,7 @@ shoes_ruby_init()
rb_define_method(cCanvas, "show", CASTHOOK(shoes_canvas_show), 0);
rb_define_method(cCanvas, "toggle", CASTHOOK(shoes_canvas_toggle), 0);
rb_define_method(cCanvas, "remove", CASTHOOK(shoes_canvas_remove), 0);
rb_define_method(cCanvas, "refresh_slot", CASTHOOK(shoes_canvas_refresh_slot), 0);

cShoes = rb_define_class("Shoes", cCanvas);
rb_include_module(cShoes, cTypes);
Expand Down

1 comment on commit b1c1318

@ccoupe
Copy link

@ccoupe ccoupe commented on b1c1318 Oct 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figure out how to test it! I have no idea.

Please sign in to comment.