Re: Custom field editor on NSSecureTextField?

2008-06-16 Thread John Stiles
go back in source control and dredge up my old code and try to repurpose it. On Mon, Jun 16, 2008 at 6:29 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > > On Jun 16, 2008, at 7:16 PM, John Stiles wrote: > > I've got some code which subclasses NSTextView in order to provid

Custom field editor on NSSecureTextField?

2008-06-16 Thread John Stiles
I've got some code which subclasses NSTextView in order to provide a custom field editor for NSTextFields. It doesn't do anything too extraordinary, just allows for filtering out some characters, watching for certain events (like deleting characters or changing the selection), etc. It all works qui

Re: check if app opens with a document on startup

2008-05-23 Thread John Stiles
Note that these delegate methods will not work properly until your Info.plist has been updated to reflect the file types which your app supports. I've recently opened a radar on this because it doesn't appear to be well-documented and I spent a while trying to figure out why my delegates were n

Re: Fullscreen on secondary displays

2008-05-13 Thread John Stiles
None of this really refutes what Ricky posted. You are just lucky that it works in the one-display case. It really isn't designed to work, and on some configurations, it just won't. Is there anything preventing you from following Ricky's advice? Dennis Munsie wrote: In this case, what I am tr

Re: Flash'In'App – Free Cocoa Framework

