Re: Problem with distributed objects in GUI cocoa apps

2014-04-23 Thread Charles Srstka
On Mar 30, 2014, at 3:28 AM, Costas Chatzinikolas wrote: > Hi everyone, > > i recently made a set of 2 command lines apps in Cocoa, that use > Distributed objects to communicate. In fact, the first app is the client > that sends a message, the second app is the server the vends the object. > Ev

Problem with distributed objects in GUI cocoa apps

2014-04-23 Thread Costas Chatzinikolas
Hi everyone, i recently made a set of 2 command lines apps in Cocoa, that use Distributed objects to communicate. In fact, the first app is the client that sends a message, the second app is the server the vends the object. Everything works ok!!! Then i tried to make these 2 apps GUI based. I use

Re: Socket Programming on iOS

2014-04-23 Thread Piotr Pszczółkowski
Hi, maybe will be better to use NSFileHandle? _fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:]; NSData *buffer = [_fileHandle readDataOfLength:]; regards Piotr On 16 Apr 2014, at 20:42 , Dilum Nawanjana wrote: > Listening to a Port from an iOS device is not very easy task in cocoa

IOKit / OSX: How can I distinguish between "real hard disk" and mounted images?

2014-04-23 Thread Fritz-Ulrich Siewert
Hello, I'm writing an application to monitor disk i/o in OSX. Most work is done, but now I'm stuck: I cannot find a way to distinguish between a real, physical volume (i.e. the SSD and the hard disk in my fusion drive) and some mounted, virtual volumes (i.e. an opened .dmg-file). Can anybody h

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Peters, Brandon
I got it! The button code goes inside the validate() method, which one has to override for custom toolbar items with custom views/buttons. Everything works. Thanks for assistance everyone! On Apr 23, 2014, at 10:50 PM, Peters, Brandon mailto:bap...@my.fsu.edu>> wrote: “or if you were trying to

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Peters, Brandon
“or if you were trying to plug in the button during init, which is too early).” That may be it, as I was setting the toolbar item’s view to the button in init(). If not there then where? On Apr 23, 2014, at 9:12 PM, Andy Lee mailto:ag...@mac.com>> wrote: Oh well, it was worth a try, and at le

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread edward taffel
if a control changes rendering on entry, as well as the cursor, mouseEntered is serviceable; if changing the cursor is the goal, cursorUpdate is clearer—better practice. unfortunately, if views overlap mouseMoved is still sent to the parent, which muddles the state directed adjustment anyway. O

Re: Layout-triggered animation

2014-04-23 Thread Julian
Based on your thought about setFrame: called multiple times, I do have some interesting news, though not a full resolution: setFrameSize was getting called repeatedly with the final size during the animation. I put logging in setFrame{Size,Origin}: in the view whose constraints are altered. Here's

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread Ken Thomases
On Apr 23, 2014, at 7:57 PM, Quincey Morris wrote: > On Apr 23, 2014, at 16:58 , Ken Thomases wrote: > >> If the cursor is appropriate for a given view, that's a *strong* indication >> to the user that a click will act on that view. So, the view controlling >> the cursor at a given point shou

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Peters, Brandon
Andy, I discovered something that may lead to the real culprit. Using the debugger, I checked the size of the image chosen by imageNamed method, it was choosing the 128x128 icon image, but my toolbar item buttons were 48x48. I changed the toolbar item sizes to 32x32, same thing. On Apr 23, 201

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Andy Lee
Oh well, it was worth a try, and at least you've confirmed some basic steps *are* working. From your previous message it sounds like you also checked self.toolbarItem and it too was not nil (as it could have been if, for example, you'd forgotten to connect an outlet in IB -- or if you were tryi

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread Quincey Morris
On Apr 23, 2014, at 16:58 , Ken Thomases wrote: > If the cursor is appropriate for a given view, that's a *strong* indication > to the user that a click will act on that view. So, the view controlling the > cursor at a given point should also be the view that receives the click at > that poin

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Peters, Brandon
Andy, I inserted code to check for nil images and image position, here is what I got: // set the original and alternate images...names are “opposite" NSImage *image = [NSImage imageNamed:@"StopButtonAlternateIcon”]; if(image) { NSLog(@"Setting 1st image for stop button"); [_button setImage

Re: showing load progress for autosaved documents

2014-04-23 Thread Graham Cox
On 24 Apr 2014, at 10:06 am, edward taffel wrote: > at present, i’m finding it difficult to find a point, prior to NSDocument > initializing autosaved documents, to show a progress window. everything above > readFromURL is off the main thread & there is nothing in the application > delegate p

Re: showing load progress for autosaved documents

