J'ai un bouton personnalisé: My Button http://cld.ly/29ubqtexte Dessin dans une sous-classe NSButton - Positionnement
et j'ai besoin que le texte soit centré, voici mon code:
NSMutableParagraphStyle *style =
[[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[style setLineBreakMode:NSLineBreakByWordWrapping];
[style setAlignment:NSLeftTextAlignment];
att = [[NSDictionary alloc] initWithObjectsAndKeys:
style, NSParagraphStyleAttributeName,
[NSColor blackColor],
NSForegroundColorAttributeName, nil];
[style release];
// other Drawing code here
[[self title] drawInRect:[self bounds] withAttributes:att];
Comment centre-je le texte le centre de mon bouton (pas le centre des limites)?
Je suis débutant à l'objectif c/cacao, pourriez-vous poster du code? – nanochrome