Answers about using switch or bundle || in if are true, but ...
If you have large enumerations (an enumeration with a large number of values), you can make this simpler. Cocoa also uses this trick.
Your listing values ββshould be increased by one .
Then add two additional values ββfor listing:
typedef enum { buttonIDMin = 407,
When you compare, you just need to do:
if (buttonID >= buttonIDMin && buttonID <= buttonIDMax) ...
source share