2008-05-12 Thread John Stiles
There are a couple of gotchas... trying to disable the right-click menu is one issue (maybe you can subclass the view for this, I haven't tried), and having the Flash app send messages back to the main app is another problem. Julia Rixon wrote: Ferhat Ayaz wrote: Why don't load flash via We

Re: How to send email without using email client

2008-05-09 Thread John Stiles
We have an internal app which sends emails in a similar fashion (all for automated stuff, not for users to see/touch) and we shell out to a Perl script which uses MIME::Lite to handle this. It works perfectly for us. I'm not sure how applicable it will be for you, but it's handled everything w

Re: Crashes with NSOpenPanel and garbage collection

2008-05-09 Thread John Stiles
Though I guess he could make a LSUIElement application to handle this. Kinda clunky, but it would work. Michael Ash wrote: On Fri, May 9, 2008 at 8:17 AM, Daniel Parnell <[EMAIL PROTECTED]> wrote: Thanks for that. I was wondering if that might be the case, although I've not been able to fi

Re: F-Script Anywhere can't add to procmod group

2008-05-08 Thread John Stiles
I think they are focusing on polishing up 2.0. I submitted an enhancement for FSA a while back and that seemed to be where all the focus was. Dave Dribin wrote: On May 8, 2008, at 7:53 PM, David Carlisle wrote: My file directory name says "FScriptBin-20070421" My startup warning message say

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread John Stiles
t with the same number of bytes, it's somewhere in the 0.1 second range. So very confused... Ben On May 7, 2008, at 8:21 PM, John Stiles wrote: Have you tried running Shark? That might give you some insight as to what's going on. Ben Einstein wrote: Hi All, I have an enterprise DB

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread John Stiles
Have you tried running Shark? That might give you some insight as to what's going on. Ben Einstein wrote: Hi All, I have an enterprise DB application that once used DO to move some files around (images and zip files, mostly). After some serious testing and lots of reading, I decided to move

Re: WebView does not expose bindings in IB 3

2008-05-07 Thread John Stiles
This was actually in a WWDC WebKit demo when WebKit was first announced—they set up a web browser on stage with no code, IIRC. Derek Chesterfield wrote: I don't think it's a bug. I think Apple just decided they didn't want to expose WebView with all the useful bindings. I used to love that I

Re: User Preferences Causing Application to Crash

2008-05-06 Thread John Stiles
I'm going to guess that your preferences window is set to release-on-close. This can be set in Interface Builder; check the Inspector for this window and make sure that checkbox is not set. Patrick Altman wrote: I am very new to cocoa development but a rather seasoned software engineer in gen

Re: NSPopUpButton doesn't show list when used inside a menu item

2008-05-01 Thread John Stiles
Recursive menu tracking? I can't say I'm surprised that this doesn't work :) Honestly I have to say that this sounds like a really weird UI. I would consider a more normal approach (submenus?) Angel Todorov wrote: Hi, I have a regular menu (File menu) for my app. One of the menu items (New ..

Re: Programmatic "Size To Fit"

2008-05-01 Thread John Stiles
An NSView doesn't have an associated cell, so "size to fit" doesn't really have a meaningful answer. Size-to-fit works by asking the cell what size it should be. For a box, you could just enumerate the subviews and get the union of all the subview frames. Randall Meadows wrote: On May 1, 2

Re: Programmatic "Size To Fit"

2008-05-01 Thread John Stiles
There is in fact an API, -sizeToFit. Randall Meadows wrote: I am creating a bunch of controls (at least NSTextfield, NSPopupButton, NSSlider, and perhaps others) programmatically (that will eventually be shown in an NSTableView), and would like to apply the "Size To Fit" feature that IB provi

Re: Trouble with NSPopUpButton and hierarchical menus?

2008-05-01 Thread John Stiles
Yup, that was the problem. Thanks for figuring this out, Graham. rdar://5903558[IB3] Items in pull-down-style NSPopUpButtons enable "hidden" for no reason John Stiles wrote: Oh, is that the problem? I didn't see a Hidden checkbox. I'll look again. Guess it's Rada

Re: Trouble with NSPopUpButton and hierarchical menus?

2008-05-01 Thread John Stiles
If you don't notice this then the items obviously don't show up at runtime. You can select all and set them to visible, then go back and set the first item back to hidden as a workaround. G. On 1 May 2008, at 10:37 am, Peter Ammon wrote: On Apr 30, 2008, at 3:58 PM, John Stiles wrote

Trouble with NSPopUpButton and hierarchical menus?

2008-04-30 Thread John Stiles
I've been trying to create an NSPopUpButton in IB3, in pull-down mode, that has a submenu. It doesn't seem to work properly though. After I drag in the "Menu >" item into the pop-up button's menu, the pop-up seems to be irrevocably broken-it randomly neglects to display some items, or fails to show

Re: Modal window and 'hanging' menu [SOLVED]

2008-04-30 Thread John Stiles
Manfred Schwind wrote: You probably shouldn't be putting up a modal dialog from within the menu-tracking runloop mode. You can use -performSelector:withObject:afterDelay:inModes: to defer the call that opens the modal dialog; use a delay of 0.0 but a modes array that includes only the default

Re: Modal window and 'hanging' menu

2008-04-29 Thread John Stiles
You could probably use NSMenu's -cancelTracking to work around this. (I guess you could send it to every menu in the menubar, or see if just sending it to mainMenu is good enough.) Or, you can use -menuWillOpen: and -menuDidClose: to watch for when the user accesses the menus, and postpone you

Re: How is "Apple + Ctrl + D" implemented?

2008-04-29 Thread John Stiles
Man, what a bummer. I wish you had been around when I asked the question before :) Keith Blount wrote: Really? Does this actually work? I needed to find word boundaries to implement a Find panel which supports searching for "Whole Words" and I ended up using UCFindTextBreak based on advice fr

Re: How is "Apple + Ctrl + D" implemented?

