popUpStatusItemMenu - how to highlight the NSStatusItem

2011-06-10 Thread Martin Batholdy
Hi, I have a NSStatusItem in the systemStatusBar. Now I would like to have the possibility to show the menu of the StatusItem with a keyboard shortcut. I can do this with the popUpStatusItemMenu-method of the NSStatusItem class. However by using this method, the status item in the statusbar does

disable multitouch gestures globally - possible? (mac OS X)

2011-06-04 Thread Martin Batholdy
Hi, Is it possible to disable multi-touch gestures on the trackpad globally with a cocoa application that is background only? Meaning that swipe- and other gestures (except 4-finger gestures) won't work anymore in any program using this gestures. thanks!___

create custom window - NSMenu bar

2011-06-02 Thread Martin Batholdy
Hi, How can you create a custom window view that looks like this: http://s2.macupdate.com/images/screens/uploaded/JPG/32791_scr.jpg?e=79618 or this: http://a5.mzstatic.com/us/r1000/049/Purple/b1/33/08/mzl.bmiomoxu.800x500-75.jpg thanks!___ Cocoa-

where do I find the files of the media templates on my harddisk?

2011-05-21 Thread Martin Batholdy
Hi, Does someone know where I can find the original image files of the templates you can choose in Interface Builder? More precisely I look for the original file of NSStopProgressFreestandingTemplate. thanks! ___ Cocoa-dev mailing list (Cocoa-dev@

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
That did it! Thank you! [newItem setKeyEquivalentModifierMask:SRCarbonToCocoaFlags(256)]; On 19.05.2011, at 15:45, Andy Lee wrote: > On May 19, 2011, at 9:24 AM, Martin Batholdy wrote: >> However >> [newItem setKeyEquivalentModifierMask:modifierMask]; >> has no effect /

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
Andy SRStringForKeyCode() works great. However [newItem setKeyEquivalentModifierMask:modifierMask]; has no effect / doesn't work. On 19.05.2011, at 15:00, Andy Lee wrote: > On May 19, 2011, at 8:42 AM, Martin Batholdy wrote: > >> Hi, >> >> I use the ShortcutRecorder framework in ord

set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
Hi, I use the ShortcutRecorder framework in order to let the user define a shortcut for a given action. The ShortcutRecorder framework saves the shortcut into the preference plist in the following form: keyCode: 18 modifiers: 256 (for CMD +1) Now I would like to use this information from the

Re: how to create a NSMenuItem without memory leaks

2011-05-16 Thread Martin Batholdy
the retain count decreases to 0. On 17.05.2011, at 01:13, Nick Zitzmann wrote: > > On May 16, 2011, at 5:04 PM, Martin Batholdy wrote: > >> Hi, >> >> I create an NSMenu by myself; >> >> menu = [[NSMenu allocWithZone:menuZone] init]; &g

how to create a NSMenuItem without memory leaks

2011-05-16 Thread Martin Batholdy
Hi, I create an NSMenu by myself; menu = [[NSMenu allocWithZone:menuZone] init]; And depending on some data NSMenuItems get created. Now these menuItems get deleted and redrawn depending on some actions of the user with [menu removeItemAtIndex: x]; I create the menu items like this: newIt

Re: create an autorelease pool in the init-method and release it in the dealloc-method ..?

2011-05-14 Thread Martin Batholdy
use new or copy anywhere). On 15.05.2011, at 03:19, Nick Zitzmann wrote: > > On May 14, 2011, at 5:43 PM, Martin Batholdy wrote: > >> I still have trouble understanding the autorelease pool. >> >> Lets assume an object Z has a method where it gets a string y and retur

create an autorelease pool in the init-method and release it in the dealloc-method ..?

2011-05-14 Thread Martin Batholdy
Hi, I still have trouble understanding the autorelease pool. Lets assume an object Z has a method where it gets a string y and returns another string x. Now when an instance of this object is created and the method is invoked, x is returned and is used somewhere else. Now this method of obje

prevent multiple instances of a program

