HDTenEightyP/NetNews huggingface dataset:
From: rwoostru@cs.ruu.nl (Rene van Oostrum)
Subject: Q: Popup menu in modal dialog (please help!)
Date: Fri, 9 Oct 1992 09:36:38 GMT
Organization: Utrecht University, Dept. of Computer Science
Keywords: NewControl, popupMenuCDEFProc, ModalDialog


I am a beginning Mac programmer, trying to implement popup menus in a 
modal dialog. According to Inside Macintosh VI, pg 3-16 trough 3-19, this 
shouldn't be that difficult: in NewControl, just specify popupMenuCDEFProc 
as the procID parameter (which Think C renamed popupMenuProc). Almost 
everything works fine: the dialog appears on the screen, the popupmenu is
visible but: when I click it, it doesn't popup, nor responds in any other 
way. I thought ModalDialog was supposed to do all the control tracking for
me. Am I wrong on this, and should I specify a filterProc (see IM I, 
pg 415)? If so, could someone provide some sample code? I tried it myself,
but the app crashed.

Maybe I did something else wrong; here is what I did:


void TestDialog()
{
  DialogPtr      myDialog;
  short          ItemHit = 0;
  short          ItemType;
  Handle         Item;
  Rect           ItemRect;
  ControlHandle  myControl;

  /********************************************************/
  /*  I provided DLOG and DITL resources with ID 128:     */
  /*    item 1 -> OK Button                               */
  /*    item 2 -> Cancel Button                           */
  /*    item 3 -> userItem (for outlining the OK Button)  */
  /********************************************************/
  myDialog = GetNewDialog(128, 0L, (WindowPtr)-1L);
  ItemRect.top = 20;    /* set up the Rect for the popup menu */
  ItemRect.left = 20;
  ItemRect.bottom = 40;
  ItemRect.right = 250;
  /* I also provided a MENU resource with resource ID and MenuID 1000 */
  myControl = NewControl(myDialog, &ItemRect, "\pTitle:", 1, 
	      popupTitleLeftJust,1000, StringWidth("\pTitle") + 10,
	      popupMenuProc, 0);

  /* Some lines of code to outline the default button */
  GetDItem(myDialog, 3, &ItemType, &Item, &ItemRect);
  SetDItem(myDialog, 3, ItemType, OutlineDefault, &ItemRect);
  
  ShowWindow(myDialog);
  while (ItemHit = 0) ModalDialog(0L, &ItemHit);
  DisposDialog(myDialog);
}

The OK and Cancel buttons work just fine, it's just the popup menu that
doesn't do anything. A minor problem is that it doesn't make any difference
if I provide popupTitleRightJust or popupTitleCenterJust instead of
popupTitleLeftJust: it all looks the same.

For your information: Mac LC, 4MB Ram, System 7, Think C 5.0

Thanks in advance
Rene
-- 
Rene van Oostrum,            | Email: rwoostru@praxis.cs.ruu.nl
Dept. of Computer Science,   | Home:  Oudwijkerdwarsstraat 67
Utrecht University,          |        3581 LB  Utrecht
The Netherlands              |        The Netherlands
From: udmorrow@mcs.drexel.edu (Daniel Morrow)
Newsgroups: comp.sys.mac.programmer
Subject: problem with my dialog filter
Date: 7 Oct 92 16:48:27 GMT
Distribution: usa
Organization: Drexel University

Basically, all I'm doing is checking an edit text field in my
dialog to see if there is anything in it. If not I dim out the
OK button, if so, the OK button becomes active again.

Anyway, this part works. The part that doesn't work is checking
for carriage returns when the OK button is enabled.

I do the following in my filter now:
	Set itemHit to the id of the OK button
	Set event.what to mouseDown.
	Set event.where to a point inside the OK button
	and I do call LocalToGlobal on that point.
	And lastly I set MyFilter to FALSE so ModalDialog knows
	to handle the event.

Am I missing something here?

Please help.