2008-04-29 Thread John Stiles
Really? Does this actually work? I needed to find word boundaries to implement a Find panel which supports searching for "Whole Words" and I ended up using UCFindTextBreak based on advice from this list. It was a pain to implement (since it's not designed to mesh with Cocoa at all). Graham C

Re: autosizing problem

2008-04-29 Thread John Stiles
Kyle Sluder wrote: On Tue, Apr 29, 2008 at 3:59 AM, Yann Disser <[EMAIL PROTECTED]> wrote: Giving a minimum size to my drawer worked. However I think this absolutely is a bug. I would expect my views to vanish if the window is made too small and to reappear normally once the window is again

Re: Core Animation Deadlock

2008-04-24 Thread John Stiles
You could also show any other thread stuck trying to lock a mutex? I assume there's another thread holding this lock or stuck trying to lock something else. Colin Cornaby wrote: Hi, I'm currently trying to track down a deadlock. After adding a series of layers, CoreAnimation deadlocks here

Re: NSTextView text coloring problem

2008-04-24 Thread John Stiles
Is the $ usage an extension? That doesn't sound like regular C to me. Alastair Houghton wrote: On 24 Apr 2008, at 16:10, Dave Jewell wrote: On 24 Apr 2008, at 8:42 am, Graham Cox wrote: Aside: your ivars shouldn't start with an underscore - Apple reserves such names for its own classes. In

Re: IB3 can't find my class

2008-04-23 Thread John Stiles
Nick Zitzmann wrote: On Apr 23, 2008, at 4:04 PM, John Stiles wrote: I have a class declared in code which, until recently, didn't have any IBActions in it. Recently I added some, and went to IB3, but it didn't notice that I had added the actions. I had to manually add them via th

IB3 can't find my class

2008-04-23 Thread John Stiles
I have a class declared in code which, until recently, didn't have any IBActions in it. Recently I added some, and went to IB3, but it didn't notice that I had added the actions. I had to manually add them via the + button. Is there any way I can give IB3 a hint so it can find the class' @interf

Re: Resource Fork - is this a good use/the right thing to do?

2008-04-23 Thread John Stiles
Thirded. Matt Gough wrote: I'd second that. The OS (well, Finder) also adds things to the resource fork of files (custom icons, info about which app to open a file with when you changed it from the default etc). Just as long as you respect the existing contents this is exactly where you should

Re: NSTextfields and keyboard equivalents - am I missing something?

2008-04-22 Thread John Stiles
Mattias Arrelid wrote: On Mon, Apr 21, 2008 at 7:05 PM, John Stiles <[EMAIL PROTECTED]> wrote: In "The Path Of Key Events" in the URL you posted, the #1 item in the list is "key equivalents." AppKit checks keyDown events to see if command is held; if it is, it

Re: Programmatically placing an item in the dock

2008-04-22 Thread John Stiles
This "solution" will also kill all the user's Dashboard widgets, so it's not to be taken lightly. Mike Abdullah wrote: Quite simply there is no public API to control the dock. The closest (and hacky) solution is to modify the dock's plist and restart it. Mike. On 22 Apr 2008, at 07:02, Oliv

Re: SynchroScrollView

2008-04-21 Thread John Stiles
NM that last part, I found the plugin. For the archives, it's at http://brockerhoff.net/src/RBSplitView.ibplugin.zip Sorry, all, for the multiple replies-to-self here :) John Stiles wrote: Oh, there was a fourth problem actually. This doesn't work in all cases: NSRect cha

Re: SynchroScrollView

2008-04-21 Thread John Stiles
lugin for RBSplitView? I've seen web posts indicating that it exists but I can't find it. John Stiles wrote: I found thee things which, in conjunction, solve the problem: 1 - Rewrite synchronizedViewContentBoundsDidChange as follows. -scrollToPoint seems broken. (I am clamping the scr

Re: SynchroScrollView

2008-04-21 Thread John Stiles
cocoa view that is shrunk to a degenerate rectangle loses its position & size) John Stiles wrote: Has anyone gotten this example to work in Leopard? http://developer.apple.com/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/SynchroScroll.html I just tried it and I

SynchroScrollView

2008-04-21 Thread John Stiles
Has anyone gotten this example to work in Leopard? http://developer.apple.com/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/SynchroScroll.html I just tried it and I'm having terrible luck. The view is just blanking itself out immediately. I can get it to sort-of work if I replac

Re: NSTableView -editColumn:row:withEvent:select: question

2008-04-21 Thread John Stiles
Corbin Dunn wrote: On Apr 18, 2008, at 3:37 PM, John Stiles wrote: Ben Lachman wrote: > Well, you should be able to just override the drawing code, since > thats really your problem. Going directly against the docs, while it > may work fine now, is playing with fire in my opin

Re: NSTextfields and keyboard equivalents - am I missing something?

2008-04-21 Thread John Stiles
In "The Path Of Key Events" in the URL you posted, the #1 item in the list is "key equivalents." AppKit checks keyDown events to see if command is held; if it is, it tries to match it against the menus before passing it through the responder chain. I think your best bet is to dim your menu item

Re: [SOLVED] Simulating menu bar blink in Cocoa

2008-04-19 Thread John Stiles
Could you do something else to cause VoiceOver to explicitly say the string you want it to? Martin Wierschin wrote: The "fake temporary item" solution actually works pretty well. It's the last thing I'd call elegant, but here's how you can blink a menu title in Cocoa. Unfortunately that solu

Re: Simulating menu bar blink in Cocoa

2008-04-19 Thread John Stiles
No, that's not the problem. The problem is that some combinations simply don't work. For instance, just as a random example, AppKit does not match "option+," or "shift+`". (Haven't tried adding command but offhand I don't have any reason to think that this would fix it.) My app supports arbitr

Re: NSTableView -editColumn:row:withEvent:select: question

2008-04-18 Thread John Stiles
Ben Lachman wrote: > Well, you should be able to just override the drawing code, since > thats really your problem. Going directly against the docs, while it > may work fine now, is playing with fire in my opinion. Yeah… that's why I posted :) I was hoping to get a "oh yeah, that only applies

Re: NSTableView -editColumn:row:withEvent:select: question

2008-04-18 Thread John Stiles
select the full row/column by clicking on the header. Fortunately I don't need to worry about that in this case. Not a problem. But this should get you started, hopefully. ->Ben -- Ben Lachman Acacia Tree Software http://acaciatreesoftware.com [EMAIL PROTECTED] 740.590.0009 On A

[SOLVED] Simulating menu bar blink in Cocoa

2008-04-18 Thread John Stiles
erformKeyEquivalent:f35Event]; [myMenu removeItemAtIndex:position]; } John Stiles wrote: Reading the list archives a little more, it looks like there may be two ways to do this: - _NSHighlightCarbonMenu and _NSUnhighlightCarbonMenu are SPIs which take an NSMenu* and do exactly what you'd expect - Yo