2014-04-23 Thread edward taffel
thank you for this graham! at present, i’m finding it difficult to find a point, prior to NSDocument initializing autosaved documents, to show a progress window. everything above readFromURL is off the main thread & there is nothing in the application delegate protocol that precedes—so far as i

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Peters, Brandon
Jerry, The example I was following comes from Stack Overflow and going something like this within the custom toolbar item: NSButton *button = [[NSButton alloc]init]; [button setImage:[NSImage imageNamed:@"StarEmpty"]]; [button setAlternateImage:[NSImage imageNamed:@"StarFull"]]; [button setImage

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Andy Lee
On Apr 23, 2014, at 6:36 PM, Jerry Krinock wrote: > > On 2014 Apr 23, at 15:13, Peters, Brandon wrote: > >> call [toolbaritem setView:view] and pass in the NSButton. > > Try some bonehead debugging with NSLog(). Verify that toolbaritem is your > target item at that point, in particular, th

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread Ken Thomases
On Apr 23, 2014, at 9:39 AM, Sean McBride wrote: > Is hitTest: used for cursors as well as clicks? I put a breakpoint to test > the theory, and indeed I see in a backtrace [NSWindow(NSCarbonExtensions) > _setCursorForMouseLocation:] -hitTest: should be used for anything which needs to determin

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Eric Shepherd
There's a lot to be said for spreading lots of NSLog through your code. It's amazing how many bugs you can nail down using this old-school form of debugging. Eric Shepherd > On Apr 23, 2014, at 6:36 PM, Jerry Krinock wrote: > > Try some bonehead debugging with NSLog(). Verify that toolbaritem

Re: showing load progress for autosaved documents

2014-04-23 Thread Graham Cox
On 23 Apr 2014, at 10:31 pm, edward m taffel wrote: > i’m attempting to show load progress for complex documents. my document class > defines readFromURL & this seems the natural place to do this; however, for > autosaved documents the progress window does not show until the document > window

Re: NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Jerry Krinock
On 2014 Apr 23, at 15:13, Peters, Brandon wrote: > call [toolbaritem setView:view] and pass in the NSButton. Try some bonehead debugging with NSLog(). Verify that toolbaritem is your target item at that point, in particular, that it is not nil. If that seems to be OK, try some more advanced

NSToolbarItem view set to NSButton, but not images showing...

2014-04-23 Thread Peters, Brandon
I have a custom NSToolbarItem with a NSButton underneath. I set the main and alternate images for the button using [NSImage imageNamed:imageName], then call [toolbaritem setView:view] and pass in the NSButton. But when I run the application, the NSToolbarItem is does not show the image and the l

NSToolbarItem view set to NSButton view, but not showing...

2014-04-23 Thread Peters, Brandon
Devs, I have a custom NSToolbarItem with a NSButton underneath. I set the main and alternate images for the button using [NSImage imageNamed:imageName], then call [toolbaritem setView:view] and pass in the NSButton. But when I run the application, the NSToolbarItem is does not show the image an

Re: Memory Leaks and ARC

2014-04-23 Thread Dave
Hi, Yes, I realize that. But in this case, the root object obeys the new/alloc rule. it’s complicated because this App is a meld of 3 apps all developed at varying times. In this case, there was an old-school network manager, that used manual MM. This was kept like that (by switching off ARC o

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread edward taffel
erratum: in your context, initializing tracking w/ NSTrackingCursorUpdate & defining cursorUpdate is probably more appropriate. &, on further reflection, this technique does not inhibit the sending of mouseMoved in the parent view. an interesting problem—should you discover a solution i hope you

Re: Memory Leaks and ARC

2014-04-23 Thread Quincey Morris
On Apr 23, 2014, at 03:01 , Dave wrote: > If I changed the names of commandDownloadImageWithFileURLString to be > newCommandDownloadImageWithFileURLString, this would cause it to release > myImage on each iteration rather than using Autorelease? It would remove one — and perhaps the only — re

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread edward taffel
if i understand you correctly: you want to adjust the cursor in your view based on state, but embedded controls should set the cursor independently. you might try subclassing the controls in question, register a tracking area (for controls that do not already have one, only) & define mouseEntere

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread Sean McBride
On Wed, 23 Apr 2014 08:58:49 -0500, Ken Thomases said: >> I have a custom NSView that needs to change its cursor depending on >mouse position and internal state. The sibling views (which all draw on >top of my view, thus appearing sorta like subviews) are simple standard >Cocoa controls (ex: push

Re: Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread Ken Thomases
On Apr 23, 2014, at 8:48 AM, Sean McBride wrote: > I'm trying to determine how to manage the mouse cursor in the case of > overlapping sibling views. > > I have a custom NSView that needs to change its cursor depending on mouse > position and internal state. The sibling views (which all draw o

Mouse cursors and overlapping sibling NSViews

2014-04-23 Thread Sean McBride
Hi all, I'm trying to determine how to manage the mouse cursor in the case of overlapping sibling views. I have a custom NSView that needs to change its cursor depending on mouse position and internal state. The sibling views (which all draw on top of my view, thus appearing sorta like subvie

showing load progress for autosaved documents

2014-04-23 Thread edward m taffel
i’m attempting to show load progress for complex documents. my document class defines readFromURL & this seems the natural place to do this; however, for autosaved documents the progress window does not show until the document window shows (in the same instant, after the load is complete). i exp

Re: Memory Leaks and ARC

2014-04-23 Thread Dave
On 23 Apr 2014, at 00:18, Quincey Morris wrote: > On Apr 22, 2014, at 15:18 , Dave wrote: > >> I assumed that ARC would release myImage on each interation of the loop, >> however, this seems not to be the case > > The ‘myImage’ variable gives up *ownership* of the previous image object when

Re: Layout-triggered animation

2014-04-23 Thread Jakob Egger
> New questions: > 1. Is there any point in using addConstraint/removeConstraint in the > NSAnimationContext grouping? Seems like it can go before beginGrouping. The important thing is that the frames are set inside the grouping. Updating constraints should not cause any frames to be set, only