From c397bfc883683c815e5c0c06adb9c2c9c0ca578b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 23 Jul 2013 14:19:04 -0400 Subject: [PATCH] add newtComponentGetSize and newtComponentGetPosition (#987596) --- newt.c | 9 +++++++++ newt.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/newt.c b/newt.c index 29bea79..be32108 100644 --- a/newt.c +++ b/newt.c @@ -1160,3 +1160,12 @@ void newtTrashScreen(void) { SLsmg_touch_lines(0, SLtt_Screen_Rows); } +void newtComponentGetPosition(newtComponent co, int * left, int * top) { + if (left) *left = co->left; + if (top) *top = co->top; +} + +void newtComponentGetSize(newtComponent co, int * width, int * height) { + if (width) *width = co->width; + if (height) *height = co->height; +} diff --git a/newt.h b/newt.h index 65a566b..9f73006 100644 --- a/newt.h +++ b/newt.h @@ -263,6 +263,9 @@ void newtScaleSetColors(newtComponent co, int empty, int full); void newtComponentAddCallback(newtComponent co, newtCallback f, void * data); void newtComponentTakesFocus(newtComponent co, int val); +void newtComponentGetPosition(newtComponent co, int * left, int * top); +void newtComponentGetSize(newtComponent co, int * width, int * height); + /* This callback is called when a component is destroyed. */ void newtComponentAddDestroyCallback(newtComponent co, newtCallback f, void * data); -- 2.47.3