68kMLA Classic Interface

This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.

Click here to select a new forum.
Development QuestionL Icons in Dialogs
Posted by: equant on 2007-09-03 06:35:48
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.

Posted by: Kallikak on 2007-09-04 14:21:50
HideDItem and ShowDItem are the Toolbox calls you need. Set up the two icons, and just toggle visibility.

Ken

Posted by: equant on 2007-09-04 17:44:27
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

1