From: John Tsiombikas Date: Fri, 10 Jan 2020 11:00:04 +0000 (+0200) Subject: usbonly checkbox callback X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=instimg;a=commitdiff_plain;h=377e150b95639825a58c759d5ed51406fb14e429 usbonly checkbox callback --- diff --git a/src/main.c b/src/main.c index 12c6ced..10b3a25 100644 --- a/src/main.c +++ b/src/main.c @@ -16,6 +16,7 @@ static int num_rawdev; static void update_disks(void); static void onclick(struct wgt_widget *w); static void onmodify(struct wgt_widget *w); +static void ck_usbonly_handler(struct wgt_widget *w); int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprevinst, char *cmdline, int showcmd) @@ -34,7 +35,7 @@ int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprevinst, char *cmdline, int show y = wgt_ypos_after(cb_devs, 16); ck_usbonly = wgt_checkbox(win, "only show USB devices", 1, x, y, - WGT_AUTO, WGT_AUTO, 0); + WGT_AUTO, WGT_AUTO, ck_usbonly_handler); y = wgt_ypos_after(ck_usbonly, 16); bn_inst = wgt_button(win, "Install", 10, y, WGT_AUTO, WGT_AUTO, onclick); @@ -128,3 +129,9 @@ static void onmodify(struct wgt_widget *w) MessageBox(0, selstr, "selected item", MB_OK); } } + +static void ck_usbonly_handler(struct wgt_widget *w) +{ + printf("FOO\n"); + update_disks(); +}