I find that when learning a complicated system or library, the best way is to write out the code examples, compile them, then change things until they break, fix it, then make more changes. Eventually you end up with the worst code ever known to man and a thorough understanding of the system at hand. I did it recently when figuring out that there is more to terminal emulation than just IO redirection and interpreting Terminal codes.
Most of the time, you'll bang your head against your desk screaming "why wont you work" until you brain-damage your way into an epiphany, fix everything, achieve enlightenment, ???, PROFIT!