performSelector doesn't work for modal window

2010-03-12 Thread Alexander Bokovikov
Hi, All, Unfortunately NSButton click is called when button is pressed, but not when it is released. Therefore any timeconsumming process, executed on the button click, will keep the button pressed. To avoid it I've decided to use performSelector:withObject:afterDelay: message. This appro

How to show a progress without multithreading?

2010-03-13 Thread Alexander Bokovikov
Hi, All, I have a time-consuming procedure, and I'd like to show its progress. I can't use multi-threading for some technical reason. I'm looking for a way to update a progress indicator from this procedure, As far as I understand my task is to cause message loop processing. And my question is

Re: Cocoa-dev Digest, Vol 7, Issue 307

2010-03-14 Thread Alexander Bokovikov
On Sat, 13 Mar 2010 at 20:23:40 -0800 Quincey Morris wrote: You might want to choose a different run loop mode, if you have special requirements. NSEventTrackingRunLoopMode is sufficient to allow keystrokes and mouse clicks to be processed, so that you can have a UI (say, Esc key or button

NSNotificationCenter and a modal window - a problem

2010-03-24 Thread Alexander Bokovikov
Hi, All, I have a project where a progress of NSTask is indicated through this code: if ([self popup] != nil) anObj = [self popup]; else anObj = self; [[NSNotificationCenter defaultCenter] addObserver:anObj

Re: NSNotificationCenter and a modal window - a problem [solved]

2010-03-24 Thread Alexander Bokovikov
On 24.03.2010, at 12:48, Ken Thomases wrote: You need to invoke -readInBackgroundAndNotifyForModes: and pass an array of modes which includes NSModalPanelRunLoopMode (or NSRunLoopCommonModes, which includes NSModalPanelRunLoopMode by default). Many thanks! Really I should look at that me

How to catch modal window appearance?

2010-03-26 Thread Alexander Bokovikov
Hi, All, Is there any notification or NSWindow delegate method, called immediately after the modal window is shown on screen? It looks like windowDidExposed doesn't come to a modal window. Is there any solution? Thanks. ___ Cocoa-dev mailing list

Re: How to catch modal window appearance?

2010-03-27 Thread Alexander Bokovikov
On 26.03.2010, at 23:10, Fritz Anderson wrote: On 26 Mar 2010, at 11:12 AM, Alexander Bokovikov wrote: Is there any notification or NSWindow delegate method, called immediately after the modal window is shown on screen? It looks like windowDidExposed doesn't come to a modal windo

Re: How to catch modal window appearance?

2010-03-27 Thread Alexander Bokovikov
On 27.03.2010, at 12:48, Ken Thomases wrote: I'm not really sure what you're asking for. A modal window being shown on screen is not something that happens spontaneously _to_ your application, it's something that your application does. So, whatever you want to do after the window is shown

Re: How to catch modal window appearance?

2010-03-27 Thread Alexander Bokovikov
On 27.03.2010, at 1:59 PM, Ken Thomases wrote: I can't see how this is either correct or incorrect from the point of view of OOP philosophy. OOP involves encapsulation, separation of concerns, polymorphism, etc. "separation of concerns" is just the case. I would say it's the other way around

Re: How to catch modal window appearance?

2010-03-27 Thread Alexander Bokovikov
On 27.03.2010, at 16:57, Ken Thomases wrote: "separation of concerns" is just the case. Except the timing does not impact on separation of concerns. I'm not about timing. I'm just about code separation. Initialization is a part of dialogue, so its window controller is the right place, w

Re: How to catch modal window appearance?

2010-03-27 Thread Alexander Bokovikov
On 27.03.2010, at 19:39, Joanna Carter wrote: Every window is "managed" by a Controller and it is from this Controller that you can run any process you want, as well as creating and showing a window. This is correct of course, and this was just what I tried to reach for. But I had to cal

Re: How to catch modal window appearance?

2010-03-27 Thread Alexander Bokovikov
On 27.03.2010, at 20:36, Ken Thomases wrote: The app controller should just send a message to the window controller asking it to do the whole thing. Then, the window controller can create the window, initiate the process, and invoke - runModalForWindow:, in whichever order it prefers. Th

Re: How to catch modal window appearance?

2010-03-29 Thread Alexander Bokovikov
On 30.03.2010, at 2:27, Lee Ann Rucker wrote: Well, if you're using runModalForWindow: and relying on it to show the window, it goes away before the method returns, so there is no point in the code after show and before hide. I understand it of course. I told about the window controller cl

How to find all clipping siblings for a view?

2010-04-15 Thread Alexander Bokovikov
Hi, All, For some reason I need to do a job which NSWindow usually does, when it redraws itself (AFAIU) - I need to find all its views, which have z- order higher than my view, then get their bounding rectangles, unite them, subtract from the window content view bounding rectangle and sect

Re: How to find all clipping siblings for a view?

2010-04-16 Thread Alexander Bokovikov
On Friday, April 16, 2010 at 2:40 PM Norbert M. Doerner wrote: NSView *rootView; NSArray *mySubViews rootView = [theWindow contentView]; mySubViews = [rootView subviews]; Thanks, it looks like I've found it. The only question is why Cocoa has no Z-order term? I've read in the doc that it is i

Strange "autoreleased with no pool in place" message

2010-04-17 Thread Alexander Bokovikov
Hi, All, Am trying to debug an app, which crashes in 10.4 when I build it with 10.5 SDK and 10.4 deployment target, but works OK when is built with 10.4 SDK and 10.4 deployment target. All builds are performed in 10.5 I'm getting these lines in crash log: Thread 0 Crashed: 0 libSystem.B.

Re: Strange "autoreleased with no pool in place" message

2010-04-17 Thread Alexander Bokovikov
On 18.04.2010, at 1:30, Jens Alfke wrote: On Apr 17, 2010, at 12:18 PM, Alexander Bokovikov wrote: *** _NSAutoreleaseNoPool(): Object 0x209fa0 of class NSCFString autoreleased with no pool in place - just leaking Set a breakpoint at _NSAutoreleaseNoPool and start the app. That should

Re: How to find all clipping siblings for a view?

2010-04-17 Thread Alexander Bokovikov
On 18.04.2010, at 1:29, Jonathan Hess wrote: On Apr 16, 2010, at 10:47 AM, Kyle Sluder wrote: On Fri, Apr 16, 2010 at 10:37 AM, Corbin Dunn wrote: You can't control it in IB (short of removing the view and adding it back in). But in code, you can just call - addSubview:positioned:relati

Re: Strange "autoreleased with no pool in place" message

2010-04-18 Thread Alexander Bokovikov
On 18.04.2010, at 1:59, Ken Thomases wrote: Run > Manage Breakpoints > Add Symbolic Breakpoint. Type the name of the function to break on. In general, you should familiarize yourself with the Xcode Debugging Guide: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conce

AuthorizationServices - what is wrong here?

2011-10-07 Thread Alexander Bokovikov
Hi, All, Here is a piece of code where I'm trying to customize the password input box. Nevertheless I can see nothing but generic icon and default prompt text. The rights are assigned and my helper tool is working correctly. The problem is just in the interface customization. Could anybody tel

NSFileHandle readInBackground vs threading?

2011-11-08 Thread Alexander Bokovikov
Hi, All, I have a need to read some data from a local socket, which serves for IPC. And data may come very quickly, so (AFAIU) inner socket buffer might overflow, so a portion of data might be lost. I don't see a way how to define an inner system buffer size, so the only I can is to do my

Re: NSFileHandle readInBackground vs threading?

2011-11-08 Thread Alexander Bokovikov
On 09.11.2011, at 0:50, Scott Ribe wrote: On Nov 8, 2011, at 9:54 AM, Alexander Bokovikov wrote: I have a need to read some data from a local socket, which serves for IPC. And data may come very quickly, so (AFAIU) inner socket buffer might overflow, so a portion of data might be lost

Re: NSFileHandle readInBackground vs threading?

2011-11-13 Thread Alexander Bokovikov
On 09.11.2011, at 19:25, Scott Ribe wrote: I'm not arguing the OP isn't seeing data lost, just that it cannot be happening the way he thinks it is if he's using any normal networking calls. Thanks to everybody for your useful comments! My local socket is opened in the client process just a

Files Drag&Drop - target file icon problems

2011-11-13 Thread Alexander Bokovikov
Hi, Everyone, In my Cocoa app, I use file saving by drag&drop into Finder window (Desktop is one particular case). I'm trying to do it just as docs tell me: I use namesOfPromisedFilesDroppedAtDestination message to create a list of files being saved (one file at least) then I create and w

NSWindow delegate messages question

2009-12-18 Thread Alexander Bokovikov
Hi, All, I'm rather new in Cocoa development, so I have some misunderstanding after API manuals reading. In particular I have a popup panel, opened by a button click in the main window: - (IBAction) btnClick:(id)sender { [popupPanel showWindow]; } I'd like to launch some process (no matter

Re: NSWindow delegate messages question

2009-12-18 Thread Alexander Bokovikov
27;d like to show an alert box after popup panel closure. How to intercept the window closure event? I have no idea. Best regards, Alexander - Original Message - From: "Graham Cox" To: "Alexander Bokovikov" Cc: Sent: Friday, December 18, 2009 6:13 PM Subj

AppController dealloc is never called. Why?

2010-01-12 Thread Alexander Bokovikov
Hi, All, Perhaps my question is stupid, but this is my first Cocoa project, so I'll try to ask. I've noticed that my main window controller (usually named AppController) is never freed. I don't know where it is allocated, but suppose it happens somewhere within NSApplication. All other wi

Application help window size

2010-01-13 Thread Alexander Bokovikov
Hi, All, Does anybody know how could I define default help window width? I've created a navigation menu, which is too wide for default window, so horizontal scrollbar appears. Or should I adjust my help design to the existing help window default size? Thanks, Alexander ___

Weird exception

2010-01-22 Thread Alexander Bokovikov
Hi, All, Browsing the console log I've found that my app raises an exception, when it is launched in Mac OS X 10.4. I built it in 10.5 with 10.4 as a target setting. I didn't see any problems there. The exception is caused by unsupported selector calling [NSString boolValue]. I've scanned

Re: Weird exception

2010-01-23 Thread Alexander Bokovikov
On 22.01.2010, at 20:50, Keary Suska wrote: I would put my money on bindings. It shouldn't be too difficult to isolate the issue with the debugger. I've created a category and set a breakpoint within this method. Call stack leads me to NSApplication applicationWillFinishLaunching method,

Re: Weird exception

2010-01-23 Thread Alexander Bokovikov
On 24.01.2010, at 1:12, Kyle Sluder wrote: You should turn on zombies and run your app in the debugger on 10.4. Could you please describe it more particularly, as it's not clear for me what should I do exactly. Should I transfer all my sources into 10.4 OS? Or should I use Terminal to run

Re: Weird exception

2010-01-25 Thread Alexander Bokovikov
On 24.01.2010, at 14:08, vincent habchi wrote: Under XCode, you select 'run with performance tool' -> 'zombies'. This will launch your app with the 'zombie instrument' attached, that will signal you if you app tries to message a released entity. I'm sorry, but I don't see "zombies" item wit

Re: Cocoa-dev Digest, Vol 7, Issue 107

2010-01-25 Thread Alexander Bokovikov
On 25.01.2010, at 19:14, James Montgomerie wrote: I think you're on a wild goose chase here - the most likely explanation to me is that something somewhere is deliberately calling -[NSString boolValue] (and it may not be 'your' code - I wouldn't put it out of the realms of possibility that

NSView : Background bitmap drawing issue

2010-02-15 Thread Alexander Bokovikov
I've written a subclass of NSView, which draws a NSImage, as the background. All is working, but the only problem is in different behavior on different Macs / OS versions. Here is the drawing code: @interface BGSkinView : NSView { NSImage *bg; BOOL isLeo, isSnowLeo; }

Re: NSView : Background bitmap drawing issue

2010-02-15 Thread Alexander Bokovikov
itVersionNumber is incremented by an integer amount for 10.x releases and by a fractional amount for 10.x.x releases. On Feb 15, 2010, at 1:26 AM, Alexander Bokovikov wrote: I've written a subclass of NSView, which draws a NSImage, as the background. All is working, but the only pr

NSWindow - how to resize it keeping aspect ratio?

2010-02-18 Thread Alexander Bokovikov
Hi, All, I'm sorry if this is a stupid question, but I don't see an evident answer... I need the subj, but don't see appropriate NSWindow method... Am I missing something? Any help would be appreciated. Best regards, Alexander ___ Cocoa-dev mai

Re: NSWindow - how to resize it keeping aspect ratio?

2010-02-25 Thread Alexander Bokovikov
On 25.02.2010, at 15:17, Ariel Feinerman wrote: there is of the matter is that -setAspectRatio: sets the window`s aspect ratio, but when window has been loaded from nib and not resized yet, its size is taken from "content size" that was written in IB with it own aspect. Then when window ha

Re: NSWindow - how to resize it keeping aspect ratio?

2010-02-25 Thread Alexander Bokovikov
On Thursday, February 25, 2010 at 5:57 PM Ariel Feinerman wrote: You calculate view`s aspect from it size, but I mean content frame (not window frame) from constant aspect, for example 4/3, then set size. I don't understand what is the problem. Isn't "my" 422/674 ratio not a constant? What is

NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
Hi, All, Perhaps it's my misunderstanding, but I can't activate window title when I apply [mainWindow makeKeyAndOrderFront:nil] to main app window in the "performDragOperation" drag&drop handler. The content is dropped into the window, and window goes to the top of screen, but its title

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; I tried it too as well as performSelectorOnMainThread:(SEL)aSelector withObject:(i

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; It looks like I've understood why it is not working. Here is the message descript

Re: NSWindow - makeKeyAndOrderFront problem - solved

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; Really the problem was not in the scheduling but just in the scope of the message

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 22:38, Andreas Mayer wrote: Hm. You don't? Just dragging should not switch the focus to another application. What do you have in mind? Is it incorrect to create such behavior? My app is a player. Dropping file into it I'd expect its activation. Am I wrong? Without activ

Re: NSWindow - makeKeyAndOrderFront problem

2010-03-01 Thread Alexander Bokovikov
Hi, All, I'm sorry for an offtopic, so I'm writing just to close the thread. On 02.03.2010, at 7:37, Andy Lee wrote: If I feel my app should come forward in both cases I do think it should be okay to implement it that way, but there *is* precedent for not activating the app. I'd even say,

Transparent background for controls - some problems

2010-03-07 Thread Alexander Bokovikov
Hi, All, I'm trying to create a NSView descendent which could draw a custom bitmap background and which could contain other subviews (like labels and buttons) . The problem that all goes perfectly unless controls will change their state or any another event will cause my view redrawing.

NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
Hi, All. I have a table view in the "main" window, where it works fine. And have yet another very similar table view in a popup modal panel. where it fails immediately after panel is closed. Debugger shows subj, as the failure point. In both cases dataSource for table view is assigned in

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
On Thursday, March 11, 2010 at 10:11 PM Fritz Anderson wrote: 1. You don't say what "fail" means. A crash? What error code? What stack trace? EXC_BAD_ACCESS. Assembler call stack view shows line next to the subj call. OS X 10.5.8 Never tried it in 10.6.X 2. This is all moot, because, as the

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
On Thursday, March 11, 2010 at 10:29 PM Corbin Dunn wrote: Break on objc_exception_throw. Could you explain it? What does it mean? Thanks. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
On 11.03.2010, at 23:25, Corbin Dunn wrote: http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/ I've done what was told there. No difference. I just get EXC_BAD_ACCESS in XCode status line and debugger's call stack list shows: objc_msgSend - [NSTableVie

How to share Cocoa classes?

2009-07-06 Thread Alexander Bokovikov
Hi, All, Maybe it's a dummy question, but I can't find a way to share some ObjC classes with several XCode projects. I've created a set of Cocoa classes (.h and .m files) What I'd like to get is the ability to write something like this: #import I don't want to distribute these classes, as

Subject: Re: How to share Cocoa classes?

2009-07-06 Thread Alexander Bokovikov
Thank you, Jesse, but just a couple of points to clarify: Static library linking with ObjC class, most likely could be done successfully by only adding -ObjC and -all_load to the "Other Linker Flags" in the build configuration. Is this option applicable to library project settings or to a proj

Re: How to share Cocoa classes?

2009-07-06 Thread Alexander Bokovikov
hould I add a path to them to avoid the necessarity to add this path to every new XCode project manually? Thank you. - Original Message - From: "Steve Christensen" To: "Alexander Bokovikov" Cc: Sent: Monday, July 06, 2009 9:30 PM Subject: Re: How to share Cocoa cl

10.4 vs 10.5 SDK - some problems in compilation

2009-07-15 Thread Alexander Bokovikov
Hi, All, I'm rather new in XCode and Cocoa, so maybe it's my misunderstanding. Am I correct in my understanding, that I need to select 10.4 SDK in XCode project menu to create an application, compatible with both Tiger and Leo? I've got few errors in compilation when I choose 10.4 SDK. Some

[IB] - how to delete action or outlet?

2009-07-17 Thread Alexander Bokovikov
Hi, All, I have no idea of how to remove an action or an outlet from AppController object, once added. For example, I've created appropriate modules AppController.h and .m, then wrote necessary code lines to declare an action stub and/or outlet. Then I open IB and drag necessary objects,

Re: [IB] - how to delete action or outlet?

2009-07-17 Thread Alexander Bokovikov
On 18.07.2009, at 11:51, Chase Meadors wrote: IB should sync with it's relative Xcode project if they are both open. Are you actually saving changes to the AppController source files after you edit them? As I wrote, when I opened IB for the first time, "Actions" panel already had "AppC

Re: [IB] - how to delete action or outlet?

2009-07-19 Thread Alexander Bokovikov
On 19.07.2009, at 18:05, Graham Cox wrote: Delete the actions/outlets from the source file, save, and in IB they'll show up with a yellow colour and a 'x' in the list views (right-click on the target object to show the HUD view of the connections). Then clicking the yellow x deletes the ph

How to intercept/reroute API call in loaded plugin?

2009-07-19 Thread Alexander Bokovikov
I'm sorry, if it's offtopic here, then please tell me, what should be correct list. The problem is the next. I'm working on a Cocoa app, playing Flash content from a specially structured files. The problem with SWF playback is (as I believe) is resolved by movie loading from memory rather

Re: [IB] - how to delete action or outlet?

2009-07-19 Thread Alexander Bokovikov
On 19.07.2009, at 19:11, Graham Cox wrote: So, have you tried what I suggested? Right-click on the target object that you've changed *in the main view*. In the HUD window that pops up, look for yellow text with a 'x' button. Click it to delete. This should update what you are seeing in t

Open Recent menu - how to populate it?

2009-07-20 Thread Alexander Bokovikov
Hi, All, I'm writing a simple (in GUI) application, where NSDocument is not used. I use NSOpenPanel to get a file name, then process file and close it. There is no UI, related to file, where NSDocument could help significantly. At least I believe so. My problem is that Recent menu is empt

Re: Open Recent menu - how to populate it?

2009-07-20 Thread Alexander Bokovikov
On 20.07.2009, at 21:47, Graham Cox wrote: ... and use a menu delegate to update the menu from this. This is just what is unclear for me, as I'm still learning Cocoa :) Do you have in mind that I must: 1 - create an outlet, pointing to "Open Recent" menu item 2 - create an outlet, pointing

Re: Open Recent menu - how to populate it?

2009-07-20 Thread Alexander Bokovikov
On 20.07.2009, at 23:13, Ali Ozer wrote: You probably want to call this when you open a doc, or revert, or do "save as..." (if you have any of these commands in your app, of course). Das ist fantastisch... 8-( ) [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:

Re: [IB] - possible bug [was: how to delete action or outlet?]

2009-07-20 Thread Alexander Bokovikov
On 21.07.2009, at 4:07, Kelly Keenan wrote: Have you figured out what is going on here? If not, can you please file a bug and send me the bug number? If possible, it would be really handy to have a very simple project with this same problem. OK, I've found a time to recall what and how I

Re: [IB] - possible bug [was: how to delete action or outlet?]

2009-07-21 Thread Alexander Bokovikov
On 21.07.2009, at 12:20, Graham Cox wrote: Setting the name automatically when you set the class is a convenience, but equally you can change the name to make it clear to you what the object is. The name has no effect on anything. I can agree, but the bug is, that I can't correctly change

Re: [IB] - possible bug [was: how to delete action or outlet?]

2009-07-21 Thread Alexander Bokovikov
On 21.07.2009, at 13:19, Graham Cox wrote: I don't make up controllers as I go along in IB - they always pre- exist in code and I just use IB to, er, build the interface. I'm not against of the above. I can agree with your approach, moreover, it's an approach, described in Cocoa classic boo

NSTableView - populating from C procedure

2009-07-22 Thread Alexander Bokovikov
Hi, All, This is my first attempt to deal with Cocoa container class, so I have some unclear points. I've found one of many tutorials here: http://www.cocoadev.com/index.pl?NSTableViewDataSource where it is said, among other, that NSTableView items may be filled out like this: - (id)tabl

Re: NSTableView - populating from C procedure

2009-07-22 Thread Alexander Bokovikov
On 23.07.2009, at 11:52, Graham Cox wrote: BTW, watch out for a potential buffer overflow in getString(...), this is the sort of thing viruses readily exploit. OK, thanks, though I'd like to ask, if it's not a big offtopic, how viruses can exploit my internal function? I can it understand,

Re: NSTableView - populating from C procedure

2009-07-23 Thread Alexander Bokovikov
On 23.07.2009, at 12:55, Marco S Hyman wrote: On Jul 22, 2009, at 11:38 PM, Graham Cox wrote: My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be pos

NSTableView is not updated on [reloadData]

2009-07-23 Thread Alexander Bokovikov
Hi, All, So, I'm continuing :) I've connected my NSTableView with AppController (in IB) setting AppController, as NSTableView's datasource. Then I've added a couple of methods to the AppController to implement NSTableDataSource protocol: - (int)numberOfRowsInTableView:(NSTableView *)tableVi

Re: closed - NSTableView is not updated on [reloadData]

2009-07-23 Thread Alexander Bokovikov
On 23.07.2009, at 21:25, I. Savant wrote: Is your "myTable" outlet connected to the table view? I'm fool... :( sorry... I was pretty sure it is, but really it isn't. Also I was sure that BAD_ACCESS exception should occur if not initialized outlet is used to send a message to. Fixed it

How to use NSTimer correctly?

2009-07-25 Thread Alexander Bokovikov
Hi, All, In my app I have a timer, created in the awakeFromNib and living until the app terminates. And I have some problem when I close the application. Here are my code snippets: - (void) awakeFromNib { ... processingTimer = YES; timer = [NSTimer scheduledTimerWithTime

Re: How to use NSTimer correctly?

2009-07-25 Thread Alexander Bokovikov
On 25.07.2009, at 18:48, Dave Keck wrote: First off, your object's -dealloc is never going to get called, because NSTimers retain their targets. If so, then where should I "dealloc" everything, I created in the awakeFromNib? I believed that dealloc will be called when my AppController wil

Re: How to use NSTimer correctly?

2009-07-25 Thread Alexander Bokovikov
On 25.07.2009, at 19:56, Scott Ribe wrote: If so, then where should I "dealloc" everything, I created in the awakeFromNib? I believed that dealloc will be called when my AppController will be released. But you say it is never released. Then what should I do? In dealloc, as you do now. But

Re: How to use NSTimer correctly?

2009-07-25 Thread Alexander Bokovikov
On 25.07.2009, at 21:29, Adam R. Maxwell wrote: Your original post said you're trying to do this at quit, but you can't rely on any object being sent -dealloc at application quit time. Do your cleanup in applicationWillTerminate:, either as the app delegate or by registering for the notif

NSButton setImage in runtime : where is template image?

2009-07-26 Thread Alexander Bokovikov
Hi, All, I'm trying to create a simple switch button, showing something like "Show blablabla >" / "< Hide blablabla" depending on the state of "blablabla". I've found that it would be most suitable to use rounded textrured button and change its title, image and image position in the onCli

Re: NSButton setImage in runtime : where is template image?

2009-07-26 Thread Alexander Bokovikov
On 26.07.2009, at 16:31, Brandon Walkin wrote: There's a typo in your image names. Use NSGoLeftTemplate and NSGoRightTemplate ("Go" instead of "Co"). I'm so sorry! I was just blind and used Cmd+C too often... sorry. Thanks. ___ Cocoa-dev mai

NSTableView - strange behaviour after cell text color assignment

2009-07-27 Thread Alexander Bokovikov
Hi, All, I'm trying to color my table's rows depending on some value, returning from a function like this: int GetState(int rowIndex); I've searched around the Net and the only clear way I've found is to set my AppController, as a tableView delegate and respond to the message - (void)tab

Re: NSTableView - strange behaviour after cell text color assignment

2009-07-27 Thread Alexander Bokovikov
Replying to myself: - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; The function above works perfectly, but the problem reason was in the incorrect receiving of the selected r

NSTableView cell editing begin / end notifications?

2009-07-27 Thread Alexander Bokovikov
Hi, All, In my app I have a table, populated by some periodic procedure, working on a timer. At the same time I need to add a cell editing capability. But periodic updating procedure calls [tableView reloadData], which resets the cell editor, if it is active. Therefore I need to stop this

Re: NSTableView cell editing begin / end notifications?

2009-07-28 Thread Alexander Bokovikov
Hi, All, As soon as I have no replies, I will try to reduce my problem scope... As far as I can see now, there are no suitable messages/notifications in standard Cocoa classes, which could serve, as notifiers of the cell editor session start/stop. I've found a code snipped, showing, how to

Re: NSTableView cell editing begin / end notifications?

2009-07-28 Thread Alexander Bokovikov
Hi, All, I'm sorry for flood, it's all is pretty new for me, therefore I do too many mistakes... Here is, what I'm trying to do: - (id) windowWillReturnFieldEditor:(NSWindow *)sender toObject: (id)anObject { MyTitleEditor *ed; if ([anObject isKindOfClass:[NSTextFie

Re: NSTableView cell editing begin / end notifications - solved (?)

2009-07-28 Thread Alexander Bokovikov
Hi, All, To whom is may be interesting: As I wrote initially, my problem is that the table is updated on a timer, so cell editor was cancelled automatically, as the timer fires. First I started to seek for a solution to learn about cell editor appearing / hiding events. And that was very h

Drag&Drop to desktop - file icons layout problem

2009-07-29 Thread Alexander Bokovikov
Hi, All, Maybe it's a stupid question, but I can't find a solution... I'm dragging files from my app to desktop. All goes OK, but file icons are located one exactly above another if I'm dragging many items. As a result, few extra clicks on desktop are required to be able to split these ic

NSURL fileURLWithPath doesn't produce a valid URL

2009-07-30 Thread Alexander Bokovikov
Hi, All, I've found that [NSURL fileURLWithPath] doesn't convert such symbols as "+" into URL-encoded format. It only converts blanks into %20. As a result, such path, as _CS_DARWIN_USER_DIR, will not be converted into a valid URL. Is there any method or function here to produce a valid U

Re: NSURL fileURLWithPath doesn't produce a valid URL

2009-07-31 Thread Alexander Bokovikov
On 31.07.2009, at 11:51, Dave Keck wrote: Check out CFURLCreateStringByAddingPercentEscapes(), and note that CFURL is toll-free bridged with NSURL. Just have tried it. No difference. I've used: surl = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,

Re: NSURL fileURLWithPath doesn't produce a valid URL

2009-07-31 Thread Alexander Bokovikov
On 31.07.2009, at 14:02, Richard Frith-Macdonald wrote: Why do you think that's not a valid URL? It's because another code (Flash plugin) doesn't want to work if I provide a path (as a part of URL), containing "+" characters. At least I don't see other reasons, why the same function work

Re: NSURL fileURLWithPath doesn't produce a valid URL

2009-07-31 Thread Alexander Bokovikov
On 31.07.2009, at 14:57, Dave Keck wrote: I'm confused: NSLog(@"%@", CFURLCreateStringByAddingPercentEscapes(nil, CFSTR("http://www.example.com?a+b & c = d"), nil, CFSTR("+=&"), kCFStringEncodingUTF8)); That doesn't do what you want? I've misunderstood. It was said "do it yourself" in the p

Application Preferences - a general question

2009-07-31 Thread Alexander Bokovikov
Hi, All, Hope this is not an offtopic here... I'm quite new in Mac world, and one of essential differences from Windows, which I've noticed, is how Preferences changes are applied. Unlike to usual Windows GUI, preferences are applied instantly on Mac, i.e. just as user changes a value. The

Re: Application Preferences - a general question

2009-07-31 Thread Alexander Bokovikov
On 31.07.2009, at 23:09, Daniel DeCovnick wrote: Correct in practice, although the principle is more that preferences shouldn't be that onerous to change back to how they were. The lack of needing to click "Apply" helps here too: since each change is reflected instantly, if something goes

How to change focus ring color?

2009-07-31 Thread Alexander Bokovikov
Hi, All, I can't find how I could change the focus ring color, for example, of NSPathControl. The IB only lets me disable it. Is the color defined by the color scheme hardly? Thanks. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: How to change focus ring color?

2009-07-31 Thread Alexander Bokovikov
On 01.08.2009, at 4:42, Joel Norvell wrote: You didn't say what objects you are drawing, so I should add this caveat: I'm not sure what variations, if any, would be induced by generalizing my approach to NSCell objects. OK, maybe I provided not so clear problem description. I have _stan

Re: How to set the name of open-with application for a specific file?

2009-08-01 Thread Alexander Bokovikov
On 31.07.2009, at 21:41, MATSUMOTO Satoshi wrote: I want to do this programmatically. The direct answer to this question is very easy - it's impossible. Why? Take a look here: http://developer.apple.com/technotes/tn/tn2017.html#Section3 Nevertheless, if I understand it correctly, you ne

Re: How to change focus ring color?

2009-08-01 Thread Alexander Bokovikov
On 02.08.2009, at 0:14, Joel Norvell wrote: If your object is always the First Responder, that would account for its focus ring always being redrawn. As I've tested it with the code samples from your links, it's NOT the first resonder. I don't see any drawings if I surround the drawing

[IB] - can't assign keyboard shortcut to a menu item

2009-08-03 Thread Alexander Bokovikov
Hi, All, It's my first attempt to assign a popup menu to a view, so perhaps my question is stupid, but I can't find an explanation in the Apple's docs... The "Key Equiv." field is grayed, and don't see any obvious solution to activate it. I've created a menu, associated it with a view, as

Re: [IB] - can't assign keyboard shortcut to a menu item

2009-08-03 Thread Alexander Bokovikov
On 03.08.2009, at 15:56, Graham Cox wrote: ... because the point of contextual menus is that they have a context (the click location) which activating them from the keyboard doesn't provide. OK, nothing to do here, but notice, that Dad Bill (unlike to Dad Steve) :) uses another approach

Re: [IB] - can't assign keyboard shortcut to a menu item

2009-08-03 Thread Alexander Bokovikov
On 03.08.2009, at 17:45, Graham Cox wrote: the view may have many objects any of which could be the menu's target - only the click location can tell you which one, Can't agree. If we setup a control, as capable to have keyboard focus, then, activating this control, we activate all hierarch

NSPathControl - popup panel doesn't work

2009-08-03 Thread Alexander Bokovikov
Hi, All, I can't understand why, but target path is not changed when I click on NSPathControl's popup panel. The control shows the same path, as was chosen earlier. I can click "Choose..." item and NSOpenPanel will appear, where I can choose a new directory, and these changes will be save

Re: [IB] - can't assign keyboard shortcut to a menu item

2009-08-03 Thread Alexander Bokovikov
On 03.08.2009, at 19:00, Graham Cox wrote: There's much more to life than controls. Completely agree. But I don't like to say that _every_ popup menu _must_ have keyboard shortcuts. I'd just like to say, that it would be good to give such possibility to the coder. But back to your quest

Re: [IB] - can't assign keyboard shortcut to a menu item

2009-08-03 Thread Alexander Bokovikov
On 03.08.2009, at 20:58, Alastair Houghton wrote: If the options in question are useful enough to merit a keyboard shortcut, then they're useful enough to appear in the application's main menu hierarchy. If not, then they aren't. I'm sorry, but as I can see now, main menu shortcuts are al

Re: [IB] - can't assign keyboard shortcut to a menu item

2009-08-03 Thread Alexander Bokovikov
On 04.08.2009, at 6:56, Graham Cox wrote: On 04/08/2009, at 3:52 AM, Alexander Bokovikov wrote: I'm sorry, but as I can see now, main menu shortcuts are also gray... I can delete them but I can't assign them. Why? I've created controller actions and have connected action

Re: [IB] - can't assign keyboard shortcut to a menu item - closed

2009-08-04 Thread Alexander Bokovikov
On 04.08.2009, at 12:43, Graham Cox wrote: The shortcut item always does look grey however - you have to select it and type the desired shortcut - it's not a normal text field. Understood! My thumbdown to whom designed that screen... Probably I could yet find a way how to do it if I would

  1   2   >