What's GetItem?

What's GetItem?

Post by Christopher Higgi » Sat, 24 Jun 1995 04:00:00



Just recently started with MW, and don't yet know much about
Mac programming either.  I had some code around though and tried
to compile it.  Problems though. After much pfaffing about I get
it down to this:
void main(void)
{
        char *s = GetItem();
Quote:}

which expects a `,' at the closing parenthesis. So what's special
about GetItem? (getitem is the same but Getitem, getITem are ok).
Rather amusing getting a syntax error because of spelling.  Who
can enlighten me?

chris
(PS MW C or C++ for 68K)

 
 
 

What's GetItem?

Post by Van C. Bagn » Sat, 24 Jun 1995 04:00:00



: Just recently started with MW, and don't yet know much about
: Mac programming either.  I had some code around though and tried
: to compile it.  Problems though. After much pfaffing about I get
: it down to this:
: void main(void)
: {
:       char *s = GetItem();
: }
: which expects a `,' at the closing parenthesis. So what's special
: about GetItem? (getitem is the same but Getitem, getITem are ok).
: Rather amusing getting a syntax error because of spelling.  Who
: can enlighten me?

GetItem() is a Toolbox function (subroutine actually) that gets the
textname of a specified menu item. Its full prototype is:

    pascal void GetItem(MenuHandle menu, short itemNum, Str255 *itemString);

Its definition is predefined in MacHeaders, a file which is by
default pre-included in your project. Your function's name is
colliding with the Toolbox one. Go to Preferences and take out
MacHeaders or rename your function.

getitem() is the C equivalent of GetItem() which was a leftover
from MPW (Macintosh Programmers Workshop) where Pascal strings
were converted automatically into C strings when the lowercase
version of the function was called. As you already have learned,
C identifiers are case sensitive.

Van
--

Hawksbill Capital Management - Santa Rosa, CA / (707) 575-7077
"Parang lumalakad ako sa loob ng panaginip" / Teatro ng Tanan / Windsurfing

 
 
 

What's GetItem?

Post by Mark William » Sun, 25 Jun 1995 04:00:00



> Just recently started with MW, and don't yet know much about
> Mac programming either.  I had some code around though and tried
> to compile it.  Problems though. After much pfaffing about I get
> it down to this:
> void main(void)
> {
>    char *s = GetItem();
> }
> which expects a `,' at the closing parenthesis. So what's special
> about GetItem? (getitem is the same but Getitem, getITem are ok).
> Rather amusing getting a syntax error because of spelling.  Who
> can enlighten me?

> chris
> (PS MW C or C++ for 68K)

GetItem is an obsolete name for GetMenuItemText. There is an OLDROUTINENAMES option in the headers,
and if its defined, then GetItem will be defined (rather stupidly) as

#define GetItem(a,b,c)  GetMenuItemText(a,b,c)

Making it impossible to use the name GetItem for any other purpose.

In the latest headers (with CW6) OLDROUTINENAMES defaults to false. If you are still using CW5, make
your own precompiled headers and #define OLDROUTINENAMES 0 at the beginning.

----------------------------------------

 
 
 

1. What is purpose of 'LPane::MouseEnter', 'LPane::MouseLeave', 'LPane::MouseWithin'?

Hi!

I needed mouse tracking in my pane.
I found 'LPane::AdjustCursor', 'LPane::MouseEnter', 'LPane::'MouseLeave',
'LPane::MouseWithin'.
I knew that 'LPane::AdjustCursorSelf' is chainging my cursor when my
cursor is move in pane.
I insert 'MouseEnter', MouseLeave', 'MouseWithin' to my code.

I wrote my code for testing...
void CDong::MouseWithin(...)
{
   ::SysBeep(9);
My purpose is that my application recognize mouse cursor moving during
mouse cursor is in my pane.
And, another purpose is that I wanna drawing line, circle, rectangle using
mouse dragging in my pane.
So, I needed recognizing mouse move and dragging.

I move to mouse cursor in my pane.
My cursor was changed, but Beep sound is not occurred.
My system is very quiet.

What is purpose of MouseEnter, MouseLeave, MouseWithin?
Do this must use with LPeriodical?

How can I recognize my mouse moving in my pane?
And. How can I do mouse dragging in my pane?

Let me know please...

2. InterStream MPEG Player v2.0

3. 'template' and 'pascal' don't mix

4. Using HP DW560 C (Mac model) on a PC

5. Rez:ing 'CCI ' and 'TEXT' resources

6. C-shell with file-expansion on dos?

7. 'RemoveConsole' referenced from '_exit' is undefined.

8. Full drive on IBM server ?

9. How do I coerce 'StringHandle' to a 'Str255'?

10. "undefined identifier 'memset'..." 'Error & Warnings' Message.

11. string bug: string += '?' appends '\?'

12. 68K 'long' is really 'short'??

13. '_foo' 16-bit code reference to '_bar' is out of range