Thanks.
-Dan.
udmorrow@mcs.drexel.edu
Newsgroups: comp.sys.mac.programmer
From: Andreas Wuertz <wuertz@tik.ethz.ch>
Subject: Re: Q: Deep dark MDEF menu manager debugging...
Organization: Federal Institute of Technology
X-Useragent: Nuntius v1.1
Date: Wed, 7 Oct 1992 09:36:54 GMT

In article <1992Oct3.225602.5419@leland.Stanford.EDU> Ramon M. Felciano,
felciano@summit.stanford.edu writes:
>o  If I comment out a big block of code in the middle of my DrawOneItem
>   routine, >>it works<<! It seems like the DrawString(pItemString^) is
>   having a hard time dereferencing so far back! Does this make sense?

I had problems with DrawString in an LDEF. DrawString seems to use some
type of global variable, which you're not allowed to in xDEFs. Try
replacing with DrawChar.

Andy (wuertz@tik.ethz.ch)

========================================================================
The only person who got all his work done by Friday was Robinson Crusoe.
========================================================================
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Best way to get A5 into VBLTaskProc?
Organization: Kalamazoo College
Date: Thu, 15 Oct 1992 21:11:47 GMT

mhall@abc.comp.sys.mac.programmer (Matthew Hall) writes:
>However, that the address of the task is stored in A0 is not
>documented in any IM that I can find.  If it isn't documented, isn't
>it about as safe as self modifying code? (...it explicitly says in IMVI
>that for slot tasks you may need to use self modifying code)

It _does_!?  Tsk, tsk, tsk.

To quote from a comment in TN 180 ("Multifinder Miscellanea"), p. 5:

"GetVBLRec() returns the address of the VBLRec associated with our VBL
task.  This works because on entry into the VBL task, A0 points to the
theVBLTask field in the VBLRec record, which is the first field in the
record and that is the address we return.  Note that this method works
whether the VBLRec is allocated globally, in the heap...or...on the
stack.  ...  This trick allows us to get to the saved A5, but it could
also be used to get to anything we wanted to store in the record."

Safety in numbers, as someone else pointed out--if Apple changes this
little feature, hundreds of apps that trusted this Tech Note will die
horrible deaths.  Apple won't want that to happen any more than you
will.

(And self-modifying code is never a good idea unless every cycle counts,
and that's not the case here.  I imagine the PowerPC will write-protect
code segments and--who knows?--may compile 680x0 code into its native
language and cache it, in which case self-modifying programs will be
very unhappy.)
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 I suppose ya don't think I was run over by a streetcar!
Newsgroups: comp.sys.mac.programmer
From: stevej@ais.org (Steve Jovanovic)
Subject: BETA TESTERS NEEDED for TopSoft's TSMenus Library
Followup-To: stevej@umcc.ais.org
Summary: Seeking developers to test the TSMenus Library 
Keywords: TopSoft, TSMenus, Beta Testers
Organization: UMCC
Date: Fri, 9 Oct 1992 18:09:27 GMT

Dear Netters,

TopSoft, Inc. (developer of FilterTop and several other products)
is seeking beta testers to put our TSMenus Library through its
paces, and give us some feedback.  The library is designed to
simplify menu handling for the developer, while at the same time
allowing the user to move menu items around as he likes (i.e.
facilitating menu-item position independence).  The TSMenus
Library sits on top of the Menu Manager as a flexible, high-level
layer to make dealing with the Menu Manager a bit easier, while
providing the abovementioned functionallity.  

We would like to publish an article on TSMenus in MacTutor
and/or _develop_, and we would appreciate your feedback to
help us ensure that the library is easy-to-use, works as 
documented, etc.  If you would like to beta-test it, please
e-mail me at stevej@ais.org.  When completed and fully tested,
the TSMenus Library, along with other products TopSoft will
be releasing soon, will be available freely on all your 
favorite ftp sites, and from our TopSoft ftp server.

We hope to get a final version of the library and article
to MacTutor and _develop_ within a week or so; if you have
the time and would like to help us test the library, we 
would be greatly indebted!