Re: Simulating menu bar blink in Cocoa

2008-04-18 Thread John Stiles
e key equivalent and no target or action. Then use NSMenu -performKeyEquivalent: to simulate its selection. Wow, great choices here :| I'm going to try #2 first since it's not SPI. I'll inform the list of the results. John Stiles wrote: John Stiles wrote: Randall Meadows wrote:

NSTableView -editColumn:row:withEvent:select: question

2008-04-18 Thread John Stiles
The docs for -editColumn:row:withEvent:select: ominously claim: The row at rowIndex must be selected prior to calling editColumn:row:withEvent:select:, or an exception will be raised. I'm implementing a subclass of NSTableView which behaves a little more like an Excel spreadsheet—it mainta

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
7;t be more than one character if dead key state was zero. // Accented characters take a single byte in legacy encodings. UInt8 singleChar = chars & 0xFF; result = [[[NSString alloc] initWithBytes:&singleChar length:1

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
t 11:38 AM, John Stiles wrote: Quick question: in Leopard, are there any keyboards left which don't have a uchr? I found some sample code which includes a fallback case for if no 'uchr' resource is found (it uses plain KeyTranslate in this case) and I'm wondering whether

Re: Simulating menu bar blink in Cocoa

2008-04-17 Thread John Stiles
John Stiles wrote: Randall Meadows wrote: On Apr 17, 2008, at 11:54 AM, John Stiles wrote: As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon,

Re: Simulating menu bar blink in Cocoa

