[comp.sys.mac.programmer] Dialog boxes with Think Class Library

rtp1@quads.uchicago.edu (raymond thomas pierrehumbert) (10/30/90)

I just got my new version of Think C, with the object oriented
extensions. Really neat.  Now, I may be missing something, but
I can't find out how to do dialog boxes with the Class Library.
All the usual dialog box controls like buttons, etc, can be 
attached to a Window object, but if what you want is a 
usual dialog box, it would be much easier to be able to load
in the DLOG and DITL resources made by ResEdit.  Is there an
object in TCL that deals with dialog boxes this way, or do I
have to define my own?  I'm not sure what kind of superclass
that kind of object should belong to, and what to do with
existing TCL objects like EditText and Buttons that in TCL
are attaced to panes.
   In short:  How do I do modal dialog boxes with the Think Class
Library?  Please reply via email, as I don't keep up with this
conference.  I will summarize to the net if there is interest.
rtp1@midway.uchicago.edu
.

chaffee@reed.UUCP (Alex Chaffee) (11/04/90)

In <1990Oct29.200612.28712@midway.uchicago.edu> rtp1@quads.uchicago.edu (raymond thomas pierrehumbert) writes:

>   In short:  How do I do modal dialog boxes with the Think Class
>Library?  Please reply via email, as I don't keep up with this
>conference.  I will summarize to the net if there is interest.

Since modal dialogs have their own event handler (the dialog manager,
through ModalDialog()), and are, after all, modal, they don't really fit in
the philosophy or heirarchy of the TCL (panes and switchboards and all
that).  You should just write dialog boxes the way you always have, as a
normal C function - or as a class if you like, but one outside the TCL.

I'm considering converting my library for dealing with dialogs into a
class.  If I ever get around to it, I'll post it.  The idea would be: a
dialog class has methods for initialization and standard event handling;
you'd write a subclass which overrides an ItemHit method to take care of
special cases - basically replacing the "switch (itemHit)" statement which
follows ModalDialog().  But it seems a bit like overkill.

BTW, there are some classes floating around the net that do modeless dialogs
in the TCL.  One actually makes a TCL window by reading a DLOG/DITL resource.

>rtp1@midway.uchicago.edu

 - Alex

-- 
Alex Chaffee
chaffee@reed.{UUCP,BITNET}
Reed College, Portland OR 97202
____________________

zobbo@tharr.UUCP (Ian Cottee) (11/05/90)

In article <15649@reed.UUCP> chaffee@reed.UUCP (Alex Chaffee) writes:
>In <1990Oct29.200612.28712@midway.uchicago.edu> rtp1@quads.uchicago.edu (raymond thomas pierrehumbert) writes:
>
>BTW, there are some classes floating around the net that do modeless dialogs
>in the TCL.  One actually makes a TCL window by reading a DLOG/DITL resource.
      
I have a class which uses a DLOG/DITL resource to create a dialog - however,
the whole thning became a little messy and although I use it myself I don't
consider it slick enough for public consumption. In particular it doesn't
handle PICTS from the dialog and its outlining of buttons is copied
from somebody elses work. 

People are quite welcome to have a look at the sort of code I was usingf
if they want a pointer of where to go to - although it would be best
for everyone (especially your application!!) if you used it merely as 
a start for your own project.

Mail me if you wanna see it

Cheers

Ian

-- 
//////////////////////////////////////////////////////////////////////
/ zobbo@tharr.uucp                  | Disclaimer - give me a break   /
/ !ukc!axion!tharr!zobbo            |              I don't even      /
/ axion!tharr!zobbo@uk.ac.ukc       |              believe this junk /
/<-- tharr *free* public access to Usenet in the UK 0234 261804 -->  /
//////////////////////////////////////////////////////////////////////