Thanks very much!

steve

+----------------------+---------------------------+----------------------+
| Steve Jovanovic      |  President, TopSoft, Inc. |    2918 Goold St.    |
| Marquette University +---------------------------+   Racine, WI 53404   |
| Computer Engineering | Internet:  stevej@ais.org |    (414) 632-0336    |
+----------------------+---------------------------+----------------------+
| "Blue skies above, sun on your arms, strength in your stride, and hope  |
|  in those squeaky clean eyes..." -- "Teenage Wildlife," David Bowie     |
+-------------------------------------------------------------------------+

Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Fast/Smooth animation, synching with monitors, etc.
Organization: Kalamazoo College
Date: Fri, 9 Oct 1992 15:23:11 GMT

mssmith@afterlife.ncsc.mil (M. Scott Smith) writes:
>
>   I animated the picture by moving it to the right one pixel at a time.
>Not terribly fast -- in fact, it would take maybe 6 seconds to go across
>the screen.  Is this normal?

Yep.  :-)

>   When I moved it to the right 4 or so pixels at a time, it was fairly
>zippy, and didn't seem that choppy.  Is good-looking animation normally
>achieved by jumping more than 1 pixel in a given direction?

Yep.  :-)

>   Unfortunately, the animation was VERY jerky/flashy -- I wasn't expecting
>this.

See below.

>   Is THIS normal?  Do I need to synch the animation with the monitor?

When you're copying a large area, especially when you're moving the same
image around (as opposed to putting lots of different images into the
same place)--yes, you probably do.

>   And, if so, how can I do this?  (I'm using Think C at this point.)

Install a vertical blanking task to the appropriate GDevice with
SlotVInstall.  Make the task set a variable somewhere.  Make your code
loop around and check to see when that variable changes.  At that point,
the scanning beam is probably just about to start refreshing the screen.
Depending on how fast you redraw, you may want to start copying at that
point, or you may want to wait a few milliseconds and paint _behind_ the
electron beam.  If you do the latter method, you'll get half the maximum
frame rate but it'll be very smooth.  (Think about it.)

If this is an After Dark module, it does this for you, by the way.

>   I create two Gworlds; one has a picture of a fish, the other has a blank
>picture (for erasing over the fish..  bad idea (or better way?))

Yeah, bad idea.  :-)  That means, for almost all your picture, you're
writing data _twice_.  Inefficient.  Plus, if you don't sync with the
electron beam, the laws of chance dictate that it'll display the black
picture fairly often.  That's where your flicker is coming from.  (See
above.)

The easiest way is to create a picture of a fish with an n-pixel black
margin around it, and then never move it more than n pixels in any
direction.  It'll automatically
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 I tried to sleep my way to the top
 But my alarm clock always woke me right up
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Think C++??
Followup-To: comp.sys.mac.programmer
Originator: d88-jwa@dront.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
	<de19-101092060636@mac19-pg2.umd.edu>
Date: Sat, 10 Oct 1992 22:42:59 GMT

> de19@umail.umd.edu (Dana S Emery) writes:

   adequacy of project management.  

   I have asked them to implement a project <-> makefile capability, which


Well, it has been publicly demonstrated that Think C 6.0 will
support ToolServer for MPW... (But then if you do compiles and
makes that way, why not get MPW ? :-)

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Suedoise (not french speaking) --

   What we need is a good GNU [...] licence manager implementation.
                     -- Raphael Manfredi
From: sll2@cunixa.cc.columbia.edu (Steven L Levitt)
Subject: UnloadSeg and pointers to functions
Organization: Columbia University
Distribution: na
Date: Thu, 15 Oct 1992 18:19:40 GMT

	If I have a structure on the heap which contains a point
function and I call UnloadSeg() on the segment which contains that 
function, will the pointer still be valid afterward?  I would like to call
UnloadSeg() each time through the main event loop, but I don't know if the Jump
Table scheme the mac employes will preserve the validity of my f
pointers.

