Re: Coding double modifier global hotkeys?

2010-01-24 Thread Sumner Trammell
Thanks Eric. I'm not surprised. It seems that interpreting the events produced by the rapid double press/release of a modifier key is a way to do double modifier global hotkey detection...? -s On Sun, Jan 24, 2010 at 12:52 PM, Eric Schlegel wrote: > > On Jan 24, 2010, at 9:17

Coding double modifier global hotkeys?

2010-01-24 Thread Sumner Trammell
Hi, I've been playing with code to create global hotkeys. I found some sample code here: http://dbachrach.com/blog/2005/11/program-global-hotkeys-in-cocoa-easily (To my dismay, these things require Carbon knowledge, but thanks to the sample code, it seems that I can once again get away with know

Tabbed preference panels

2008-08-22 Thread Sumner Trammell
Hi, I'm working on a preferences panel. I want to build a compound panel like the kind seen in most mainstream apps today: a toolbar on top with "tabbed" view switching. The panel changes its appearance depending on which 32x32 toolbar icon you have selected. I'm not sure where to start. Looking f

Window controllers, code obfuscation

2008-08-19 Thread Sumner Trammell
Hi, I'm trying to decipher someone else's code who is no longer available. He did something that I think I can simplify, but I first want to make sure I'm not being completely wrong-headed about what I'm looking at. He does the following in his MyDocument.m file: - (void)windowControllerDidLoa

What is Core Foundation, and other terminology/history questions.

2008-08-17 Thread Sumner Trammell
Hi, can someone explain to me the philosophy/principles behind Core Foundation? I'm just having a hard time seeing the overall relationship between Carbon, Core Foundation, and Cocoa. A few (stupid) questions I have are: + Why was Core Foundation invented? + What did developers use BEFORE Core

Why won't Gmail cooperate with authentication delegate methods? (Gmail RSS feeds do.)

2008-08-13 Thread Sumner Trammell
(I realize that this is bordering on a Google API question, but there is some Cocoa content.) Hi. One can whip up a WebKit/Cocoa app, aim it at a Gmail URL like this: https://www.google.com/accounts/ServiceLoginAuth?continue=http://mail.google.com/gmail&service=mail&Email=YOUR_LOGIN&Passwd=YOUR

When the getter returns a BOOL, is "is" the preferred prefix?

2008-08-08 Thread Sumner Trammell
Hi, I have another "What's the idiom?" question. We know that Cocoa strongly suggests using setFoo and foo for setters and getters. Sometimes I see setters and getters using the idiom setFoo and isFoo. For example, in NSToolbar, you have setVisible and isVisible. When the getter returns a BOOL,

Re: Control-dragging from menu item in MainMenu.nib to File's Owner object in MyDocument.nib

2008-08-08 Thread Sumner Trammell
Thanks Shawn. Another case of "Oh, now I know when to use that mechanism I've heard so much about." -s On Fri, Aug 8, 2008 at 1:02 PM, Shawn Erickson <[EMAIL PROTECTED]> wrote: > On Fri, Aug 8, 2008 at 8:52 AM, Sumner Trammell > <[EMAIL PROTECTED]> wr

Re: Does [NSApp setApplicationIconImage] leak memory?

2008-08-08 Thread Sumner Trammell
Ok, stupid question time. 1. Is the need for the autorelease pool because of the use of setApplicationIconImage, or because of the array that is being used in conjunction with setApplicationIconImage? 2. Would putting the calls to setApplicationIconImage in a class method also stop the memory lea

Re: How do I get those 1 pixel black lines into my app window?

2008-08-08 Thread Sumner Trammell
border, separator lines will be drawn between > the content and the bottom border, and the bottom corner will be > rounded. Other methods on non-textured windows or unused edges will > return 0.0 or YES." > > http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSWindow

Control-dragging from menu item in MainMenu.nib to File's Owner object in MyDocument.nib

2008-08-08 Thread Sumner Trammell
Hi, my document-based app, created from the Xcode document-based app template, now needs a new item added to its File menu. Menu items are, of course, in MainMenu.nib, and the rest of the app's widgets, like the main window, etc. are in MyDocument.nib. I can't control-drag from my new menu item i

How do I get those 1 pixel black lines into my app window?

2008-08-07 Thread Sumner Trammell
Hi, I've notced that in most apps, at the top and bottom, there is a 1 pixel black line separating the gray window from the (usually) white content. This looks better than stock, which of course is why everybody and Apple seems to be doing it. What is the canonical way to do this? Are people usin

Re: Making child windows move with their parents

2008-07-31 Thread Sumner Trammell
That should be: I added the addChildWindow:ordered: call to webView:createWebViewWithRequest: and things work perfectly. -s On Thu, Jul 31, 2008 at 10:55 PM, Sumner Trammell <[EMAIL PROTECTED]> wrote: > I've solved it, finally. My mistake was not realizing that the >

