27 [button setEnabled:(value==0)?NO:YES];
31 if ([button window]) {
32 [[button window] makeFirstResponder:button];
37 NSRect frame = [button frame];
38 frame.size.width = value;
39 [button setFrame:frame];
44 NSRect frame = [button frame];
45 frame.size.height = value;
46 [button setFrame:frame];
55 "Function is not appropriate for this type of widget (%s)",
75 return ([button isEnabled]==YES)?1:0;
78 if ([button window]) {
79 if ([[button window] firstResponder] == button)
return 1;
84 return [button frame].size.width;
87 return [button frame].size.height;
94 "Function is not appropriate for this type of widget (%s)",
115 NSString *stringValue = [[NSString alloc] initWithCString:value encoding:NSUTF8StringEncoding];
116 [button setTitle:stringValue];
117 [stringValue release];
125 "Function is not appropriate for this type of widget (%s)",
136 const char *defaultValue) {
144 return [[button stringValue] cStringUsingEncoding:NSUTF8StringEncoding];
150 "Function is not appropriate for this type of widget (%s)",
183 wParent=GWEN_Widget_Tree_GetParent(w);
188 button = [[[
CocoaButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 60.0, 24.0)] autorelease];
191 [button setBezelStyle:NSRoundedBezelStyle];
193 NSString *title = [[NSString alloc] initWithCString:s encoding:NSUTF8StringEncoding];
194 [button setTitle:title];
214 NSString *pathToIconFile = [[NSString alloc] initWithCString:GWEN_Buffer_GetStart(tbuf) encoding:NSUTF8StringEncoding];
215 if (pathToIconFile) {
216 NSImage *icon = [[NSImage alloc] initWithContentsOfFile:pathToIconFile];
217 CGFloat height = 15.0;
218 NSSize imageSize = [icon size];
219 imageSize.width = round(imageSize.width/(imageSize.height/height));
220 imageSize.height = 15.0;
221 [icon setSize:imageSize];
222 [pathToIconFile release];
225 [button setImage:icon];
226 [button setImagePosition:NSImageLeft];