Locked in an ideological struggle between tea party activists and traditional conservatives, the Texas Republican Convention was hammering out a platform Saturday set to preserve a softer stance on immigration, while also endorsing voluntary counseling to "cure" being gay.

Booing and shouting sometimes interrupted hours of debate among roughly 7,000 delegates, and party chairman Steve Munisteri pleaded for civility. Far less contentious, though, was a 2016 presidential straw poll expected to be dominated by firebrand U.S. Sen. Ted Cruz.

Firebrand U.S. Sen. Ted Cruz has easily won a 2016 presidential straw poll at the state Republican Convention in his native Texas. Cruz took 43 percent of the vote Saturday, at a gathering in Fort Worth featuring roughly 7,000 delegates. Conservative speaker and author Ben Carson was second with 12.2 percent. The result was announced a day after Cruz promised to lead a national conservative revolution unseen since the days of Ronald Reagan. Cruz easily bested Texas Gov. Rick Perry who took 11.7 percent, and fellow tea party favorite and U.S. Sen. Rand Paul of Kentucky, who won 12.1 percent. Perry also addressed the convention as did Paul, who was born in Texas and whose father Ron long-served in Congress from the state.

Cruz refuses to say for sure whether he's running for president, and wouldn't predict a straw poll win -- saying only "I'll leave it up to the delegates."

In the meantime, the convention appeared ready to largely keep a hotly debated 2012 party platform plank endorsing a guest-worker program for those in the country illegally. The so-called "Texas Solution" is meant to satisfy the needs of a booming Texas economy and was supposed to act as a model for comprehensive, federal immigration reform.

But opponents -- many fierce, grass-roots conservatives and tea party activists -- said such a platform would sanction amnesty for lawbreakers.

Delegates approved a proposed compromise that removes a specific call for a guest-worker program but creates a work-permit program that does essentially the same thing. Though it still needs final approval, the new plank is set to have work permits expire after five years, and not allow them to be issued until the U.S.-Mexico border is secure.

The definition of a secure border would be left up to border states -- not the federal government.

"I defy the media to represent this as divisive," said state Republican Party Chairman Steve Munisteri when an amendment spelling out the immigration compromise was adopted after only about an hour of sometimes heated debate.

Meanwhile, delegates looked poised to avoid a floor fight as they considered scrapping long-standing platform language that "homosexuality tears at the fabric of society." But they also were set to sanction language allowing Texans to seek voluntary counseling to "cure" being gay -- in contrast to California and New Jersey, which have previously banned such therapy, citing evidence it was dangerous to young people.

Gay conservatives said they didn't want to oppose the motion for fear there could be a backlash resulting in even harsher platform language.

A more-contentious issue was a defeated proposal backing medical marijuana. Supporters, however, claimed victory since the issue made it to the convention floor for discussion.

"I believe this is a party of personal liberty," said delegate David Westbrook, a supporter of medical marijuana. "It means we have to be consistent on it."

Demonstrators advocating for open-carry gun laws rallied outside the convention throughout the week, even wearing rifles. But the proposed platform largely steered clear of demanding major changes in Texas law on firearms. Instead, delegates were expected to pass a non-binding resolution imploring the state Legislature to approve more-lenient gun rules.