Re: Making child windows move with their parents

2008-07-31 Thread Sumner Trammell
window] is the parent webView's window theDocument is the child document object [[theDocument webView] window] is the child document's webView's window On Thu, Jul 31, 2008 at 1:43 PM, Sumner Trammell <[EMAIL PROTECTED]> wrote: > Nope. This version crashes as well: >

Re: Making child windows move with their parents

2008-07-31 Thread Sumner Trammell
Nope. This version crashes as well: [[[self webView] window] addChildWindow:[[theDocument webView] window] ordered:NSWindowAbove]; I'm getting something wrong in the way I'm looking at this problem. What am I not seeing? Thanks, -s On Thu, Jul 31, 2008 at 1:01 PM, Sumne

Re: Making child windows move with their parents

2008-07-31 Thread Sumner Trammell
represent? -s On Thu, Jul 31, 2008 at 1:45 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 30 Jul '08, at 9:51 PM, Sumner Trammell wrote: > >> but it doesn't work. I get *** -[MyDocument window]: unrecognized >> selector sent to instance 0x1613ab30 in t

Re: Making child windows move with their parents

2008-07-31 Thread Sumner Trammell
;sender" is and the relationship > between the document and other objects. Using addChildWindow: should be OK, > once you've sorted this out. > > hth, > > Graham > > On 31 Jul 2008, at 2:51 pm, Sumner Trammell wrote: > >>

Making child windows move with their parents

2008-07-30 Thread Sumner Trammell
Hi. In my WebKit-based app, there is an occasional popup window, and I'm trying to make it so that when you move the main window around, the popup moves as well. Here is my typical, vanilla WebView delegate method. In it, new windows are made visible: - (void)webViewShow:(WebView *)aSender {

Re: How would you tell WebKit to keep all JavaScript popup windows on top/in front?

2008-07-30 Thread Sumner Trammell
t to float. > > -Rob > > -- > Rob Napier -- Software and Security Consulting -- http://robnapier.net > > > > On Jul 28, 2008, at 1:58 PM, Sumner Trammell wrote: > >> Hi, I've used WebKit to write a small Single-Site Browser that takes >> you straight to a speci

Is the WebView inspector buggy in Interface Builder 3.0?

2008-07-30 Thread Sumner Trammell
Hi, is anyone else having problems with the WebView inspector in Interface Builder 3.0? I have a window with a WebView on it in MyDocument.nib. When I open MyDocument.nib, the WebView attributes inspector shows font sizes of 12 and 12 for default and fixed fonts. It also shows Java enabled. I

"get" prefixes in Cocoa

2008-07-30 Thread Sumner Trammell
Hi. Cocoa idioms dictate setFoo: and foo: for setters and getters. Occasionally, the prefix "get" appears in a Cocoa method, like this one: - (void)getObjects:(id *)objects andKeys:(id *)keys When a method is prefixed with get in Cocoa, what is being expressed? Thanks, -s

How would you tell WebKit to keep all JavaScript popup windows on top/in front?

2008-07-28 Thread Sumner Trammell
Hi, I've used WebKit to write a small Single-Site Browser that takes you straight to a special section of the company intranet. It works great, but there is one particular link on the page that creates a popup window using JavaScript. I want this popup to always stay on top. In other words, I don'

Re: NSTimer and a problem with document-based apps

2008-07-28 Thread Sumner Trammell
Thanks guys. Using class methods was a brilliant idea. Solidified my understanding of when I might want to use them, and when I might want to use @synchronized as well. -s On Sat, Jul 26, 2008 at 7:30 PM, Todd Heberlein <[EMAIL PROTECTED]> wrote: >> - (id)init { >> ... >> timer = [NSTimer schedu

Re: Getting process table info from within a Cocoa app

2008-07-28 Thread Sumner Trammell
On Sat, Jul 26, 2008 at 8:44 PM, Ken Thomases <[EMAIL PROTECTED]> wrote: > > On Jul 26, 2008, at 12:58 AM, Sumner Trammell wrote: > >> Hi. A daemon process is running independently of my Cocoa app. Given a pid >> file of the daemon pro

NSTimer and a problem with document-based apps

2008-07-26 Thread Sumner Trammell
Hi. I'm writing a Cocoa document-based app (using the Xcode template) that uses a WebView and needs an NSTimer to trigger one of the methods every 10 seconds in the MyDocument class. In my init method, I set up the timer: @interface MyDocument : NSDocument { IBOutlet WebView *webView; NSTimer

Getting process table info from within a Cocoa app

2008-07-25 Thread Sumner Trammell
Hi. A daemon process is running independently of my Cocoa app. Given a pid file of the daemon process in a known location, say /var/run/somedaemon.pid, I would like my Cocoa app to read that file and check the process table to see if the daemon is actually running. If the daemon IS running, I want