----------------
Steven L. Levitt  sll2@cunixa.cc.columbia.edu
An Undergrad

Newsgroups: comp.sys.mac.programmer
From: kjh+@cs.cmu.edu (Kenneth Hughes)
Subject: Forcing Sys6 on a Q700?
Followup-To: comp.sys.mac.programmer
Organization: School of Computer Science, Carnegie Mellon
Date: Wed, 14 Oct 1992 04:53:58 GMT

Anyone know the inside technical details as to why a Q700 (or any other
System-7-only platform) cannot run System 6.0.x ?  I'm wondering how feasible
it'd be to hack something up so that I can test and debug some code under
System 6 without having to pick up another Mac besides my Q700.

Along those lines, does anyone know the current break-down of System 7 vs
System 6 users?  Has it passed 50/50 yet?  Thanks for any info.

Kenneth J. Hughes     (kjh@cs.cmu.edu)
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: What's the hell is wrong with Gestalt?
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Thu, 15 Oct 1992 23:27:32 GMT

In article <mxmora-141092183451@css-mac1.sri.com>, mxmora@unix.sri.com
(Matthew Xavier Mora) wrote:
> 
> Why does gestalt return gestaltMacPlusKbd when I have a Mac II and 
> an Extended Keyboard?

Your dealer lied to you. You really DO have a Mac Plus...

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
Newsgroups: comp.sys.mac.programmer
From: tel@adimail.uucp (Terry Monks)
Subject: PowerBook 100
Organization: Automata Design, Inc.
X-Newsreader: TIN [version 1.1 PL6]
Date: Fri, 16 Oct 1992 17:24:25 GMT


If anyone has been successful running a modem at 2400
baud from the printer port of a Powerbook 100 would they
please contact me, either by telephone at (703) 742-9400,
or by email at adimail!tel.

If anyone has been unsuccessful at this, would they also
contact me.

My Powerbook 100 (2/20) has been back to Apple twice for
motherboard swaps in attempts to fix this problem, to no
avail, and I have heard form two other people about
similar problems. On the other hand, the service was
very fast.

Please do not respond with advice to turn off AppleTalk,
MIDI, change modems, change cables, or change software.
All this has been tried ad nauseam.
-- 
Terry Monks        Automata Design Inc    (703) 742-9400
From: scott@mcl.ucsb.edu (Scott Bronson)
Newsgroups: comp.sys.mac.programmer
Subject: Virtual Serial Ports
Date: 11 Oct 92 08:51:03 GMT

Inside the Macintosh Communications Toolbox says how to find virtual serial
ports, and Inside Macintosh Volume II tells how to read, write, reset, and
control serial drivers, but nowhere can I find any information on how to
open or close them!  I assume RAMSDOpen is wholly obsolete, but even my
super-thick new X-Ref can't tell me where to find more info on how to open
and close a serial driver by its in and out name without conflicting with
the ROM (?) driver.

Can anyone give me any hints on where to look to find this info?  If not,
then any sample code you might be able to muster would be absolutely
fantastic.

Thanks so much for any help.

	- Scott

Help stamp out excessive .sigs +-==-+
Newsgroups: comp.sys.mac.programmer
From: boyd@apple.com (scott boyd)
Subject: Re: How *should* gestalt manager be used under sys 7?
Date: Thu, 15 Oct 1992 06:23:54 GMT
Organization: Apple Computer Inc.
Followup-To: comp.sys.mac.programmer

In article <D88-JWA.92Oct14033657@byse.nada.kth.se>,
d88-jwa@byse.nada.kth.se (Jon Wtte) wrote:

>    > Or PowerOpen 4.0 might return $400 in the version selector.
> 
>    No, it won't.
> 
> And Handles can efficiently be locked by setting the high bit
> according to a copy of Inside Mac I have around here somewhere.

Cute, but I say again:  No, it won't.

