views:

502

answers:

1

In cocoa using XCode and IB is it possible to have a scrolling view of WebViews from WebKit that double as radio buttons? How do I do this and how do I retrieve which view is selected?

A: 

Sorry, I think I don't really understand your problem.

First of all, you can set any content of your choice into a scrolling view, not that this is typical for UI design on Mac to do that, but you can if you insist.

Second you can of course add several radio buttons that all belong to a single radio button group so selecting one deselects the previous selected one and give them no text (you are not forced to give them a label) and just place a webview next to each of these buttons.

How do you retrieve which one is selected? Either you just iterate over all and test for each one if it is checked till you found the checked one or you implement a controller with an action method that is called whenever one is checked and update a variable each time one is checked with a reference to the checked one and at the end this variable will point to the checked one.

However, this all sounds a lot to me as if the number of radio buttons and webviews will be dynamic (not constant, but depending on some condition) and in that case you cannot do it with Interface Builder anyway (or lets say it would be rather awkward). In that case you are better of just defining the window and the scroll view in IB and programmatically add the radio buttons and webviews to it during runtime.

Maybe I misunderstood your problem completely though, in that case please upto your question to actually really explain your problem.

Mecki