Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / June 2005



Tip: Looking for answers? Try searching our database.

Disabling one button of a radio button group...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hp - 25 Jun 2005 22:39 GMT
So I have a NIB defining a radio button group, but I would like to
control whether some buttons will be allowed or not, based on the state
of my program.

But I cannot get this figured out? Can anyone offer any hints?

The Carbon Programming book talks about a "Non-Auto-Toggling Variant" -
which would force me to manage all the button pushes, but I cant even
figure out to set that characteristic in Interface Builder.

Anyone?

TIA,

-harry
larry@skytag.com - 26 Jun 2005 01:50 GMT
> So I have a NIB defining a radio button group, but I would like to
> control whether some buttons will be allowed or not, based on the state
> of my program.
>
> But I cannot get this figured out?

Is that supposed to be a question? ;-)

> Can anyone offer any hints?

Iterate over the subcontrols of the radio button group to get the radio
button controls. You can then enable and disable them individually.

> The Carbon Programming book talks about a "Non-Auto-Toggling Variant" -
> which would force me to manage all the button pushes, but I cant even
> figure out to set that characteristic in Interface Builder.

I've never heard of that. Old book, BTW.

You might find Apple's carbon-dev list more useful than this one, which
tends to be more for CW-related issues.

Larry
hp - 26 Jun 2005 17:11 GMT
> > So I have a NIB defining a radio button group, but I would like to
> > control whether some buttons will be allowed or not, based on the state
[quoted text clipped - 3 lines]
>
> Is that supposed to be a question? ;-)

uhhhhh, yup. I guess not only could I figure what to do, I couldnt even
figure out how to compose the question :-)

> > Can anyone offer any hints?
>
> Iterate over the subcontrols of the radio button group to get the radio
> button controls. You can then enable and disable them individually.

Cool! This is the hint I was looking for! Did as you said and I get the
buttons disabled like I wanted, although the text button label does
*not* get greyed out as I would have expected. This is the basic code
fragment:
       ...
    ControlRef button = NULL ;
    err = GetIndexedSubControl(radioButtons, 1, &button) ;
    if (button)
        DisableControl(button) ;
       ...
Is there something else I need to do to get the "grey-out" appearance?
[OS10.3.8] Tiger seems to be better "behaved" and gives the greyd out
appearance

> You might find Apple's carbon-dev list more useful than this one, which
> tends to be more for CW-related issues.

You're right ... I just wish that when I would search the Developer
site, I could get the lists included within the search. Moreover, I've
never figured out how to search the list archives at all - seems like
one can only browse, which I simply do not have the patience for :-)

- harry
larry@skytag.com - 27 Jun 2005 01:16 GMT
> Cool! This is the hint I was looking for! Did as you said and I get the
> buttons disabled like I wanted, although the text button label does
[quoted text clipped - 8 lines]
> Is there something else I need to do to get the "grey-out" appearance?
> [OS10.3.8] Tiger

10.3.8 is Panther, not Tiger.

> seems to be better "behaved" and gives the greyd out appearance

I don't know any way to do this. I don't know if the lack of dimmed
text is a new interface decision or a bug. Post a question about it to
the carbon-dev list and ask. :-)

>> You might find Apple's carbon-dev list more useful than this one, which
>> tends to be more for CW-related issues.
>
> You're right ... I just wish that when I would search the Developer
> site, I could get the lists included within the search. Moreover, I've
> never figured out how to search the list archives at all

Clicking the Search link works for me:

http://lists.apple.com

> - seems like one can only browse, which I simply do not have the patience for
> :-)

I was suggesting that you subscribe to the list and post your questions
there, not search the archives. I almost never search the archives.

Larry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.