Re: packagemaker script assistance needed.



In article <santa-54DC30.18021830042007@xxxxxxxxxxxxxxxxx>,
Santa Claus <santa@xxxxxxxxxxxxx> wrote:

In article <uce-E88B36.20205829042007@xxxxxxxxxxxxxxxxxxxxxxxx>,
Gregory Weston <uce@xxxxxxxxxx> wrote:

In article <santa-5D8401.18025529042007@xxxxxxxxxxxxxxxxx>,
Santa Claus <santa@xxxxxxxxxxxxx> wrote:
10.3.x doesn't have proper looking graphics for pushbuttons if you
superimpose an image onto it.

Huh?

#if BuildForOSX == 4
thesun = [[NSButton alloc] init];
[thesun setButtonType: NSRadioButton];
...
#endif

#if BuildForOSX < 4
thesun = [[NSButton alloc] init];
[thesun setButtonType: NSMomentaryPushInButton];
...
#endif
note the button types, it has to be the different type of button in
order for it to display the image in 10.2 and 10.3 systems. the
NSRadioButton looks much better.

You've #if'd 9 lines of code twice, of which only one actually differs.
Is there a reason you're conditionalizing the whole block instead of one
line? For that matter, is there a reason you're generating a whole
separate build for something that can be determined at runtime in a
single build?

(Then again, is there a reason you're coding the UI at runtime at all?
I'm not implying that there never is a reason - I do it myself in one
app - but why have _you_ rejected NIBs in this case?)

10.4.x has everything perfect.

the intel version is compiled for 10.4 universal (which lacks some of
10.4.x looks and gives warnings for various characters in strings @""
such as bullets)

Why does your Universal version behave differently from your PPC-only
version?

one of the questions i've been asking ever since i started working with
universal. drop a bullet in the string (option-shift-8) and see for
yourself.

NSStrings are unicode. Opt-Shift-8 generates a MacRoman character. For a
bullet you should use unichar 0x2022. (I believe embedding \u2022 in the
string will do as you want.) Worst case, you can use
initWithCString:encoding: to create a string and specify the MacRoman
encoding. But it really shouldn't come to that.

Let me rephrase the question: Is there a difference in behavior between
the PPC-only build and the Universal build running on a PPC? If so,
which one's preferable? And if the non-universal behavior is preferable,
why not make use of that #if directive to make the universal build on
PPC act like the PPC build?

as a side note, is there anybody out there that would explain to me how
to turn on the executable flag of a file

man chmod

i meant from within objective-c

Ah, you didn't say. I thought you were looking to have a script packaged
in your installer be executable.
NSFileManager>>changeFileAttributes:atPath: should do what you want, but
you'll have to verify or ensure that you've got appropriate privileges.

or better yet, have it execute
unzip and wait until it's completed as if it was double-clicked from the
finder?

something simple such as:
[self executeScript: [NSString stringByExpandingTildeInPath:
@"~/Documents/Simutronics/Plugins/YASSE.expander/Contents/Resources/scrip
tname"]];

Check the documentation for NSTask. It's simple. Downright trivial if
you don't care about catching the output.

this may be the best solution to my future updating problems, having
them download a zip file and have the script unzip it.

Or just find a way to pare yourself down to a single build that modifies
its behavior at runtime.
.


Quantcast