They (i.e., Disney and Viacom) do have princesses-types doing actiony stuff thinking it's the same thing. And encouraging women to lean in.
They don't typically write those females to think like a someone in engineering, exploration, or security, though. Boys watch Batman be Batman, train hard, think ahead, get beat up, but still be heroic. Girls watch, what, the girl from Brave do action hero things and fight with her mom. Or the princesses from Frozen use amazing powers to resolve what end up being relationship issues.
Honestly, though, I suspect it's difficult to get writers for kids' shows that can think like, say, a theoretical physicist. Writers tend to get art or English degrees.
I suspect it's not television or other media, but rather personal role models in their life.
Unfortunately with society as it is now, having a role model who isn't your gender (and also isn't your relative), mentor you is largely untennable.
Why do you assume this is cause rather than effect? I find it hard to imagine we set out to define gender roles, rather than those roles evolving over a long time due to a billion factors.
The economics of our society have changed both in what efforts are expected from whom, and in what options are granted to whom. That changes some of the billion factors weighing on our constructed social order, but there are still those who benefit from retarding the process.
The problem is a certain things have a very high barrier to entry. Getting into such things requires over the natural amounts of persistence and other myriad life skills for which you need a certain level of biological independence(like not having kids for example).
These barrier to entries vary with each profession. They are higher for the cool jobs, like the CS ones. Most of these career type jobs where continued work is required. Taking long breaks, asking for lesser working hours(While having colleagues at office who would be pushing 15-18 hour workdays) and other such things makes you a bad worker even if you were to somehow work hard and gain initial access. Net result is people feel they are better off doing things where their contributions have some meaning than having to compete with 16 hr shift workers against whom you are set up to lose by default.
This is the whole difficulty with the diversity problem. There is a inherent assumption that things be made easier to accomodate minorities of all kids. Whereas doing well in any profession requires the exact opposite. Harder the things, the better you get by doing them. But that also means, people who are not tough enough for the job get filtered out every iteration along the way.
You just come down to the point that you can't make people do, what they are not ready to put over the necessary efforts to make happen.
Well, for the cool CS jobs, yeah, which is maybe 1% of the total. The rest aren't cool—they're brain-meltingly boring, often frustrating, health-destroyingly sedentary, and often (not always) fairly low-status, despite the pay[0]. The way-above-median pay's just about all a CS career's got going for it, for most.
[0] Compare especially the status boost granted by entering either of two full-on professions which, strikingly, kept improving gender balance through the 80s and beyond despite a long history of being dominated by men: law and medicine. Meanwhile, CS/programming started out better, then got worse around the mid 80s, as measured by graduates in relevant majors.
Partly that's because those 1% have to do outreach to get enough workers willing to endure those conditions, and partly it's because those are entire companies filled with passionate people (because everyone who doesn't love the job quickly quits) and they want to share their passion.
Most employers won't. But yet some people pour in a lot of time to make themselves better. That is precisely the whole point.
Its exactly a bit like school. Schools won't force you to put any hours. But people putting in late nighters and burning the midnight oil end up scoring high marks and getting better grades.
How do you suggest we help low scoring students? By telling the better student to study less?
You know what else we are influenced by? Biological traits, see: https://en.wikipedia.org/wiki/Sexual_dimorphism
Did you think about what if she would have a happier life as a ballerina than an astronaut?
There is also the fact that those who truly want something will go get it despite the headwinds.
Rather peoples inclinations are varied and weak, so a society that discourages women from entering science will find more than half of women who had a weak inclination to science will simply choose the next-equal profession they were inclined to.
How would one go about preventing this from happenning without segregating the child?
You the parent have to go out of your way to make a list of women astronauts, scientists, stateswomen, authors, captains, professors-- everything-- so your daughter grows up in a world women can do anything.
I have a two year old and I can tell you fighting against pinky-princess girl culture is a battle. As a parent, it's you vs basically the rest of society that sends a million little cues about what girls are supposed to do. I had this conversation with my daughter the other morning:
Daughter: I want to be a boy when I grow up. Me: Why is that? Daughter: So I can be an astronaut!
Of course, I explained that girls can be astronauts too. And I've never done anything to set her expectations differently. But they just absorb this stuff from the ether of our culture. At her age, she's picked up on the idea that only boys are astronauts, and girls are ballerinas and princesses and shit.