summaryrefslogtreecommitdiff
path: root/wintable/main.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-19 19:40:23 -0400
committerPietro Gagliardi <[email protected]>2014-10-19 19:40:23 -0400
commit988c3a7dd830ea42ce019cb63eade88abdfdd235 (patch)
tree042d3ec26d3e3f3763558b84ea852db10793c887 /wintable/main.c
parent99bfbbbed5ead6a4e4f103c439236784c851d26f (diff)
Added a count variable to the table structure.
Diffstat (limited to 'wintable/main.c')
-rw-r--r--wintable/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wintable/main.c b/wintable/main.c
index b5ca5ba..d99e820 100644
--- a/wintable/main.c
+++ b/wintable/main.c
@@ -28,6 +28,7 @@ struct table {
HFONT defaultFont;
HFONT font;
intptr_t selected;
+ intptr_t count;
};
static void drawItems(struct table *t, HDC dc)
@@ -46,7 +47,7 @@ static void drawItems(struct table *t, HDC dc)
if (GetTextMetricsW(dc, &tm) == 0)
abort();
y = 0;
- for (i = 0; i < 100; i++) {
+ for (i = 0; i < t->count; i++) {
RECT rsel;
HBRUSH background;
@@ -89,7 +90,7 @@ static LRESULT CALLBACK tableWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
if (t->defaultFont == NULL)
abort();
t->font = t->defaultFont;
-t->selected = 5;//TODO
+t->selected = 5;t->count=100;//TODO
SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) t);
}
switch (uMsg) {