Re: packagemaker script assistance needed.



In article <uce-A654D7.21154430042007@xxxxxxxxxxxxxxxxxxxxxxxx>,
Gregory Weston <uce@xxxxxxxxxx> wrote:

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?

I gave up on doing runtime checking ever since Apple discontinued work
on the gestalt manager in the move from os 9 to os x. gestalt was the
best thing, you could compile once and check at runtime. why they
deleted it is beyond me to understand. i JUST did a search for gestalt
and it only came up with 68k through os9 interfaces and that only for
keyboard, menus, and displays.


(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?)

1) the images can change in the blink of an eye (example: daytime sky
shows the sun, nighttime sky shows a starry field, same button, same
action. the timer checks to see if the sun went down or came up and
acts accordingly)

2) simply put, I never learned to use nibs, the programming interface
seems to do most of what I want to do IF I learn how, probably part of
the reason my program source code is so long.

on another aspect, I hear folks telling me that source code files should
be 500 lines or less long. my script engine source code is over 8,000
lines long and that's just the engine core with no user interface, no
conditional compiles, no duplicated code.

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/scri
p
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.

can't pare down to a single build. 10.2.8 doesn't have certain things
and if i compile to anything higher, the code is unexecutable by 10.2.8
users. (gcc 4.0 always links a certain library no matter what)
.