The attitude thing is really tricky, and in my own observation, it's often because we hold children to a different, and more stringent, standard than we do other adults. We just don't treat them as nicely as we expect them to treat us.
Examples:
1) If a child wanted to use a grandparent's computer, even if the GP was goofing around and the child needed to look something up for a homework assignment, the GP would be "permitted" to get to a good stopping place before turning the computer over to the child. But we expect the child to comply instantly, as if her feelings and wishes have no value. Kids are not like little radios, and they are not able to "switch stations" with a quick push of a button.
2) If we ask an adult how their toe is feeling, and they don't want to talk about it right now, they have every right to say so. Even if they add an exasperated tone of voice or an eye-roll, we still allow them the courtesy of changing the topic without lecturing them for it or demanding an apology.
3) If I were having a low-blood-sugar case of the crabbies, which I've been plagued with all my life, my husband would perhaps ask me not to eat something he was saving in the refrigerator, but he'd also express concern for my physical/mental state and ask kindly if I wouldn't like some of "x" instead. His tone would be tender. We often talk to kids in a strident or demanding tone. If you were to play back the spaghetti incident, would your tone have been concerned or abrupt? Could make a huge difference in how your daughter responded.
I deal with my nearly-5yo grandson's attitudinal development by always, always, always modeling the tone of voice I'd like to hear from him, always speaking to him courteously, modeling good humored responses and patience, thinking of creative alternatives to everyday problems. We are an amazing team, even when he has a 3-day sleepover. He's terrific at home, and amazingly empathetic and thoughtful. He acts toward the adults in his life exactly as they behave toward him, with respect, patience, and cooperation.
He is a little kid, and more subject to the occasional frustrated meltdown than the rest of us, or childlike goofiness, or lack of knowledge of social norms, and we do have to keep his age in mind. But he's pretty astonishing for his age, and I don't think it's just a matter of him having an easy personality – this is what he has had modeled since birth.
There's a brilliant, practical, and easy-to-read little book called How to Talk So Kids Will Listen, and Listen So Kids Will Talk, by Faber and Mazlish. It's become my parenting bible. I've watched some pretty alarming behaviors in "problem" kids turn around almost miraculously when their parents began applying these techniques and principles. I can't recommend this book highly enough.