2011-05-11 Thread Martin Batholdy
Hi, My program consists of a menu item and is NSUIagent - so it is hidden in the Mac OS app-bar. Now what surprises me is that I am able to open several instances of this program. Every time I click on the app-file a new symbol appears and I have a new instance of my program running. How can

setState has no effect on an NSButton

2011-05-09 Thread Martin Batholdy
Hi, I have a preference window with four NSButtons that are all connected to a method and an IBOutlet: IBOutlet NSButton *buttonA; IBOutlet NSButton *buttonB; IBOutlet NSButton *buttonC; IBOutlet NSButton *buttonD; NSUserDefaults *prefs; Now I would like to set the state of these buttons accor

Re: when to save user-data to disk?

2011-05-07 Thread Martin Batholdy
On 07.05.2011, at 05:51, Kyle Sluder wrote: > Question one: iOS or Mac? > > --Kyle Sluder > (Sent from the road) > > Mac OS. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the li

when to save user-data to disk?

2011-05-06 Thread Martin Batholdy
Hi, I have a program that saves its data (an array of dictionaries) as a plist in the application support folder with the writeToFile method from NSFileManager. Now this array gets manipulated a lot while working with the program. And currently I save the array to disk every time something in th

change the content of the datasource for a tableView from a different class

2011-05-05 Thread Martin Batholdy
Hi, I have a singleton class that manages a tableView (and provides the datasource). Now I would like to update this tableView from another class. Since the class that manages the tableView is a singleton I don't have to initiate a new instance of that class. So I thought there should be no pro

Re: update a tableView from a different class

2011-05-04 Thread Martin Batholdy
On 05.05.2011, at 03:35, Graham Cox wrote: > Have you checked to see whether removeObjectAtIndex:1 actually succeeds? If > the index is out of bounds, an exception will be thrown and -reloadData will > never be reached. You can easily check that in the debugger. It looks > suspicious that you

Re: update a tableView from a different class

2011-05-04 Thread Martin Batholdy
On 05.05.2011, at 03:06, Kyle Sluder wrote: > How is the table view getting its data. If it's through bindings, I > bet it's because you're not mutating the array in a KVO-compliant way. Well, I dont use an ArrayController or something like this in the interface builder. and I implemented all

update a tableView from a different class

2011-05-04 Thread Martin Batholdy
Hi, I have a singleton class which manages a tableView. In the UI everything works fine. I can delete entries, edit entries and the table gets updated properly. Now I have another class which manages the entries of a dropdown menu. Now when an item of this dropdown menu is getting pressed I wan

objects and "global / shared data"

2011-05-03 Thread Martin Batholdy
Hi, I am still new to objective-c and cocoa and the whole object-oriented approach. So perhaps this is a weird question for you, but for me it is really important to understand. I have a small program with a DataHandler-class. This class has methods to get data from a file on the disk and to sa

simulate click on NSStatusItem

2011-05-01 Thread Martin Batholdy
Hi, I am currently working on a StatusItem app (so I only have a small icon on the upper right side in the systemStatusBar). I recently implemented a shortcut for the main function of this status item app. Now when the shortcut-button is pressed an action is invoked just like you could invoke

delete entries in a tableView with the backspace-key on the keyboard

2011-04-29 Thread Martin Batholdy
Hi, I have a tableView and a MutableArray as DataSource. Below the tableView I have a delete button to delete selected entries. That works fine. The entries disappear when pressing the delete button. Now I would like to achieve the same effect with a press on the backspace-button. How can I l

sort array of dictionaries by multiple critera

2011-04-27 Thread Martin Batholdy
Hi, I have an array of dictionaries. One dictionary-entry looks like this: { ID = 34; counter = 2; date = "2011-04-19 15:43:52 +0200"; title = "test.pdf"; type = file; } Now I would like to sort my array of dictionaries first by type and then (within the type-dictionaries)

get a dictionary out of an array of dictionaries by a criterion

2011-03-09 Thread Martin Batholdy
Hi, I have a plist with an array of dictionaries. Now every of these dictionaries has a key 'ID' with an integer. Now how I can get only one dictionary element out of this array where key is equal to x? thanks for any advice! ___ Cocoa-dev mailing

