• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

Development QuestionL Icons in Dialogs

equant

6502
I sent this to the LowEndMac vintage list, but I know there's a few skilled developers here as well, so I'm re-posting...

I have a dialog box with a clickable icon in it, and I'd like to be

able to swap the icon with another icon at a certain point in the

code. I'm having a hard time figuring out what I bet is a simple

task.

I've tried three methods, and none have worked, and was hoping someone

could tell me what I'm doing wrong, or how to accomplish icon swapping

in a dialog box. It's modeless if that matters.

I tried HideControl(ControlHandle(itemHandle)), but that didn't hide

the first icon.

I tried SedDItem(dialogHandle, ICON, iconItem, Handle(GetIcon(130)),

itemRect) and that didn't work.

I tried drawing over the original icon using PlotIcon(itemRect, GetIcon(130)).

Any ideas on which method I should be using if any of the three?

Thanks for any help.

 
HideDItem and ShowDItem are the Toolbox calls you need. Set up the two icons, and just toggle visibility.

Ken

 
Aha! I struggled and came up with a different method, but your solution seems like the more elegant method. I was hoping you'd answer! :)

Thanks a ton.

Nathan

 
Back
Top