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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -