objective c - Add an NSButton programmatically and then adjust an existing button position -
here code when click button:
nsrect btnframe = nsmakerect(92, 70, 60, 15); newbutton = [[nsbutton alloc] initwithframe:btnframe]; [[_window contentview] addsubview:newbutton]; btnframe = [alert1 frame]; btnframe.origin.y -= 100; [alert1 setframe:btnframe];
but result new button added, , existing button not change position. what's wrong?
check origin.y value. , second time taking alert1s frame , change origin.y check final frame assign alert1. may goes beyond visible area.
, check needs new button frame or alert1 frame
Comments
Post a Comment