scott
boyd@apple.com
macintosh system software
Newsgroups: comp.sys.mac.programmer
From: jwwalker@cs.scarolina.edu (Jim Walker)
Subject: popup menu CDEF bug?
Reply-To: walkerj@math.scarolina.edu
Organization: USC  Department of Computer Science
Date: 11 Oct 92 05:55:08 GMT



There seems to be a bug in the System 7 pop-up menu CDEF, as follows: If
the selected item is number 32 or higher, and the monitor is in color, then
the downward-pointing triangle (the one you see when the menu is not pulled
down) is drawn in gray.

Is this a known bug, and if so is there any workaround?
--
---
   Jim Walker  jwwalker@usceast.cs.scarolina.edu  76367.2271@compuserve.com
From: time@ice.com (Tim Endres)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Memory Manager-safe Deferred Tasks - A Proposal
Date: Wed, 14 Oct 92 15:15:49 EST
Organization: ICE Engineering, Inc.
Reply-To: time@ice.com (Tim Endres)
X-Mailer: uAccess - Macintosh Release: 1.6v1


In article <Bw3H6x.IAo@news.cso.uiuc.edu> (comp.sys.mac.programmer), resnick@cogsci.uiuc.edu (Pete Resnick) writes:
> Jeff E Mandel <mandel@tmc.tulane.edu> writes:
> 
> >Basically, I like the concept of the Deferred Task manager, but the only
> >thing it really gets me is the ability to do something in a small number
> >of milliseconds after an interrupt without making the cursor jump around
> >and other interrupt-driven code halt in its tracks. What I really want is
> >the ability to take the data I've gotten from the interrupting device and
> >stuff it into a pointer or handle at the soonest opportunity. Thus, what
> >I want is the ability to place a task in the DT queue, but flag it as
> >"don't call me until you can give me access to the specified heap".
> 
> I like this idea very much, and this would actually be pretty easy to
> implement: You could write a device driver that would simply call the

When we implemented MacTCP and MacNFS at citi.umich.edu, we were faced
with countless interrupt level memory problems. As I remember, this was
easily solved by creating and managing our own little heap for the
things that we needed.


tim endres - time@ice.com  -or- tbomb!time
ICE Engineering, Inc - 8840 Main St, Whitmore Lake, MI 48189
Phone (313) 449 8288 - FAX (313) 449-9208
USENET - a slow moving self parody... ph
From: Robert@cs.umass.edu (Robert C. Cook)
Newsgroups: comp.sys.mac.programmer
Subject: GCC/GMAKE
Date: 8 Oct 92 20:10:52 GMT
Reply-To: Robert@cs.umass.edu
Organization: Computer and Information Science, University of Massachusetts, Amherst, MA

I know that GCC is available for MPW 3.1, but is it available for MPW 3.2?
What about GMAKE for MPW?


Bob Cook
From: 00bwanderson@bsu-ucs.uucp
Newsgroups: comp.sys.mac.programmer
Subject: GCC 1.37.1r7(min)-what's it good for?
Date: 13 Oct 92 22:43:19 GMT

I just downloaded GCC 1.37.1r7(min) from sumex, and I wants to know, is there a
more recent version, and where can I get it if so?

Also, what do I need to use GCC?  Is this ANSI C++?  If not, why not.  Will
it work with Think C 5.0.3?  Have I asked enough silly FAQs yet?  Will I ever
shut up?  Who knows!?

8^)

Many, many thanks in advance!

Bruce
-- 
.sig?  We don' need no steenkin' .sig!

Bruce Anderson: A tradition of Chaos and Disorder since 1967
spock@bsu-cs.bsu.edu (unix)	00bwanderson@bsu-ucs.uucp (VAX)
Don't look at me in that tone of voice!  BSU disclaims me, and I disclaim them.
Newsgroups: comp.sys.mac.programmer
From: wwg2101@venus.tamu.edu (GILPIN, W.W.)
Subject: Re: CMarker
News-Software: VAX/VMS VNEWS 1.41    
Organization: Texas A&M University, Academic Computing Services
Date: Mon, 12 Oct 1992 00:36:00 GMT

