Wrapping radiobutton labels

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
slow_runner
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2
Joined: Mon Oct 31, 2011 5:03 pm

Wrapping radiobutton labels

Post by slow_runner » Thu Dec 01, 2011 4:20 pm

Hi there,

I'm working on a set of radiobuttons whose labels are set dynamically and vary in length. Most labels are too long to fit their space within just one line. Is there a way to get the labels to wrap?

Thanks a lot in advance,
slow

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Wrapping radiobutton labels

Post by jmburnod » Thu Dec 01, 2011 5:47 pm

Hi slow,

Sorry i think it is no possible to wrap the labels but you can use some groups and simulate the behavior of radio buttons

Best regards

Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Wrapping radiobutton labels

Post by dunbarx » Thu Dec 01, 2011 5:52 pm

I don't think so.

But why not "attach" a radio button to a transparent wrappable field, where the field is sized to the maximum you might ever need? The field will do its thing, and the radio button can just sit there.

Or you can set the field rect to accommodate the dynamic text. Takes a bit of coding, but sounds like a fun task.

If you need to move them all around, you might set a custom property that will allow you to manage them as a "group".

Craig Newman

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Wrapping radiobutton labels

Post by townsend » Thu Dec 01, 2011 6:57 pm

It is also possible to put a carriage return in the label which will manually force a wrap.

Code: Select all

     set the label of btn "my.radio" to "first line" & CR & "second line"

slow_runner
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2
Joined: Mon Oct 31, 2011 5:03 pm

Re: Wrapping radiobutton labels

Post by slow_runner » Thu Dec 01, 2011 8:17 pm

Using the label object seems to be the most practical work-around for my purposes.

Thanks a lot everyone.

Post Reply