nsprogressindicator

Subclass NSProgressIndicator

让人想犯罪 __ 提交于 2020-01-13 11:05:29
问题 i like to subclass a NSProgressIndicator. I've used this code and i set the Subclass in the Interface Builder: - (void)drawRect:(NSRect)dirtyRect { NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); CGFloat radius = rect.size.height / 2; NSBezierPath *bz = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius]; [bz setLineWidth:2.0]; [[NSColor blackColor] set]; [bz stroke]; rect = NSInsetRect(rect, 2.0, 2.0); radius = rect.size.height / 2; bz = [NSBezierPath

Subclass NSProgressIndicator

廉价感情. 提交于 2020-01-13 11:04:57
问题 i like to subclass a NSProgressIndicator. I've used this code and i set the Subclass in the Interface Builder: - (void)drawRect:(NSRect)dirtyRect { NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); CGFloat radius = rect.size.height / 2; NSBezierPath *bz = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius]; [bz setLineWidth:2.0]; [[NSColor blackColor] set]; [bz stroke]; rect = NSInsetRect(rect, 2.0, 2.0); radius = rect.size.height / 2; bz = [NSBezierPath

Subclass NSProgressIndicator

℡╲_俬逩灬. 提交于 2020-01-13 11:04:57
问题 i like to subclass a NSProgressIndicator. I've used this code and i set the Subclass in the Interface Builder: - (void)drawRect:(NSRect)dirtyRect { NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); CGFloat radius = rect.size.height / 2; NSBezierPath *bz = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius]; [bz setLineWidth:2.0]; [[NSColor blackColor] set]; [bz stroke]; rect = NSInsetRect(rect, 2.0, 2.0); radius = rect.size.height / 2; bz = [NSBezierPath

NSProgressIndicator in NSMenuItem not updating on second display

混江龙づ霸主 提交于 2019-12-31 02:29:09
问题 I've got a NSMenu attached to a NSStatusItem (a menu bar application). While downloading a file I want to display a NSProgressIndicator in an item of this menu. I've created a NSViewController subclass for this progress indicator with the following properties: @property NSUInteger current; // Bound to NSProgressIndicator value @property NSString *status; // Bound to a NSTextField value @property NSUInteger total; // Bound to NSProgressIndicator max value When needed I start the download of

Cocoa: Subclassing NSProgressIndicator on Lion

假如想象 提交于 2019-12-24 04:36:06
问题 I have a problem that is driving me crazy. I want to subclass NSProgressIndicator in its "Bar" form to change the color of the progress bar based on a couple of logic states. For that i basically override the -drawRect: as usual. However a very strange thing happens on Lion. Even if my -drawRect just calls the superclass' implementation via [super drawRect:] and does nothing else at all the whole progress bar will be displayed using the style that was used before Lion. If you remember, with

NSProgressIndicator progress with For loops?

强颜欢笑 提交于 2019-12-17 19:09:57
问题 My application does a lot of work with a bunch of For loops. It calculates a massive amount of strings, and it can take over a whole minute to finish. So I placed a NSProgressIndicator in my app. Within the loops, I used the "incrementBy" function of the NSProgressIndicator. However, I don't see the actual bar filling up. I suspect that's because of the loops taking all power possible, and thus the NSProgressIndicator is not updated (graphically). How would I make it progress then? 回答1: Are

Using NSProgressIndicator inside an NSMenuItem

自作多情 提交于 2019-12-09 11:25:46
问题 I'm trying to use a NSProgressIndicator (indeterminate) inside of a statusbar-menu. I'm using an NSView-object as view for the menuitem, and then subviews the progress indicator to display it. But whenever i try to call the startAnimation: for the progress, nothing happens. When i try do the very same thing on a normal NSWindow it works perfectly, just not when inside a menuitem. I'm new to both cocoa and objective-c so I might've overlooked something "obvious" but I've searched quite a bit

What causes a white border to be applied to an NSProgressIndicator displayed in the system menu?

北战南征 提交于 2019-12-07 05:04:09
问题 This is what happens when I create an NSProgressIndicator and use NSStatusItem's -setView: method to display it in the menubar area while I'm performing an action: Example of messed up NSProgressIndicator http://cl.ly/l9R/content What causes this border to be displayed, and how can I remove it? The intended result is that the control be transparent. Here's the code I'm using: NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] init]; [progressIndicator setBezeled: NO];

NSProgressIndicator in NSStatusItem

孤人 提交于 2019-12-06 15:44:41
问题 I have NSStatusItem with a custom NSView which shows images. Whether the menu is opened or not it show different images just like that: isMenuVisible = NO; - (void)awakeFromNib { statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; [statusItem retain]; dragStatusView = [[DragStatusView alloc] init]; [dragStatusView retain]; dragStatusView.statusItem = statusItem; [dragStatusView setMenu:statusMenu]; [dragStatusView setToolTip:NSLocalizedString(@

What causes a white border to be applied to an NSProgressIndicator displayed in the system menu?

雨燕双飞 提交于 2019-12-05 11:16:32
This is what happens when I create an NSProgressIndicator and use NSStatusItem 's -setView: method to display it in the menubar area while I'm performing an action: Example of messed up NSProgressIndicator http://cl.ly/l9R/content What causes this border to be displayed, and how can I remove it? The intended result is that the control be transparent. Here's the code I'm using: NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] init]; [progressIndicator setBezeled: NO]; [progressIndicator setStyle: NSProgressIndicatorSpinningStyle]; [progressIndicator setControlSize: