Posts

Showing posts from March, 2008

Fun With Creating Kate Plugins Using KDevelop

To use KDevelop Kate Plugin Templates: -> Create a project using the respective Kate Plugin template as normal. -> After the build, change line 6 in the created *.desktop file (in your "src" folder) Old: X-Kate-Version=2.2 New (working): X-Kate-Version=2.5 I never knew the *.desktop file only installed the plugin for the target Kate version. The story: During my first attempt at creating a C++ Kate Plugin (used Python [Pate] prior), I noticed KDevelop had a project template for it! It was great all the way up until the 'make install'. Then I noticed my plugin was showing up. Well after about 20mins of following make install paths... I started comparing rc files, with those plugins that were working. Everything looked fine. Then I noticed the lonely *.desktop file, and wow it was the culprit. "Kate Version", must be set to 2.5 (or whatever version you are using). Now on to creating some plugins for the Kate community!

KDE Mime Type Issue

KDE3 freaked out on me recently. If KDE says: "could not find mime type" (application octet-stream) You do: -> Delete '~/.kde/share/mimelnk/application/octet-stream.desktop' -> reboot OR sudo kcontrol -> File associations -> "Add" -> group: application -> type name: octet-stream Now do: happy dance

NSView Screenshots Using Cocoa

While hacking away with the iPhone SDK & Cocoa, I discovered (from Ryan Britton) this code to capture a NSView as a NSImage. [code] NSView *view = self; [view lockFocus]; NSBitmapImageRep *bitmap = [[[ NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] autorelease]; [view unlockFocus]; NSImage *image = [[[ NSImage alloc] initWithSize: [view bounds].size] autorelease]; [image addRepresentation:bitmap]; [/code] ref: http://lists.apple.com/archives/cocoa-dev/2005/Oct/msg00771.html Other references: http://www.cocoadev.com/index.pl?ScreenShotCode