Onomatopoeia is the formation of a word from a sound associated with what it represents. For example:
* Buzz for the sound of a bee
* Meow for the sound of a cat
* Bang for the sound of a door slamming
Whistling is a sound, but it doesn't have a specific word that imitates it. We might describe a whistle as "whoosh", "whee", or "pew" depending on the type of whistle, but those are individual words, not the act of whistling itself.
Therefore, whistling is not an example of onomatopoeia.