Dear all,
Some background first:
I have a gtk window where my user pushes some
buttons with a definite pleasure. It usually
amounts to asking the program to try all possible
permutations which can take a long time... and
in between my user wants to change some parameters,
or simply wants to stop. Regularly this programm
outputs some messages corresponding to its state.
So how to do this properly? I can add a button
with "Stop" written on it, but what will it do???
This signal is caught, ok, and then?
Should I use a global variable, a USER_INTERRUPTI ON
that my Stop-button would put to true and check
regularly for its value?
Any comments on how this is usually and properly done
are most welcomed!! Or sample code, or pointers.
Many thanks,
Amities,
Olivier
Some background first:
I have a gtk window where my user pushes some
buttons with a definite pleasure. It usually
amounts to asking the program to try all possible
permutations which can take a long time... and
in between my user wants to change some parameters,
or simply wants to stop. Regularly this programm
outputs some messages corresponding to its state.
So how to do this properly? I can add a button
with "Stop" written on it, but what will it do???
This signal is caught, ok, and then?
Should I use a global variable, a USER_INTERRUPTI ON
that my Stop-button would put to true and check
regularly for its value?
Any comments on how this is usually and properly done
are most welcomed!! Or sample code, or pointers.
Many thanks,
Amities,
Olivier
Comment