IB Icons, updating controls, etc

macavenger

Registered
Several questions here. First, an easy one (I hope ;)) When answering, please keep in mind that I have very little programming experience:

1) How do you get icons/images into Interface builder? I have some pictures I designed in Photoshop that I want to add to my buttons, but I can't figure out how to get them into Interface builder. Makes me feel rather stupid. :(

Now for a few that may be a bit more complicated:

2) Where can I find info on how to make sheets in Carbon? Is it even possible? I have browsed over the developer documentation, but haven't found anything. I could easily have missed it though.

3) There is a spot in a program I am working on where it runs through a loop assigning random values to the spaces in an array (with a fairly complicated error checking function for each assignment). This process takes long enough that I would like to show a progress bar. However, I can't seem to get the progress bar to update during this process. Even if I set the progress bar to be indeterminate, it does not update. How can I fix this?

4) How can I set the keyboard focus to a certain text field when a window is opened? I tried using the SetKeyboardFocus(prefs,xSet,-1); function, but while it doesn't give me any errors, it doesn't work either.

5) similarly I am trying to set the display of a pop-up menu to the entry corresponding to the variable it sets using the function SetControlValue(difSet,(int)dif+1); where dif corresponds to the entry I want the menu set to, but again it doesn't seem to have any effect.

Thanks for any help that you can provide!
 
hi,

to answer a few of your questions:

3. before goint into the loop, use [yourProgressIndicator setUsesThreadedAnimation:YES];

4. what you're looking for is "initialFirstResponder" in ib. just connect your textfield to the window's outlet.

5. use selectItemAtIndex:

hth
 
Thanks for the quick response! Unfortunately, the suggestions would appear to only work in cocoa, not carbon. For instance, I found the make initial first responder option, but it was grayed out. when I made a test cocoa project, the option activated. Thanks anyway! the answers will at least give me some idea of what to look for (threading, for example).
 
Ok, I figured out how to do sheets, got the progress bar to update correctly, and figured out how to fix the stupid mistake I was making so that keyboard focus and setting the pop-up menu now works.

However, I still haven't been able to figure out how to import graphics/icons into IB. I would think this would be fairly basic and simple (How else are you supposed to put icons on buttons or graphics in the image wells?) but I can seem to find any info on how to do it. Can someone give me some hints here?

Also, although I somewhat doubt it, is there a way to get the sheet style window transition not attached to the title bar of some window? for instance, if I wanted some window to "sheet" out of the side of another (similar to the genie effect from the dock) or be sucked away into the center of the screen.

Thanks for any help you can provide!
 
Back
Top