Is there any way to catch events "Browser tab has been closed"?

2011-11-26 Thread Nick
Hello I am writing a network statistics application (a part of a bigger network monitoring system). On Windows I am using "spy++" application to figure out of what GUI Window Classes are tabs of each browser and what window messages are sent to these Tabs (in short, I can do analysis and build even

Re: Placing an Image next to a UI element

2011-11-26 Thread David Mirabito
Thanks for the tips Fritz, To address a couple of your points: * Yes, my 'make the image square' method is a bit of a hack. It really should be a fixed size and centred with respect to the textbox I'm drawing attention to. That was stage 2 after getting it positioned correctly :) * Thanks for

Re: NSView mouseDown truncated coordinates

2011-11-26 Thread Jens Alfke
On Nov 25, 2011, at 5:17 PM, Steven Spencer wrote: > I'm using a NSTrackingArea in a view to receive mouseMoved events. > The cursor location in the mouseMoved and mouseDragged events have > non-integer coordinates (as expected). > e.g. x:140.601562 y:128.082031 Weird; I don’t think I’ve seen n

Re: NSView mouseDown truncated coordinates

2011-11-26 Thread Ken Thomases
On Nov 25, 2011, at 7:17 PM, Steven Spencer wrote: > I'm using a NSTrackingArea in a view to receive mouseMoved events. > The cursor location in the mouseMoved and mouseDragged events have > non-integer coordinates (as expected). > e.g. x:140.601562 y:128.082031 > > However, the mouseDown and mo

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
First of all, thanks all for the input. After thinking about it a lot this morning, I probably should have approached this with a different question :) "Starting with a base64 encoded string, how do I obtain a series of float values out of it?" The string is obtained from an XML file (using NS

Design Question

2011-11-26 Thread koko
I want to display a window as a modal dialog. Should I use just a Window Controller or also define another class that handles the window contents. -koko___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Re: Design Question

2011-11-26 Thread koko
That is what I thought but just wanted too verify … thanks. -koko On Nov 26, 2011, at 12:28 PM, Dave Fernandes wrote: > You can just subclass NSWindowController and make that subclass the File's > Owner. > > Sent from my iPhone > > On 2011-11-26, at 2:14 PM, koko wrote: > >> I want to displ

Re: "byte orders" question

2011-11-26 Thread Scott Ribe
On Nov 25, 2011, at 9:38 PM, Koen van der Drift wrote: > Here is what I am doing, I read an NSString from the raw data, an xml file > using NSXMLParser. This works ok. Then I convert that to an NSData object, > and perform base64 decoding No, you're not ;-) You read a string that is presumably

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
On Nov 26, 2011, at 4:23 PM, Scott Ribe wrote: > No, you're not ;-) You read a string that is presumably already Base64 > encoded, then you stuff it into an NSData, then you Base64 encode that, then > you decode it, leaving you with the original Base64 encoding intact... > > Instead of: > >>

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
On Nov 26, 2011, at 6:17 PM, Koen van der Drift wrote: > Now I need to figure out how to go from u_int_32 to float. I think I figured it out: for (NSInteger n = 0; n < 4; n++) { u_int32_t value; [base64DecodedData getBytes:&value range:NSMakeRange(n*

Re: "byte orders" question

2011-11-26 Thread Charles Srstka
If the source code that is sending you the data in the first place is your own code, you could have that code use the CFConvertFloat32ToSwapped() before sending it, and then your client can use CFConvertFloat32SwappedToHost() to convert it back, nice and easily. At any rate, HostToBig is not wh

Preventing Doc based apps from creating docs

2011-11-26 Thread April
I've made a document based application. However whenever I switch to it through the doc a new document is created even though I'm already working on one... I cannot seem to find a way to prevent that from happening. I do not want it to create a new document unless the user requests it. What setti

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
On Nov 26, 2011, at 6:37 PM, Charles Srstka wrote: > If the source code that is sending you the data in the first place is your > own code, you could have that code use the CFConvertFloat32ToSwapped() before > sending it, and then your client can use CFConvertFloat32SwappedToHost() to > conver

Re: "byte orders" question

2011-11-26 Thread Charles Srstka
On Nov 26, 2011, at 5:44 PM, Koen van der Drift wrote: >> At any rate, HostToBig is not what you want in the client, since you’re >> swapping it *to* the host byte order, not *from* it. CFSwapInt32BigToHost() >> would be more correct in that case, even though the two functions will both >> do t

Re: "byte orders" question

2011-11-26 Thread Scott Ribe
On Nov 26, 2011, at 4:17 PM, Koen van der Drift wrote: > I'm pretty sure I messed up something. One of the reasons I posted it here :) > > After spitting through the internets, what I am using now is this: > > NSData *base64DecodedData = [NSData dataFromBase64String: > @"Q5YIjESWO5JDlpIb

Re: "byte orders" question

2011-11-26 Thread Greg Guerin
Koen van der Drift wrote: u_int32_t value; [base64DecodedData getBytes:&value range:NSMakeRange (n*4, sizeof(u_int32_t))]; u_int32_t res = CFSwapInt32HostToBig(value); float f; memcpy(&f, &res, sizeof(f));

Re: "byte orders" question

2011-11-26 Thread Kyle Sluder
On Sat, Nov 26, 2011 at 4:17 PM, Greg Guerin wrote: > Since you're just doing a memcpy(), you can simply cast the bits and avoid > the copying.  Try this: > > float f = *((float*) &res); > > Or try defining a C union: > > union foo {  float f;  u_int32_t u;  }; > union foo bar; > bar.u = CFSwapInt

Re: Preventing Doc based apps from creating docs

2011-11-26 Thread Fritz Anderson
On 26 Nov 2011, at 5:41 PM, April wrote: > I've made a document based application. However whenever I switch to it > through the doc a new document is created even though I'm already working on > one... > I cannot seem to find a way to prevent that from happening. I do not want it > to create a