window

Squirrel at the window

I’m sitting here working this morning when I start to hear that familiar scratching, crawling sound outside. In a few moments, the squirrel’s head appears from the right side of the window. He’s hanging sideways, three stories off the ground, and looking in, about twelve inches from my face. It’s cold outside so I had the window closed, but I slide it open.

“Dude, Cheerios,” he says.

“Oh shoot, I forgot,” I say.

By the time I walk to the kitchen, get the box of Cheerios, and open the door to the deck, he’s already there, waiting.

Designers choosing form over function

One of my gripes with both MacOS and Ubuntu is that it’s harder than it needs to be to grab a window corner or edge to resize it. IMHO, designers are choosing form over function.

How to size (or resize) application windows in AppleScript

AppleScript FAQ: How can I size or resize an application window using AppleScript?

To resize an application window with AppleScript, use a command like this:

tell application "Safari"
    set bounds of front window to {300, 30, 1200, 900}
end tell

That command tells the Safari browser to have the following size and location properties:

How to center a window/frame with Scala Swing

To center a window/frame in a Scala Swing application, add this line to your frame definition:

peer.setLocationRelativeTo(null)

Here’s what this looks like in the top method definition inside a SimpleSwingApplication:

iPhone and iPad JavaScript dialogs (alert, confirm, prompt) alvin November 17, 2011 - 12:36pm

iPhone JavaScript dialogs FAQ: Can I use JavaScript windows and dialogs in my iPhone HTML app (the JavaScript alert dialog, confirm dialog, and prompt dialog)?

Yes you can. According to Apple's iOS Safari web documentation, you can use "iPhone JavaScript windows and dialogs" that are supported by iOS. Here's how.