2008-04-17 Thread John Stiles
Randall Meadows wrote: On Apr 17, 2008, at 11:54 AM, John Stiles wrote: As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashMenuBar(m

Simulating menu bar blink in Cocoa

2008-04-17 Thread John Stiles
As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs. How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashMenuBar(menuID) but I don't see a Cocoa equivalent. _

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
t telling what shift-[ could be, and it's even possible that [ is the shifted version of another character. I'd go for the actual character and its meaning, not the key. Best, Hank On Apr 17, 2008, at 12:02 PM, John Stiles wrote: I have an NSEvent and I need to know what key the use

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
coming up with low-ASCII values, i.e. numbers under 32. I guess I could implement a hybrid approach where I only use UCKeyTranslate if the character appears to be letters or punctuation...? Seems doable but makes me wonder if I'm going down the wrong path. Is there a better way? John St

RE: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
I'm currently cribbing from here: http://lists.apple.com/archives/carbon-dev/2005/May/msg01062.html And I got rid of the non-uchr section. I can require Leopard in this case. From: Jean-Daniel Dupas [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 9:37 AM To: John Stil

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
he Leopard-and-above timeframe. John Stiles wrote: Sweet, I will take a look at this and post back when I have results or questions. Thanks! Greg Titus wrote: I think you'd ask the NSEvent for its -keyCode, then pass that key code to UCKeyTranslate() with all the modifier key state (includ

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
tring for what that key would mean if the user hadn't been pressing any modifiers. Hope that helps, - Greg On Apr 17, 2008, at 9:02 AM, John Stiles wrote: I have an NSEvent and I need to know what key the user has pressed, minus any of the modifiers. NSEvent -charactersIgnoringModifi

-charactersIgnoringModifiers and the shift key

2008-04-17 Thread John Stiles
I have an NSEvent and I need to know what key the user has pressed, minus any of the modifiers. NSEvent -charactersIgnoringModifiers seems like a good place to start, but it has one serious flaw—it does not ignore the Shift key. So, for instance, it won't change ~ to `, ! to 1 or { to [. I ne

Re: binary search trees & binning

2008-04-16 Thread John Stiles
less. Core Foundation is just ugly in comparison... :) Michael Ash wrote: On Wed, Apr 16, 2008 at 1:20 PM, John Stiles <[EMAIL PROTECTED]> wrote: The difference is, in STL, if you want an array where you can remove from the beginning, you would never use vector<> anyway. You'd use d

Re: binary search trees & binning

2008-04-16 Thread John Stiles
Jean-Daniel Dupas wrote: Le 16 avr. 08 à 00:07, John Stiles a écrit : Hmm, set sounds a lot easier than this to me. Just use insert to put all the doubles into the set (one line), then use lower_bound to find the delineations between each group (another one-liner, though of course you&#x

Re: binary search trees & binning

2008-04-16 Thread John Stiles
I never thought of using a hash function to do binning. Interesting approach. Army Research Lab wrote: Have you looked at hash_multimap (http://www.sgi.com/tech/stl/hash_multimap.html)? Note that the following code was beaten out in entourage, without compiling, testing, etc. struct eqdouble

Re: NSURL and certificates

2008-04-15 Thread John Stiles
AFAIK, you'd need to use the lower-level NSURL* APIs (e.g. NSURLConnection) instead of stringWithContentsOfURL, which is going to be a little more work. Unless there is some trick I don't know about... Also, you don't really want ASCII encoding—probably UTF8 is more what you had in mind. ASCII

Re: binary search trees & binning

2008-04-15 Thread John Stiles
Hmm, set sounds a lot easier than this to me. Just use insert to put all the doubles into the set (one line), then use lower_bound to find the delineations between each group (another one-liner, though of course you'll need to loop over the number of groups you want). Then the distance between

Re: Using the debugger with local variables was Re: is this badly written code?

2008-04-15 Thread John Stiles
IS makes a good point. Moreover, if you have some method which has a side effect or which might not return the same result every time, "po" is no good for debugging it. These simplistic examples (creating a URL from a string) will work the same no matter how many times you execute them, but a l

Re: is this badly written code?

2008-04-14 Thread John Stiles
er, and (im 99% sure) it deals with things like if treeController returned nil instead of a NSArray. NSManagedObject *selectedTreeObject = [self valueForKeyPath:@"delegate.mainWindowController.treeController.selectedObjects.lastObject"]; On Apr 14, 2008, at 10:05 PM, John Stiles wrote

Re: is this badly written code?

2008-04-14 Thread John Stiles
The chained approach is tempting since it's short and convenient, so if the code is not prone to failure, I'd say go for it. If you expect that you might need to see intermediate values in the debugger or there are weird edge cases where something might return nil, I'd break it out into multip

Re: how should I go about downloading files

2008-04-14 Thread John Stiles
Laimonas Simutis wrote: On Fri, Apr 11, 2008 at 6:01 PM, Scott Anguish <[EMAIL PROTECTED]> wrote: On Apr 10, 2008, at 9:04 PM, Laimonas Simutis wrote: Hey, This is my first cocoa projects so I am kind of finding my way around the framework. The question I have is maybe more related t

Re: NSTableView memory usage

2008-04-14 Thread John Stiles
I think Instruments could do a better job of telling you what's going wrong than we could. FWIW, the table view doesn't even know the contents of most of your 1500 rows. It asks for them from the data source as it needs them, and probably only knows the values of the currently visible cells.

Re: Hide application from dock

2008-04-09 Thread John Stiles
Even if you could change it, once your app is running it, changing the plist won't have any effect until the next time the app is run. So it's probably a moot point. glenn andreas wrote: On Apr 9, 2008, at 4:41 PM, Randall Meadows wrote: [resending with my subscribed address--grrr] On Apr

RE: Hide application from dock

2008-04-09 Thread John Stiles
You cannot tell your app to hide from the dock once it has shown. However, you can start hidden and become visible via the (IIRC) TransformProcessType API. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jere Gmail Sent: Wednesday, April 09, 2008 2:11 PM

Re: Open-source NSToolbar?

2008-04-09 Thread John Stiles
This is very cool and I would have used it if I had known about it earlier, but it isn't a replacement for NSToolbar so much as a simpler way to create one (which is awesome and should have been there all along). Geoff Beier wrote: On Tue, Apr 8, 2008 at 12:25 PM, John Stiles &l

Re: Open-source NSToolbar?

2008-04-08 Thread John Stiles
Well, I was thinking more along the lines of an RBSplitView, something you can just drop into your nib/code and suddenly your toolbars are better :) Thanks for the pointers, everyone. [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 2008-04-07 17:47:30: I'm looking for an open-source N

Re: Apparent bug with button hotkeys that use shift

2008-04-07 Thread John Stiles
For any curious Apple engineers, I've just filed this issue as rdar://5848023 and attached a test app (four lines of code). John Stiles wrote: I am trying to add some hotkeys to buttons in my app, and I've hit a weird snag. Specifically, the shift modifier flag appears to be i

Apparent bug with button hotkeys that use shift

2008-04-07 Thread John Stiles
I am trying to add some hotkeys to buttons in my app, and I've hit a weird snag. Specifically, the shift modifier flag appears to be ignored for anything other than alphanumeric keys—i.e. I can't make a button that corresponds to "cmd+F1" and a second button that corresponds to "cmd+shift+F1".

Open-source NSToolbar?

2008-04-07 Thread John Stiles
I'm looking for an open-source NSToolbar-like toolbar implementation... do any exist? I haven't found any yet. I want to check it out and see how some things are done... I don't really need a ton of features outside the standard toolbar stuff, it's more for learning/research to see what can be

Re: Obj-C idioms for list based tasks

2008-04-07 Thread John Stiles
Cocoa doesn't have ordered sets. It has arrays (NSArray), unordered sets (NSSet), and unordered key-value tables (NSDictionary). Any of these can optionally be mutable. NSCountedSet also allows for the equivalent of a "multiset," but for some reason there is no NSCountedDictionary, for the equi

Re: Objective-C Instance Variable Names

2008-04-06 Thread John Stiles
You can't be KVC compliant if you use prefixes like m_, so this limits your potential for using things like bindings. When I write C++, I am also a fan of m_, but it's just not appropriate for Cocoa since it basically means you're fighting against the frameworks. Scott Andrew wrote: See i stil

Re: NSAutoreleasePool causes crashes when empty?

2008-04-03 Thread John Stiles
I'd suspect some sort of error in your app, e.g. perhaps "pool" itself has never been alloc/inited and contains garbage. [pool release] on a valid but empty NSAutoreleasePool is perfectly harmless. Kevin Dixon wrote: I have a method in my class that's a thread entry point, using detachNewThrea

Re: how to hack my own apps

2008-04-03 Thread John Stiles
I'm not a hacker, but if I had to figure out how a Cocoa app worked in a hurry, I'd check out F-Script Anywhere. justin webster wrote: just wondering how easy it is for would-be hackers to get inside my code. how meaningful and human-readable is a reverse engineered version of my app? is the

Re: Objective-C Instance Variable Names

2008-04-03 Thread John Stiles
I'd never heard the Smalltalk conventions before, but I have to admit I really like the sound of them. I'd love to see a block of code written to these rules to see how it plays out in practice. (ObjC or C++, that is, not Smalltalk.) Robert Claeson wrote: On 3 Apr 2008, at 19:58, Rob Napier

Re: Name of NSTableView

2008-04-02 Thread John Stiles
Your delegate and data source can be the same object if you want. Nothing prevents it. Mr. Gecko wrote: What do you mean by the "name"? in the identity tab of Interface builder You could make one class that has all of the common code, and then subclass it for each table instance. That's a pr

Re: Name of NSTableView

2008-04-02 Thread John Stiles
What do you mean by the "name"? You could make one class that has all of the common code, and then subclass it for each table instance. That's a pretty common technique. Mr. Gecko wrote: How would I get the name of a table view? I am trying to make all of my tables use one class for the data

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-02 Thread John Stiles
Alastair Houghton wrote: On 2 Apr 2008, at 17:19, John Stiles wrote: I take it all back; in 2007 there was an MD5 attack discovered which actually allows for completely different binaries that sign the same. Check Wikipedia for the details, but basically MD5 is totally broken now. Wow, times

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-02 Thread John Stiles
John Stiles wrote: Jens Alfke wrote: Also, you're aware that MD5 shouldn't be used for anything security-related anymore? Last I heard it's pretty close to being fully broken. SHA-1 is a lot more secure, and has a larger output which itself makes collisions less likely. &q

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-02 Thread John Stiles
Jens Alfke wrote: Also, you're aware that MD5 shouldn't be used for anything security-related anymore? Last I heard it's pretty close to being fully broken. SHA-1 is a lot more secure, and has a larger output which itself makes collisions less likely. "Fully broken"? I don't know about tha

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread John Stiles
I haven't experimented with CC_MD5, but we do have code which calculates MD5s (calculated via simple C code). Is CC_MD5 optimized e.g. using SSE or AltiVec? Should I expect to see a perf boost if I swapped in this code instead of our regular C code? Jean-Daniel Dupas wrote: Le 2 avr. 08 à 01

Re: test if another app has hung

2008-04-01 Thread John Stiles
I have a vague recollection that the mechanism used by Activity Monitor and friends is not public API, unfortunately. Martin Redington wrote: I went to check the referenced thread, as this is something I wanted to do occasionally, when I noticed that I was the OP for it. The discussion was

Re: Question on bitmap fonts

2008-04-01 Thread John Stiles
If it's rounding, that would be pretty severe. I'd expect at least 6 or 7 viable digits. Aki Inoue wrote: From the look of it, I think there is floating-point rounding involved. After all, the graphics system is treating it as a scalable font so the notion of bitmap (or pixel-based) font des

Re: Custom interface

2008-04-01 Thread John Stiles
If you want to use OpenGL for your GUI, that's always an option, but again you're on your own here. Cocoa provides very little support for this (outside of the generic NSOpenGLView). Honestly I think most people don't appreciate how much stuff you get "for free" in Cocoa, but you learn pretty

Re: Custom interface

2008-03-31 Thread John Stiles
Basically you get to rewrite all the controls from scratch :) It's not a minor undertaking, so be sure it's worth the effort. Your best bet is to look for open-source code which does what you want, since there are already a ton of open-source Cocoa classes for custom UIs. Also, be sure your c

Re: Subverting the first responder chain

2008-03-31 Thread John Stiles
epts the key. Apparently I believed that the message to super didn't work precisely because the next responder in my main application was accidentally swallowing all keyDowns. I apologize for the misinformation, but thank you for helping me find a bug. Allen -Original Message- From: Jo

Re: Subverting the first responder chain

2008-03-28 Thread John Stiles
n I thought. Walking the menus and submenus recursively to build the table is pretty simple, and I've already got a good hash table class which I was able to put to good use. Maybe I'll file a bug on this... Allen Smith wrote: On Mar 27, 2008, at 8:12 PM, John Stiles wrote:

Re: Subverting the first responder chain

2008-03-27 Thread John Stiles
hash table before handling -keyDown:, maybe I'll just keep doing that. It's gross but I guess all the potential solutions are gross. Ken Thomases wrote: On Mar 27, 2008, at 7:52 PM, John Stiles wrote: I am implementing a custom NSView subclass (actually a simple subclass o

Re: Subverting the first responder chain

2008-03-27 Thread John Stiles
d command keys. The view can be connected to other blobs of code, and I am responsible for passing along the message, "hey, the user pressed space!" But it will gleefully consume the event no matter what I tell it was pressed. Hamish Allan wrote: On Fri, Mar 28, 2008 at 12:5

Subverting the first responder chain

2008-03-27 Thread John Stiles
I am implementing a custom NSView subclass (actually a simple subclass of NSOpenGLView) that implements -keyDown: in order to respond to user typing. Typically, this works great. However, I have a few menu items which respond to atypical hotkeys (e.g. one responds to "space", another to "optio

Re: Changing the line height of an NSTextField?

2008-03-26 Thread John Stiles
I've found that adjusting the font matrix to include a negative Y transformation has the effect of decreasing the line height. This seemed like a bug to me when I discovered it, since I just wanted the text to be translated upwards in its cell, not shrink the line height. I wasn't sure if it wa

Re: NSImage > trapezium...

2008-03-23 Thread John Stiles
FWIW, if you find yourself needing to do much more in the way of distorting images, I'd recommend looking into OpenGL directly. It's extremely fast since it goes straight to the hardware, and doing something like "map an image to a trapezoid" is /very/ few lines of code. Much simpler than trying

Re: dealloc methods not being called?

2008-03-21 Thread John Stiles
AppKit does an optimization where at app shutdown time, it stops dealloc'ing things. It does make app quitting faster, but it means that if your deallocs have side effects, the side effects will never occur. It also makes leak tracking difficult if you try to do a full-on leak check at applica

Re: Best Way To Lookup From a Huge Table

2008-03-21 Thread John Stiles
cal performance while the underlying guts were actually doing a more sophisticated task (copy instead of reference, sorted instead of unsorted). Other than that, you've been giving credit pretty much where it's due. Michael Ash wrote: On Fri, Mar 21, 2008 at 4:51 PM, John Stiles <[EMAIL

Re: Best Way To Lookup From a Huge Table

2008-03-21 Thread John Stiles
Michael Ash wrote: On Fri, Mar 21, 2008 at 12:13 PM, John Stiles <[EMAIL PROTECTED]> wrote: Michael Ash wrote: For what it's worth, I wrote a quick test program creating 50,000 random key/value pairs of NSStrings of around 500 characters each, then inserted them into an NSDic

Re: Best Way To Lookup From a Huge Table

2008-03-21 Thread John Stiles
Michael Ash wrote: On Thu, Mar 20, 2008 at 7:58 PM, E. Wing <[EMAIL PROTECTED]> wrote: You really should profile to find your bottlenecks, especially when the STL is concerned. My personal experience has been that gcc poorly optimizes STL code automatically for you and you must go in and p

Re: doubleValue (for an NSString)

2008-03-20 Thread John Stiles
You could always do this float value; if (1 == sscanf([myString UTF8String], "%f", &value)) { // the string was a valid float } else { // it wasn't } For integer, replace "float" with "int" and "%f" with "%d". Localization concerns still apply in theory but in practice there are few loca

Re: Using C++ classes from Objective C

2008-03-20 Thread John Stiles
7;m worried that I'll still end up having to import the header file for my C++ class in my Objective C source file though, which caused a lot of compile errors previously. On Mar 20, 2008, at 12:32 PM, John Stiles wrote: > Without starting a religious war, I have to disag

Re: Using C++ classes from Objective C

2008-03-20 Thread John Stiles
Without starting a religious war, I have to disagree with this. ObjC++ is probably a bad idea if you are a novice programmer in general, but I think it also has some really good things going for it, and having written huge amounts of ObjC++ code, I think it's perfectly straightforward to use.

  1   2   >