imtk
diff src/button.c @ 20:c7a7ddbe7714
half-arsed automatic layout
author | John Tsiombikas <nuclear@siggraph.org> |
---|---|
date | Sat, 30 Apr 2011 05:23:59 +0300 |
parents | df2bc9406561 |
children |
line diff
1.1 --- a/src/button.c Tue Apr 26 22:53:21 2011 +0300 1.2 +++ b/src/button.c Sat Apr 30 05:23:59 2011 +0300 1.3 @@ -14,6 +14,10 @@ 1.4 1.5 assert(id >= 0); 1.6 1.7 + if(x == IMTK_AUTO || y == IMTK_AUTO) { 1.8 + imtk_layout_get_pos(&x, &y); 1.9 + } 1.10 + 1.11 calc_button_size(label, &w, &h); 1.12 1.13 if(imtk_hit_test(x, y, w, h)) { 1.14 @@ -35,6 +39,7 @@ 1.15 } 1.16 1.17 draw_button(id, label, x, y, over); 1.18 + imtk_layout_advance(w, h); 1.19 return res; 1.20 } 1.21