Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

Archive for February, 2011

NSBezierPath and other Cocoa options

Hi, I’m trying to learn some basic ways of making your own graphics
views and though I see one way of completing this first mini-project,
I’m wondering if people have any alternate ideas for solutions as mine
seems both memory and CPU intensive. Basically I want a panel of a
fixed width and height that displays values such that  a new value is
added on the the right of the current values and if there are more
values the pixel width on the panel, the lefthand value is removed and
every value is adjusted to the left one value. My plan is to have each
value represented by a black pixel and the background would be white,
I want no anti-aliasing and the values aren’t meant to look
   As I see it the two most ideal solutions for the "move everything
left" part would be to either be able to move all the retained
graphics left one pixel and at the right "uncovered" pixel, cover it
with the new value, or else do something similar, only with the
numeric array that the values are based on (I don’t care to retain any
data besides for its usefulness in this functionality). Perhaps I
could make the subclass of NSView 1 pixel wider than as shown in the
ScrollView (or ClipView?) and each time a new value is added, scroll
left one pixel and…(??) remove that pixel and add the width back to
the right side of the NSView subclass? Hmm… It seems to me, also,
the NSBezierPath isn’t really the type of object that I should use for
this type of graphics. I don’t want the leftmost pixel to connect to
the rightmost (this isn’t a polygon) and I don’t even want the black
dots to look like they’re supposed to be a line or a path – they’re
representative of distinct, noncontiguous values. However, I see no
other options in the Cocoa libraries for how to draw to a subclass of
NSView besides using one or many NSBezierPaths (I’m of course, not
claiming they aren’t there but I can’t find them in Apple’s docs).
Even if I have to blank out the NSView and go through a for loop and
say drawPixel(currentXValue, myValueArray[y]), as long as it isn’t too
CPU intensive, doesn’t have tremendous lag (some is fine), doesn’t
have antialiasing or look contiguous I’d be happy. It’s seems to me
that there must be other people around who just want to paint dots at
specific, distinct and noncontiguous points in their Cocoa code, so
what do they do?


p.s. I make the disclaimer that this post may be caused by me missing
a simple or easy to find solution but given the late hour I’ve done my
best for tonight.

posted by admin in Uncategorized and have Comments (2)


I’m trying to assemble some large files which have been automatically
converted from M68k assembler (not Mac) to PPC. PPCAsm keeps giving me an
error as follows:

### Error 3090 ### Directive ‘l200vv’ not recognized

The manual implies that labels may or may not be followed by a colon ‘:’ –
the error goes away if I include it. Is there some way of preventing the
assembler of complaining? I’m running under MPW


Graham Thwaites

posted by admin in Uncategorized and have No Comments

Are FSRef's serializable?

Does anyone know if FSRef’s are serializable in the Java sense?
Or is there a better way to save a file descriptor to a preferences
file and retrieve it later (an alias, a full path, an FSSpec,…) ?

uncle seb.

posted by admin in Uncategorized and have Comment (1)

[Learning Cocoa] Drawing Question


I’ve been playing around with the DotView project from Chapter 8 of
‘Learning Cocoa’ ( ).
It didn’t take long to figure out how to manipulate almost everything in the
program, but I can’t figure out how to do one thing.

How do you save the graphic state of the Custom view so that it will only
update the most recent dot.


posted by admin in Uncategorized and have Comment (1)

macosx textfield error


On macosx I have an applet running on Internet explorer wherein I input
the username and password on a simple textfield(AWT).
The problem is that when I type in a username some foreign characters
seem to get
printed along with it so when I get the login and password from the
frontend I get errors.
eg. when I type in username "test1"
I get "t*est1^^"
where * and ^^ are actually weird characters.

Have any of you faced this problem ?
Can you please suggest a solution.


posted by admin in Uncategorized and have No Comments

Turning on File Sharing from Carbon App


Is there a way of turning File Sharing on/off from a Carbon app?
ServerDispatchSync() doesn’t appear to be supported, so is there
another way?

While opening the File Sharing control panel is one possibility, I’d
like to give the user the option of automating the process.

Many thanks,
Mike Whooley.

posted by admin in Uncategorized and have No Comments

O'Reilly Carbon book


Does anyone have the O’Reilly Carbon book.  Does  it show you anything that’s
not in Apple’s Carbon documentation?  


posted by admin in Uncategorized and have Comment (1)

Freeware Beta Test – Help – Mac Tablet (Classic Note Pad Alternative for OS X)

I don’t know about you guys, but I love the classic Note Pad. I don’t
like stickies at all. When I looked around the web for OS X Note Pad
alternatives all I found was over complicated ones which was persisly
what I was looking to avoid. So, I made my own version of Note Pad for
OS X. Then I realized other people might feel the same as me. I am
planning to release it as freeware and I was wondering if anyone could
help me.

Could some people running OS X please beta test it for me and email me
some comments?



posted by admin in Uncategorized and have Comments (3)

comparing two volumes

What is an effective way of comparing two volumes to see if they are the
According to PBXGetvolInfo and FSGetvolumeInfo, the creation date could
be zero if unknown.
What is another way of finding out?
The volumes are not necessarily local and not necessarily HFS/HFS+.

posted by admin in Uncategorized and have Comment (1)

http with OpenTransport


Does anybody know where I can get SourceCode for activating a php script?
I simply want to transmit an address (e.g. to a http server. I don’t want to use
the URLAccessManager because I write the program for older system
All the samples Apple is offering are written with the new OS9/X routines.


posted by admin in Uncategorized and have Comment (1)