Re: easy way to store table-like data

2011-03-07 Thread Martin Batholdy
Hi, thanks for the reply. Is it also possible to filter the entries of an NSDictionary like in SQL? for example I have a key "type" and different entries. Is it possible to get an Array of all elements where "type" is equal to "website" (or something like that)? On 07.03.2011, at 21:05, Wim

easy way to store table-like data

2011-03-07 Thread Martin Batholdy
Hi, what is the easiest way to store data and retrieve it in an sql-like-fashion? I have informations of the form: name: ... type: ... nr of clicks: ... etc. and I would like to present it in tableviews (so it should be sortable etc.) I am familiar with sql ... and this seems pretty straight

set up a hotkey UI

2010-04-12 Thread Martin Batholdy
Hi, I would like to implement a "set-hotkey" option, where the user presses a hotkey, the app registers the key-combination and makes a global key-shortcut. Does someone here know a good tutorial or has some hints where to start? thanks for any help. _

app window that doesn't deactive the current app

2010-03-16 Thread Martin Batholdy
Hi, I would like to have a window that pops up via a shortcut. This window should be in background and the active app shouldn't get inactive. How is that possible? I have seen that in the Clips app (http://conceitedsoftware.com/products/clips ). thanks!

Re: program crashes because of a variable declaration

2009-06-11 Thread Martin Batholdy
wrong behavior, as the app don't have the information it needs at some point ..? Am 11.06.2009 um 15:50 schrieb Andy Lee: On Jun 11, 2009, at 9:38 AM, Martin Batholdy wrote: But it crashes on startup when I add something like; @interface AppleScriptHandler : NSObject { NSDic

program crashes because of a variable declaration

2009-06-11 Thread Martin Batholdy
Hi, my program crashes if I add a variable declaration to a header file. I really don't understand what the hell is wrong with it; The programm works fine with this lines; @interface AppleScriptHandler : NSObject { NSDictionary *errorInfo; NSString *appFolder, *filePathFinderFi

Re: App does not start on a different machine

2009-06-10 Thread Martin Batholdy
I had problems with array bounds, but I thought I found all errors. The problem is, when the program is running in debug mode - there don't appear any errors ... So how can I find the array call that leads to this? Am 11.06.2009 um 01:19 schrieb Nick Zitzmann: On Jun 10, 2009, at

Re: App does not start on a different machine

2009-06-10 Thread Martin Batholdy
i: --- On Wed, 6/10/09, Martin Batholdy wrote: my app works fine on my macbook, but on a macbook pro it starts and then just disappears immediately after the start (nor error message). The OS version is the same, and the app is pretty simple (no graphic stuff or something like that). There

Re: App does not start on a different machine

2009-06-10 Thread Martin Batholdy
No, both are intel macs. Am 11.06.2009 um 00:31 schrieb Luke the Hiesterman: Intel app on PPC? Luke On Jun 10, 2009, at 3:30 PM, Nick Zitzmann wrote: On Jun 10, 2009, at 4:26 PM, Martin Batholdy wrote: There are no errors or warnings in the code ... and as I said, the app works fine

App does not start on a different machine

2009-06-10 Thread Martin Batholdy
hi, my app works fine on my macbook, but on a macbook pro it starts and then just disappears immediately after the start (nor error message). The OS version is the same, and the app is pretty simple (no graphic stuff or something like that). There are no errors or warnings in the code ... an

Re: no scroll bars (NSTableView)

2009-06-09 Thread Martin Batholdy
e the window slightly (and the scroll view is set to resize with the window)? Can you post a sample project that replicates your problem? Shlok Datye Coding Turtle http://codingturtle.com On 09.06.2009, at 01:57, Martin Batholdy wrote: hi, I have set up a NSTableView in the Interface Build

no scroll bars (NSTableView)

2009-06-08 Thread Martin Batholdy
hi, I have set up a NSTableView in the Interface Builder. I have connected this with a NSObject Outlet. And I have set the data source of the NSTableView to the NSObject. The problem I have is that there don't appear any scroll bars even when the content doesn't fit. I have a method called

Add app to "launch on startup" list via AppleScript

