Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Trisect Develop

macrumors newbie
Original poster
Jun 28, 2013
13
0
Denmark
I have an ImageView in my application.
When I load an image into my ImageView I change the size of it with the SetFrame command, and that seems to work okay.
I make the ImageView bigger.

On my window form I also go a NSPopupButton and when I click on it my ImageView set its frame to the starting value. Its going back the the size it has when I start my application.

I have tried many things but I can figure out why it shrinks my ImageView back.

Does any one here know why is is like that?
 

Trisect Develop

macrumors newbie
Original poster
Jun 28, 2013
13
0
Denmark
I have tried to set breakpoints on every line that includes the setFrame command, but no code gets called when I click in my NSPopUpButton.

I really hope that someone can help me.
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
If you used Interface Builder (IB) and the button is a part of that construction, then select the button in IB and check the connections panel. Is the button connected to any outlet or action. If connected to an action, place a break point on the first line of the method. If not an action, but an outlet, check all references to the outlet (instance variable) and see if you are assigning a action to it.

If the above doesn't reveal anything, then try turning off AutoLayout for that IB view. I mention this as a shot in the dark. :confused:

You may need to post some code or screen shots for people to help further.

That's all I have.
 

Trisect Develop

macrumors newbie
Original poster
Jun 28, 2013
13
0
Denmark
Sadly the Autolayout idea did not work.

This is the code for the action for the popupbutton.
Code:
   [ivTemporyImageAA setFrame:bigScreenshot];
    
    NSLog(@"height=%f", ivTemporyImageAA.frame.size.height);
    NSLog(@"widht=%f", ivTemporyImageAA.frame.size.width);

I set the frame for my ImageVIew and display the size in nslog.

This is how I set the sized in applicationDidFinishLoading.
Code:
    smallIcon = NSMakeRect(262, 257, 100, 100);
    bigScreenshot = NSMakeRect(262, 98, 155, 259);

So when I load an image into my ImageView it size is set to bigScreenshot and it look okay on the screen.

Then when I select a value in my popupbutton and called the previous code the ImageView gets small again. Ignoring the code in the action.

The nslog show the right values, but something after the nslog code resize the ImageView back to the small size.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.