>Is there a version of CMarker or a similar utility which works with THINK C
>5.0.x? UMICH has version .5b3 of CMarker which doesn't appear to work with
>version 5.0.x of THINK C.

*ahem*  <embarrased grin>
I just read about marks in the manual. Ummmm...nevermind. Heh. Sorry to
waste bandwidth.

-------------------------------------------------------------------------------
| Wes Gilpin              | I'd kill myself for you...I'd kill you for myself |
| WWG2101@TAMZEUS(BITNet) |------------------------------------------         |
| WWG2101@ZEUS.TAMU.EDU   | Southwest Knights of Nee Paintball Team | PANTERA |
-------------------------------------------------------------------------------
From: paul@svl.cdc.com (Paul Kohlmiller)
Newsgroups: comp.sys.mac.programmer
Subject: AppParmHandle - usable?
Summary: How to use AppParmHandle - help needed
Keywords: AppParmHandle
Date: 12 Oct 92 17:50:36 GMT

I posted earlier a question about launching applications and getting
the application to open a file - much like double clicking on a 
Word document launches Word AND opens the file.
I got launching working from both Sys6 and 7 and I can launch an
application from a document filepathname but the application will not
open the file.
One person told me to use AppParmHandle. The code did things like
SetHandleSize(AppParmHandle, ...)
but this causes my Mac to crash. There doesn't seem to be any handle
there to resize.
I tried to brute force my way through it by getting some space and
putting either a handle or a pointer where the AppParmHandle should be.
No luck, the application launches with an untitled window, the doc. file
is not opened.
I can't find any header file that defines AppParmHandle in MPW so I use:
#define AppParmHandle (Handle) (0xAEC)
I also tried:
char ** AppParmHandle = 0xAEC;   which seems quite wrong.
I am now to the point where I am considering trying to emulate the
double click by posting a mouseDown-Up-Down-Up set of events. Would that
work?
BTW, Apple Events is not a workable solution because the application that I
am trying to launch is not "aware" of high-level events and I can't change it.
thnx in advance
Paul K.

--
     // Paul H. Kohlmiller             //  "Cybers, Macs and Mips"    //
     // Control Data Systems, Inc.    // Internet: paul@svl.cdc.com  //
     // Acronym under construction.  // America Online: Paul CDC    //
     // All comments are strictly my own. I won't lie but my       //
     // perception of reality is at best a personal hunch.        //
From: at15+@andrew.cmu.edu (Andrew Lewis Tepper)
Newsgroups: comp.sys.mac.programmer
Subject: Full Screen Quickdraw
Date: 12 Oct 92 11:48:39 GMT
Article-I.D.: andrew.geqROL_00WB5EZjmJC
Organization: School of Computer Science, Carnegie Mellon, Pittsburgh, PA

I want to create a window that is 640x480 without those anoying round
corners clipped out, and without the menu bar. Ideally I'd like to have
Command-A flip the menu bar on and off. If anyone has a code fragment to
do this, I'd be grateful! (I'll even send you a Beta of my game - Still
a few weeks off though.)

Andy Tepper
From: dob@ccr-p6.ccr.jussieu.fr (Dominique BERNARDI p3512)
Newsgroups: comp.sys.mac.programmer
Subject: A plea to American Programmers
Summary: Don't hard-code names of special folders
Date: 12 Oct 92 12:45:29 GMT
Organization: Universites P. & M. Curie / D. Diderot

I am sick of finding programs which, after two years of System 7 (from beta),
still think they know what should be the name of the "Preferences" folder.
This is none of your business!!! Why hard-code names which change from a
language to another, when there are perfectly good system calls to find the
correct folder ?

Some commercial programmers continue to do this after dozens of complaints
from users all over the world. (Perhaps normal bug-reporting channels don't
think the issue is important, but it is for us).

Please support international systems, especially when, as is here the case,
it is actually easier to do it right than the other way.

Thank you for your attention,

Dominique Bernardi