diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-19 19:40:23 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-19 19:40:23 -0400 |
| commit | 988c3a7dd830ea42ce019cb63eade88abdfdd235 (patch) | |
| tree | 042d3ec26d3e3f3763558b84ea852db10793c887 | |
| parent | 99bfbbbed5ead6a4e4f103c439236784c851d26f (diff) | |
Added a count variable to the table structure.
| -rw-r--r-- | wintable/main.c | 5 |
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) { |
