Thanks Chris,
I think that not only is my code broken my idea on how to do what I want is broken. I must fix that before I start on the code.
My starting point was two button, scan off and scan on in glade. Scan on sets a flag and it scans til the off button is pressed. So the off button could not be pressed til end-of-scan, a situation commonly known as a deadly embrace in hardware design. After that g_idle_add() was pointed out to me and I've been innovating rather blindly ever since.
I interpreted g_idle_add() as inserting Scanning() into the main loop and if Scanning returned FALSE it was removed from the main loop. So I guess I'm not understanding the following explanation of
guint g_idle_add(GSourceFunc function, gpointer data); :-