Send Cocoa-dev mailing list submissions to
email@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.apple.com/mailman/listinfo/cocoa-dev
or, via email, send a message with subject or body 'help' to
email@hidden
You can reach the person managing the list at
email@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cocoa-dev digest..."
Today's Topics:
1. Lame problem with NSImageView (Michael Heinz)
2. Re: Updating /etc/hostconfig (Dan Bernstein)
3. -[NSTextView setString:] causing app to lock up (Kevin Ballard)
4. Re: Internationalization: How to bring the locale in line
with the language? (Uli Zappe)
5. Re: observing a controller for changes (Theodore Petrosky)
6. Re: observing a controller for changes (Theodore Petrosky)
7. Custom alpha for standard window? (Tim Conkling)
8. Seattle Xcoder's, next meeting (George Lawrence Storm)
9. How to associate a view with Color Panel (Fei Li)
10. Sheets and hidden apps (John Stiles)
11. Re: Internationalization: How to bring the locale in line
with the language? (Jonathon Mah)
----------------------------------------------------------------------
Message: 1
Date: Wed, 03 Nov 2004 09:21:27 -0500
From: Michael Heinz <email@hidden>
Subject: Lame problem with NSImageView
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1
So, I was trying to knock out a little image viewer today to
re-familiarize myself with Cocoa and Objective C, but I 've gotten
stuck with an odd behaviour with NSImageView.
I'm taking the default settings for NSImageView, including
proportional scaling but some images not only do not scale to fill the
window they are getting rendered at only a few percent of their "real"
size - even if I go and modify the NIB so that NSImageView is set to
not scale at all. The images seem to behave appropriately in Preview.
Any suggestions on what to look for? Also - how do I manually change
the scale of the image the way Preview can?
Thanks in advance!
------------------------------
Message: 2
Date: Wed, 3 Nov 2004 16:47:22 +0200
From: Dan Bernstein <email@hidden>
Subject: Re: Updating /etc/hostconfig
To: Nicko van Someren <email@hidden>
Cc: Cocoa Dev <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII
I think it's better not to use /etc/hostconfig at all. It's not meant
to be used by third-party software and it may even disappear
eventually. Instead, you can use your own appropriately-named settings
file in /etc or in /Library/Preferences ((if the file doesn't exists,
simply assume your service shouldn't be started).
-- Dan
On Thu, 28 Oct 2004 00:38:55 +0100, Nicko van Someren
<email@hidden> wrote:
Does anyone on this list know if there is a proscribed way for
updating
the /etc/hostconfig file?
I'm building a service that will be run from a script in
/Library/StartupItems and it seems that most items here use a setting
in the hostconfig file to determine if they should start. The
comments
in the hostconfig file say that the "file is maintained by the system
control panels" and I plan to add and update my entry there from a
preference pane. What I'm concerned with is the problem of multiple
accesses to the file at the same time.
I know I can use writeToFile:atomically: on a string to write the data
out to the file but the problem I foresee is that there will be a
delay
between reading the contents of the file and writing it back. If
someone else writes changes to the file in between my program's read
and write then those changes can be lost. So my real question is do
other panels that edit this file worry about the issue and if so what
do they do to lock the file from multiple accesses?
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
------------------------------
Message: 3
Date: Wed, 3 Nov 2004 10:23:28 -0500
From: Kevin Ballard <email@hidden>
Subject: -[NSTextView setString:] causing app to lock up
To: Cocoa-Dev Development <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"
I'm seeing a really weird behaviour in my simple app. The app is a
quick test for a new NSURLProtocol subclass I wrote and it consists of
a 1-line text field, a button, a spinning wheel progress indicator, and
a larger NSTextView. The 1-line field is for URL entry and it's bound
to an ivar of my controller. The button runs -query: on my controller.
-query: starts my progress indicator, creates an NSURLRequest for the
URL and runs an NSURLConnection with that request and itself as the
delegate. In the data callback it appends the data to a pre-initialized
mutable data ivar. In the finished loading callback it creates a string
out of that data and displays it in the field.
My problem is when it's displaying this string the main thread locks
up. From sampling the app it appears to be stuck on NSViewHierarchy
lockForWriting or something like that in response to the text view
trying to resize itself to fit the new contents.
If I write a much shorter string out it doesn't lock. Alternately, if I
disable the progress indicator (i.e. don't start the animation) and
write out the long string it doesn't lock up. If I disable the progress
indicator and move the -setString: to my data call (to try to show the
data as it comes in) then it locks up on the second or third data
callback.
Does anybody have any idea what's going on? I *am* doing this in the
main thread. And because it's locking up my main thread in response to
a simple -setString: I'm inclined to thing this is a bug in AppKit.
Does anybody have any more information before I use an incident on
this?
--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2378 bytes
Desc: not available
Url :
http://lists.apple.com/mailman/private/cocoa-dev/attachments/20041103/
0bb5cde9/smime.bin
------------------------------
Message: 4
Date: Wed, 3 Nov 2004 16:45:29 +0100
From: Uli Zappe <email@hidden>
Subject: Re: Internationalization: How to bring the locale in line
with the language?
To: Nick Zitzmann <email@hidden>
Cc: Cocoa Developer List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Am 03.11.2004 um 16:37 schrieb Nick Zitzmann:
So is there no way to bring the locale in line with the language in
time?
Did you try changing the default before NSApplicationMain() was
called?
No, but there I would have a hard time finding out what the used
language will be. I don't want to hardcode the locale (then I could
obviously simply not use localized methods in my app), but bring it in
line with the language the app actually uses depending on the user's
preferences and the available localized NIB files.
Bye
Uli
________________________________________________________
Uli Zappe, Solmsstraße 5, D-65189 Wiesbaden, Germany
http://www.ritual.org
Fon: +49-700-ULIZAPPE
Fax: +49-700-ZAPPEFAX
________________________________________________________
------------------------------
Message: 5
Date: Wed, 3 Nov 2004 08:22:10 -0800 (PST)
From: Theodore Petrosky <email@hidden>
Subject: Re: observing a controller for changes
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii
I went through the examples in the Hillegass book and
at first they looked promissing. But then I see it is
not what I need.
I have a tableView with some simple 'text' columns and
popups. I need to know when something changes even if
the user doesn't press the return or change rows. This
was easy for the popups. I just connected them to an
action. But the 'normal' column is causing me
problems. When the user clicks in a row and types I
cannot seem to get a 'textDidChange' type message.
WIth the Hillegass example I am able to see the change
after the user commits it.
Do you see what I am looking for? I need to know the
moment that the user types anything in the tableView.
I will worry about what the arrayController has later.
Ted
From my studies on 'Cocoa programming for Mac OS X'
from Aaron
Hillegass I recall that there was something similar
near the beginning
of the book.
Go here and type in page 115.
http://www.bignerdranch.com/books/index.php
Further on down the page there is the source code for
RaiseMan (with
table view). I hope this might help.
Regards,
Ole.
I have a tableView with an arraycontroller.
Basically
I query a database for stuff, create the
NSMutableArray and set the content of the tableView
controller to the array. Works great.
I am stumped to know how to observe if the user
makes
any changes to the table. I was checking
http://homepage.mac.com/mmalc... if there was
anything
there..
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
------------------------------
Message: 6
Date: Wed, 3 Nov 2004 09:24:20 -0800 (PST)
From: Theodore Petrosky <email@hidden>
Subject: Re: observing a controller for changes
To: ScottAnguish <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii
I knew I saw something like that.... Thank a million
for the reminder..
Ted
--- ScottAnguish <email@hidden> wrote:
you need to turn on continuously updates
On Nov 3, 2004, at 8:22 AM, Theodore Petrosky wrote:
Do you see what I am looking for? I need to know
the
moment that the user types anything in the
tableView.
I will worry about what the arrayController has
later.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
------------------------------
Message: 7
Date: Wed, 3 Nov 2004 14:02:06 -0500
From: Tim Conkling <email@hidden>
Subject: Custom alpha for standard window?
To: cocoa-dev <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
I'm interested in applying a custom alpha channel to a standard window.
I know that it's possible to call setAlphaValue: to set the a single
alpha value for the whole window, but I'm interested in modifying the
alpha on a per-pixel basis. Is this possible without creating a custom
window shape?
Thanks,
Tim
------------------------------
Message: 8
Date: Wed, 3 Nov 2004 10:51:34 -0800
From: George Lawrence Storm <email@hidden>
Subject: Seattle Xcoder's, next meeting
To: Xcoder'email@hidden
Cc: George Lawrence Storm <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
The next meeting of the Seattle, Xcoder's, programming / Cocoa /
technical special interest group will be held at:
The University Village Apple Store (Seattle).
Tuesday, 09 November 2004, starting at 6:30 PM
The next meeting will focus on Cocoa Bindings.
Bring your laptop, we will run through one of the binding demo's during
the meeting.
-----
The Seattle Xcoder's, is a newly formed Macintosh programmers special
interest group.
We meet weekly, on Tuesday evenings for the purpose of exchanging
information and ideas related to programming on the Macintosh OSX
computer platform.
Our focus will be on Cocoa, however we will be starting with the basics
and will devote a fair amount of time to other core technologies, with
occasional excursions to other lands of interest such as UNIX, Linux,
Pearl and acronyms too numerous to mention.
We are in our infancy so the exact nature of our meetings and their
content will be in flux for some time to come.
You are invited to share your ideas on how we can best serve your needs
and have a bit of fun while doing it at the same time.
Please visit <http://groups.yahoo.com/group/xcoder/> to find out more.
-----
George Lawrence Storm
Macintosh Applications Development
Snohomish (Seattle), Washington
------------------------------
Message: 9
Date: Wed, 3 Nov 2004 11:51:42 -0700
From: Fei Li <email@hidden>
Subject: How to associate a view with Color Panel
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
Hello all,
I know these are simple questions but I really can't figure it out.
I opened a NSColorPanel by click on a normal button. I have a customer
view to show a sample line in it. I hope it's drew in the color picked
in the color panel. I know the changeColor function can do this but I
don't know how to connect it to the color panel, even I set
[[NSColorPanel sharedColorPanel] setDelegate:self] in that customer
view, it still doesn't work.
Another problem is I can't close the color panel. I click on the red
button on the color panel, nothing happened, the color panel doesn't go
away. I guess I must miss something.
Thanks for any information to help me out!
Fei
------------------------------
Message: 10
Date: Wed, 3 Nov 2004 11:33:10 -0800
From: John Stiles <email@hidden>
Subject: Sheets and hidden apps
To: "email@hidden Dev" <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
My installer app has a sheet that shows progress. It drops down, my app
does its work while the progress bar fills up, and then when my app is
done it rolls up the sheet.
I've had some end users report that they'll start an installation, hide
my application (via cmd+H), come back to it later and the install has
completed 100%, but the sheet is still there. I know that my app has
asked to hide the sheet because the parent window behind the sheet has
been updated :) It works fine if you don't hide the app.
Here's the code in question. Why is this happening? It's occurring in
10.3.5.
PS yes, the variable naming conventions suck a bit; if I redid it today
they'd be named differently. Whatever. :)
void InstallerShowProgress()
{
[s_installer performSelectorOnMainThread:@selector(progressSheetShow:)
withObject:NULL waitUntilDone:YES];
}
void InstallerHideProgress()
{
[s_installer performSelectorOnMainThread:@selector(progressSheetHide:)
withObject:NULL waitUntilDone:YES];
}
- (void) progressSheetShow:(id)object
{
[_window makeKeyAndOrderFront:self]; // sheets act
goofy if the parent is minimized
[_progressSheetBar setDoubleValue:0.0];
[_progressSheetStopButton setEnabled:YES];
[NSApp beginSheet:_progressSheet
modalForWindow:_window
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];
}
- (void) progressSheetHide:(id)object
{
[NSApp endSheet:_progressSheet returnCode:0];
[_progressSheet orderOut:self];
}
------------------------------
Message: 11
Date: Thu, 4 Nov 2004 06:22:53 +1030
From: Jonathon Mah <email@hidden>
Subject: Re: Internationalization: How to bring the locale in line
with the language?
To: Uli Zappe <email@hidden>
Cc: Cocoa Developer List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=WINDOWS-1252; format=flowed
On 4 Nov 2004, at 02:15, Uli Zappe wrote:
So is there no way to bring the locale in line with the language in
time?
Did you try changing the default before NSApplicationMain() was
called?
No, but there I would have a hard time finding out what the used
language will be. I don't want to hardcode the locale (then I could
obviously simply not use localized methods in my app), but bring it in
line with the language the app actually uses depending on the user's
preferences and the available localized NIB files.
You could put each locale in the localized .strings file, and then set
the setting to whatever NSLocalizedString() returns. That way, it'd be
in English if it were using English strings, etc.
(I'm assuming that the application is set-up enough to use
NSLocalizedString() before NSApplicationMain() is called I haven't
tried that yet.)
Jonathon Mah
email@hidden
------------------------------
_______________________________________________
Cocoa-dev mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/cocoa-dev
End of Cocoa-dev Digest, Vol 1, Issue 225
*****************************************