2009-06-08 Thread Martin Batholdy
Hi, I have the following AppleScript that let me add an application to the "launch on startup" menu: tell application "System Events" make login item at end with properties {path:"...", kind:application} end tell The script works fine when I start it in the script editor for

Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy
uilder set)... thanks again! On Mon, Jun 8, 2009 at 6:54 PM, Martin Batholdy > wrote: WHEN are you looking at the state? I look at the state in the method that is invoked by the NSButton (clicking on it). Am 08.06.2009 um 23:58 schrieb KK: Use [launchOption state] ==

Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy
, Martin Batholdy > wrote: Hi, I have added a NSButton Check Box to a window. Now I want to grab the state of this check box. I added an IBOutlet to my header file and connected it with the check box in Interface Builder; IBOutlet NSButton *launchOption; Now I want to test the state via;

Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy
the NSObject and connected a method to the NSButton / check box (which works fine)... Is there something fundamentally wrong ...? Am 09.06.2009 um 00:41 schrieb Steve Bird: On Jun 8, 2009, at 6:33 PM, Martin Batholdy wrote: Use [launchOption state] == NSOnState or [launchOption state

Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy
08.06.2009 um 23:58 schrieb KK: Use [launchOption state] == NSOnState or [launchOption state] == NSOffState Keita On Mon, Jun 8, 2009 at 5:52 PM, Martin Batholdy > wrote: Hi, I have added a NSButton Check Box to a window. Now I want to grab the state of this check box. I added an IBOutlet to

How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy
Hi, I have added a NSButton Check Box to a window. Now I want to grab the state of this check box. I added an IBOutlet to my header file and connected it with the check box in Interface Builder; IBOutlet NSButton *launchOption; Now I want to test the state via; if([launchOption state] =

NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Martin Batholdy
hi, I have an IBOutlet defined in my header; IBOutlet NSTabView *tabView; This Outlet is connected with a TabView generated with Interface Builder. The TabView has two tabs, and in my implementation file I want to do something when tab1 is active and something else when tab2 is active.

movable / dragable menu symbol

2009-06-06 Thread Martin Batholdy
hi, I successfully created a menu item / symbol at the menu bar at the top right of mac OS. Now I was wondering; I can not drag the symbol via cmd+click and change the position of it by that. With other symbols from other apps I can do that. Is there a way to give the own symbol this ab

NSArray vs. NSMutableArray ... "distinct objective-c type"

2009-06-06 Thread Martin Batholdy
hi, I have created a method that do something with an NSArray. Now when I use the method and give it an NSMutableArray instead of an NSArray, I get a warning; "passing argument x of "method" from distinct objective-c type" Now, the result is ok. Everything is working how it is intended.

Re: get a window in front by clicking on a menu item

2009-06-05 Thread Martin Batholdy
[menuItem setTarget:myWindowOutlet]; [menuItem setAction:@selector(makeKeyAndOrderFront:)]; ok, that makes sense to me. But now, the menuItem is inactive (so I cant click on it). here my code; hope someone can give me a clue what is wrong with the code... AppController.h #import "Men

understanding problem; creation of instances of objects; xCode vs. Menu Builder

2009-06-05 Thread Martin Batholdy
hi, I think I have a major understanding problem ... And I just don't know how to solve the problem. I have a methodfile X and a methodfile Y And I have a window that I have set up in the Interface Builder. The window is connected with the method Y. So, when the program starts, the window

Re: get a window in front by clicking on a menu item

2009-06-05 Thread Martin Batholdy
reated you, and this also have connection to an existing window; now go to the openWindow method when someone clicks on you and get that damn window in front... (is that the way it should work ..?) Am 05.06.2009 um 20:54 schrieb Alexander Spohr: Ah, wait! Am 05.06.2009 um 18:03 schr

get a window in front by clicking on a menu item

2009-06-05 Thread Martin Batholdy
hi! I have a problem, getting a window in front by clicking a menu item; In my xcode project I have a menuHandler, which has methods to create a menu, add items to that menu, delete items and so on. My AppController knows about the menuHandler and creates an instance of it in the awakeFrom