I recently saw some code for a user interface that had a notebook widget. When the notebook page changed, the UI received a notification containing the tab number that was selected. In order to bring up the right page, however, the code extracted the string displayed on the tab and performed string comparisons to decide what page to bring up. This practice is going to lead to trouble. The strings displayed in the UI are subject to change but you don't want those changes affecting your code. In addition, it makes it hard to add additional languages to your user interface because your code would have to check the word in all different languages. You should avoid having your code extract strings from labels on the user interface to determine what to do. There's almost always a better way.
Download