From Jack.Jansen@cwi.nl Wed Jan 1 22:55:00 1997 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Wed, 01 Jan 1997 23:55:00 +0100 Subject: [PYTHONMAC-SIG] Default Tk attributes? In-Reply-To: Message by Guido van Rossum , Tue, 31 Dec 1996 10:50:18 -0500 , <199612311550.KAA25549@monty> Message-ID: <9701012255.AA23749=jack@schelvis.cwi.nl> Hmm, the sensible thing to do on the Mac would be to get this preferences file either from the "Preferences" folder in the system folder, from the Python "home" folder or from anywhere on sys.path.

All of these are pretty easy to implement, what do people think is the handiest? Hmm, ignore the

above: as people may have guessed I spent all evening typing html:-) -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From jurjen@q2c.nl Fri Jan 3 13:25:43 1997 From: jurjen@q2c.nl (Jurjen N.E. Bos) Date: Fri, 3 Jan 1997 14:25:43 +0100 Subject: [PYTHONMAC-SIG] Useless, but fun program for Python fans Message-ID: I was inspired by the Pi program that is distibuted with Python. I decided= to expand it a little, and speed it up using a better approximation method. The result is a program that can print the following number to infinite prec= ision: - pi - e to fraction powers - sin, cos, sinh, cosh, asin, atan, acos of a fraction - roots of fractions - sums of any of the above At the end of the program, there are some examples. For example, if you are = only interested in printing pi, use p(pi4). Hope you like it; let me know if you do. # This program prints mathematical constants to infinite precision # It can print all constants specifiable as num/den*sum(i=3D0,=83,product(k= =3D1,i,f(n)/g(n))) # where f and g integral functions satisfying -g(k), # or sums of these constants. # Written by Jurjen N.E. Bos (jurjen@q2c.nl), 1996-97. # Examples are shown below from sys import stdout from string import zfill # the class below is dirty in the sense that class instances modify themselv= es # after quite "innocent" operations, such as *,/,+ negDenom =3D "Denominator must be positive" class series: def __init__(self,num,den,f,g): self.num =3D long(num) # current value (always positive) self.term =3D self.num # next term (may be negative) self.den =3D long(den) # common denominator (always positive) self.f =3D f self.g =3D g self.k =3D 1 # multiply sequence by a number (modifying the sequence!) def __mul__(self,n): self.num =3D n*self.num self.term =3D n*self.term return self # divide sequence by a number (modifying the sequence!) def __div__(self,n): self.den =3D n*self.den return self # add number to sequence (modifying the sequence!) def __add__(self,n): self.num =3D self.num+n*self.den return self # expand with given precision def expand(self,factor): while abs(self.term)*factor>=3Dself.den: self.term =3D self.term*self.f(self.k) g=3Dself.g(self.k) self.num =3D self.num*g self.den =3D self.den*g self.num =3D self.num+self.term self.k =3D self.k+1 # this is a lower estimate: subtract one if negative term return self.num*factor/self.den-(self.term<0) # integer part of sum of a list of series def intPart(l): extra =3D 1 # force the while to execute once estimate =3D 0 # we have fractional part and error for every term, # so we can expect up to 2 extra per term while estimate%extra >=3D extra-3*len(l): # too much error, estimate two more digits extra =3D extra*100L estimate =3D 0 for s in l: estimate =3D estimate+s.expand(extra) return int(estimate/extra) def p(l): digits =3D 8 # number of digits to print at once base =3D 10**digits # our computation "number base" lastInt =3D intPart(l) stdout.write(`lastInt`+',') #print fraction while 1: carry =3D lastInt for s in l: q,s.num =3D divmod(s.num,s.den) carry =3D carry-int(q) s*base lastInt =3D intPart(l) output =3D lastInt-carry*base if not (0<=3Doutput), e.g. p(pi4) # (this works only once for each , since it is modified!) # the constant e is the simplest e=3D[expSeries()] # pi using some standard formulas (in speed order: last one is fastest) pi1=3D[series(4,2,lambda(k): k,lambda(k): 2*k+1)] pi2=3D[asinSeries(1,2)*6] pi3=3D[atanSeries(1,5)*16,atanSeries(1,239)*-4] pi4=3D[atanSeries(1,8)*24,atanSeries(1,57)*8,atanSeries(1,239)*4] # roots are easily speeded up by rational approximations of the result # square root of 2 sr2=3D[rootSeries(2*14**2,17**2)*17/12] # cube root of 2 cr2=3D[rootSeries(2*4**3,5**3,3)*5/4] # golden ratio phi=3D[(rootSeries(5*17**2,38**2)*38/17+1)/2] # log of 2 (simple way) ln2a=3D[logSeries(1,2)*-1] # log of 2,3,5,7 (fast way, using combinations of small logs) def combineLogs(a,b,c,d): return [logSeries(125,126)*-a,logSeries(224,225)*-b, logSeries(2400,2401)*c,logSeries(4374,4375)*-d] ln2=3DcombineLogs( 72,27,19,31) ln3=3DcombineLogs(114,43,30,49) ln5=3DcombineLogs(167,63,44,72) ln7=3DcombineLogs(202,76,53,87) # log of 10 is sum of log 2 and 5 ln10=3DcombineLogs(239,90,63,103) -- jurjen@q2c.nl ( Jurjen N.E. Bos) ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Ivan.Herman@cwi.nl Sat Jan 4 12:30:19 1997 From: Ivan.Herman@cwi.nl (Ivan Herman) Date: Sat, 04 Jan 1997 13:30:19 +0100 Subject: [PYTHONMAC-SIG] Default Tk attributes? In-Reply-To: Your message of "Wed, 01 Jan 1997 23:55:00 MET." <9701012255.AA23749=jack@schelvis.cwi.nl> Message-ID: <9701041230.AA12143=ivan@petunia.cwi.nl> ------------------ Your Original Message: -------------------- > Hmm, the sensible thing to do on the Mac would be to get this > preferences file either from the "Preferences" folder in the system > folder, from the Python "home" folder or from anywhere on sys.path.

> > All of these are pretty easy to implement, what do people think is the > handiest? I would opt for a separate folder in Preferences (the previous mail of Guido shows that Tkinter refers to possibly several files, not only one!). Sys.path might be a valid alternative, although the Mac 'style', I guess, is the preferences folder. Using the python home folder does not sound like a good idea to me. Ivan ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Fri Jan 10 14:15:25 1997 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Fri, 10 Jan 1997 15:15:25 +0100 Subject: [PYTHONMAC-SIG] Internet Config module available Message-ID: <9701101415.AA11664=jack@snelboot.cwi.nl> I've built a Python interface to the Internet Config package (finally), available for Python 1.4 PPC and CFM68K. You can fetch it from . As usual, the ppc version has been lightly tested and the cfm68k version not at all. Please let me know whether it works. I would also appreciate feedback on the design of the interface, let me know if you would like it to work differently or if you miss functionality in the high-level interface. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From billpy@mail.demon.net Sat Jan 11 12:20:27 1997 From: billpy@mail.demon.net (Bill Bedford) Date: Sat, 11 Jan 1997 12:20:27 +0000 Subject: [PYTHONMAC-SIG] AppleScript and the NeXTMac OS Message-ID: This was posted on the Applescript List, and a few others, I thought it might be of interest to people here. ~X-URL: http://www.infoworkshop.com/~jonpugh/ ~Date: Sat, 11 Jan 1997 00:02:20 -0800 ~Reply-To: Macintosh Scripting Systems ~Sender: Macintosh Scripting Systems ~From: Jon Pugh ~Subject: Re: AppleScript and the NeXTMac OS ~ ~Well, I guess that's my cue... ~ ~First off, nothing I say here is official Apple policy. This is ~essentially a summary/continuation of a discussion that started on the ~OpenDoc-Interest mailing list in the beginning of December. I've ~crossposted this to MacScripting, AppleScript Users and OpenDoc Interest ~because I think everyone wants to know what's going on. I know I do. ;) ~ ~I didn't hear about the NeXT deal until you folks did, so I'm still ~absorbing it and providing my feedback when asked, but this discussion ~started before that happened, and it hasn't changed much, so I think that ~validates a lot of the reasons for doing it. ~ ~I've been trying to decide what to do about OpenDoc and OSA. We've all ~been hampered by a number of aspects of AppleScript. Notably it's lack of ~improvement. Given OpenDoc's cross platform aspects, and AppleScript's ~lack of those cross platform aspects, AppleScript is proving to be of ~limited use. Thus, we must consider other options. ~ ~The J word is what comes in here. Java could suffice as a scripting ~language if you had an OSA implementation of it. It's too geeky for a lot ~of people, so an AppleScript/HyperTalk kind of thing would still be nice, ~but considering that programmers like working in Java, it should be an easy ~sell. ~ ~An OSA Java would let us compile a bunch of classes up into a standalone ~script. We could use our own interface with run, open, idle and quit, as ~well as the applet interface. That would be a fine start. Using Frontier, ~you ought to be able to nest classes in the odb. Should be cool. ~ ~Then, we could bridge AppleEvent subroutine events, like the ones ~AppleScript and Hypercard use, into Java methods called by name. To send ~messages back, we'd need to have a package which allowed you to build ~AppleEvents, much like Frontier does. ~ ~We could even implement a new security module since we'd like to allow more ~access than an applet but still disallow some kinds of operations. I think ~a control panel the user could set would be nice. That would allow one ~person's OSA Java to check for virus type actions while letting us geek ~boys do those kinds of potentially dangerous operations without complaint. ~ ~So, if we had a Java OSA component, what would that buy us in OpenDoc? ~That's my responsibility after all. ~ ~Well, we could build a system which attaches Java code to OpenDoc objects ~pretty easily. Part editors could use it to attach code to their objects ~too. You could use AppleScript, Java or any OSA language. This is the ~value of the OSA. We could do that in our C++ implementation if we like, ~or in some new implementation draft pick to be named later. ~ ~Now, we would need a few more things for this to be truly cool though. In ~addition to the package which allows us to build AppleEvents and object ~specifiers, we'd need to be able to send and receive AppleEvents. Since ~this is Java, we have IP easily. We also have the MacOS, so we have ~AppleTalk. Assuming we have OpenTransport or something equivalent on the ~newOS, we could do a portable AppleTalk implementation, but that would ~involve rewriting the AppleEvent manager in Java. That would enable AEIP ~and it would do wonderful things for the interface and performance. ~Considering that the AE manager is interpreted 68K right now, a Java AEM ~would run as fast or faster. We'd get IP easily and we'd get garbage ~collection. This would remove all the copying that the AEM does now, which ~should improve performance of AE code immensely. ~ ~Then we need to parse incoming AEs and map them to Java methods. We also ~need to be able to parse object specifiers so that we can talk with ~AppleScript and use them for remote object references. I still like the ~way whose clauses map to lists which are resolved remotely. I think it ~would be worthwhile keeping those in our brave new world. ~ ~We can also use standard Java RPC methods, including their 1.1 scripting ~features, although these won't talk to other OSA languages. While I'm at ~it, I'd add a new call to the OSA component interface, which is a ~CallByName kind of method that would correspond to the subroutine ~AppleEvent. Right now you have to build an AE and use ExecuteEvent or such ~to send the event to the script. I think it would be better to hide that ~common implementation in a standard OSA call which takes a method name and ~an array of parameters. ~ ~So, we basically rewrite the AEM and the OSL in Java as well as doing the ~OSA Java. Piece of cake. ;) ~ ~Of course, we'd get a cross platform implementation, most of it at least, ~depending on the AppleTalk capabilities we can use or reimplement. We ~don't really get a scripting language, but we can use either an existing or ~new OSA AppleScript. You'd have to program in Java using this new package ~interface, but it should be pretty nice to deal with. ~ ~We could also add an object resolution framework much like ODF uses in C++. ~In Java and without the OSL, it'll be a lot cleaner too. My questions now ~revolve around building a decent OOP framework for resolving whose clauses. ~It would be simple enough to build a framework which iterated through all ~the objects and compared them to a literal, but the trick comes in allowing ~someone to override everything properly and add other more efficient ~searches of the objects when appropriate. Ideas are welcome here, as are ~they everywhere else. It sounds like it shouldn't be too hard to do ~simply, but I can imagine people making it difficult with legacy code and ~database stuff. ;) ~ ~So, that's what I've been thinking about. I'd like to see a new and ~improved AppleScript, but I'm not holding my breath. Of course, I'm not ~holding my breath about this stuff yet either. It sounds like a sensible ~plan given the whole Java emphasis that everyone is into these days, but ~there's still plenty of work to do and few people to do it. ~ ~Feel free to comment and question things. Remember to color outside the ~lines. This is all just brainstorming at this stage. ~ ~Jon ----------------------------------------------------------------------- Bill Bedford Designer of Photo-Etches billb@mousa.demon.co.uk owner Brit_Rail-L --- british railways historical list ----------------------------------------------------------------------- ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Sun Jan 12 22:36:23 1997 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Sun, 12 Jan 1997 23:36:23 +0100 Subject: [PYTHONMAC-SIG] How do I create a fullscreen window? Message-ID: <9701122236.AA17677=jack@snelboot.cwi.nl> Ok folks, can anyone tell me how I can create a true fullscreen window on the Mac? I've looked all over Inside Mac and in various other places, but I can't seem to find it. I want to create a black background (preferrably with optional hiding of the menubar) like you see in game titles and such. I know this is a beginners question, but I am still a beginning mac programmer, I've only really done one little program for it (and not even that, really: I basically picked up where Guido left off:-), -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From roseman@cpsc.ucalgary.ca Sun Jan 12 23:52:44 1997 From: roseman@cpsc.ucalgary.ca (Mark Roseman) Date: Sun, 12 Jan 1997 16:52:44 -0700 Subject: [PYTHONMAC-SIG] How do I create a fullscreen window? In-Reply-To: Your message of "Sun, 12 Jan 1997 23:36:23 +0100." <9701122236.AA17677=jack@snelboot.cwi.nl> Message-ID: <199701122352.QAA28550@janu.cpsc.ucalgary.ca> In message <9701122236.AA17677=jack@snelboot.cwi.nl>you write: > Ok folks, > can anyone tell me how I can create a true fullscreen window on the > Mac? I've looked all over Inside Mac and in various other places, but > I can't seem to find it. I want to create a black background > (preferrably with optional hiding of the menubar) like you see in game > titles and such. i would recommend you pick up a copy of the book "tricks of the mac game programming gurus" which i found full of useful snippets such as what you're asking for. this fragment is from there: Rect windowRectangle, myScreenBoundsRect, myGameSize; myScreenBoundsRect = (**GetMainDevice()).gdRect; SetRect(&myGameSize, 0, 0, kArraySizeH*kTileSizeH, kArraySizeV*kTileSizeV); CenterRectInRect(&myGameSize, &myScreenBoundsRect, &windowRectangle); myWindow = NewCWindow(nil, &myScreenBoundsRect, "\pTitle", true, plainDBox, (WindowPtr)-1, false, 0); SetPort(myWindow); SetOrigin(-windowRectangle.left, -windowRectangle.top); PaintRect(&myWindow->portRect); about hiding the menubar, change the visRgn of your window to cover the menubar.. RectRgn(myWindow->visRgn, &myWindow->portRect); InvalRect(&myWindow->portRect); to show it again, restore the visrgn to original, and call DrawMenuBar() mark ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From just@knoware.nl Tue Jan 21 18:17:15 1997 From: just@knoware.nl (Just van Rossum) Date: Tue, 21 Jan 1997 19:17:15 +0100 Subject: [PYTHONMAC-SIG] Anyone got Py CFM68k working? Message-ID: Hi all, Is anyone using Python 1.4 as CFM68k binaries? The distributed version crashes immediately upon launch on my machine. If I compile the whole stuff myself with CW10 the exact same thing happens. But 1.4b3 works splendid! The only difference really is that that version was compiled with CW9. Since I don't have CW9 on my machine anymore and since CW10 projects can't be opened in CW9 anyway (#@$!) I can't really compare. If anyone has some experience with this, I be really happy to hear about it. Thanks in advance, Just _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From billpy@mail.demon.net Thu Jan 23 00:05:30 1997 From: billpy@mail.demon.net (Bill Bedford) Date: Thu, 23 Jan 1997 00:05:30 +0000 Subject: [PYTHONMAC-SIG] Mac Tk bindings In-Reply-To: Message-ID: Is it possible to bind tcl/Tk commands to standard mac key combinations? eg command-x etc And what's the magic formular, please ----------------------------------------------------------------------- Bill Bedford Designer of Photo-Etches billb@mousa.demon.co.uk owner Brit_Rail-L --- british railways historical list ----------------------------------------------------------------------- _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From bpt@pacbell.net Fri Jan 24 03:12:35 1997 From: bpt@pacbell.net (Benjamin Thompson) Date: Thu, 23 Jan 1997 20:12:35 -0700 Subject: [PYTHONMAC-SIG] imgbrowser on mac? Message-ID: Whats the status of the img extension on the mac? I looked through the sig archives and saw no mention of it post 1.4 release. Do these extensions work? if so, what do I do with the built libjpeg, ligpbm, and libtiff such that the python core can access them? Thanks. -ben Benjamin Thompson <> www.teleport.com/~bthompso/ ::........:........:...:: _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From Jack.Jansen@cwi.nl Fri Jan 24 11:29:06 1997 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Fri, 24 Jan 1997 12:29:06 +0100 Subject: [PYTHONMAC-SIG] imgbrowser on mac? In-Reply-To: Message by Benjamin Thompson , Thu, 23 Jan 1997 20:12:35 -0700 , Message-ID: <9701241129.AA03548=jack@snelboot.cwi.nl> > Whats the status of the img extension on the mac? I looked through the sig > archives and saw no mention of it post 1.4 release. The current version is included in the 1.4 distribution. A new version (without too much new stuff: slightly better exception handling and one or two new formats like bmp) will be available once I have the time to polish it all up a bit. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From mip@tangram.diginet.de Fri Jan 17 22:10:05 1997 From: mip@tangram.diginet.de (Michael Pruemm) Date: Fri, 17 Jan 1997 23:10:05 +0100 Subject: [PYTHONMAC-SIG] How do I create a fullscreen window? Message-ID: >In message <9701122236.AA17677=jack@snelboot.cwi.nl>you write: >i would recommend you pick up a copy of the book >"tricks of the mac game programming gurus" which i found >full of useful snippets such as what you're asking for. > >this fragment is from there: > > Rect windowRectangle, myScreenBoundsRect, myGameSize; > > myScreenBoundsRect = (**GetMainDevice()).gdRect; Unfortunately, this rectangle covers only the main screen (the one with the menubar on it). It won't work on a machine with more than one monitor (such as mine :-) I wish I did more Mac programming in the last few years to be able to tell you how to do it. Sorry. Bye, Michael -- Michael Pruemm mip@pobox.com Aachen, Germany _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From wilsona@plk.af.mil Sat Jan 25 17:37:21 1997 From: wilsona@plk.af.mil (Anthony Wilson) Date: Sat, 25 Jan 1997 10:37:21 -0700 Subject: [PYTHONMAC-SIG] Python + Tk8b + incr Tcl/Tk Message-ID: hello pythonmac: I am new to python and oop in general. I choose to use python as my building block for learning oop. I decided to do a project that uses GUI and create a drawing program. After fumbling through the syntax, indentation, i finally got something to work. In the process of writing the code, I am have come up with several questions in different areas. Pls bare with me. I am not a programmer, but i like to learn, and python looks cool. Questions: 1. Is there any further documentation on using Tk with python? I have read the life-preserver docs,the examples with the python distribution, the pdf reference docs, and i have the Programming Python book, but not a lot is said about Tk usage, syntax, and supported widgets. 2. Are there any plans to incorporate the tk8b into the mac distribution any time soon? I would love native look and feel on the mac, but will it support the current tkinter widgets for current programs. 3. Are there any plans to incorporate the other packages that are extensions of tk, such as incr tk or blt, on the mac? Is this too difficult to implement or just not enough people and time to do the implementation. 4. Is it possible for anyone to just get the source code for the packages mentioned in 3. and try to compile them for python use? How hard/difficult is such a task? Well, i think that's it, for now. TIA Anthony Wilson :-) wilsona@plk.af.mil Learn to Live and Live to Learn _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From just@knoware.nl Sat Jan 25 17:25:03 1997 From: just@knoware.nl (Just van Rossum) Date: Sat, 25 Jan 1997 18:25:03 +0100 Subject: [PYTHONMAC-SIG] How do I create a fullscreen window? Message-ID: At 11:10 PM 1/17/97, Michael Pruemm wrote: >>In message <9701122236.AA17677=jack@snelboot.cwi.nl>you write: >>i would recommend you pick up a copy of the book >>"tricks of the mac game programming gurus" which i found >>full of useful snippets such as what you're asking for. >> >>this fragment is from there: >> >> Rect windowRectangle, myScreenBoundsRect, myGameSize; >> >> myScreenBoundsRect = (**GetMainDevice()).gdRect; > >Unfortunately, this rectangle covers only the main screen (the one with the >menubar on it). It won't work on a machine with more than one monitor (such >as mine :-) And mine :-) I still don't know how to get individual rectangles from euch monitor, but this might be enough: GetGrayRgn() returns a region covering _all_ monitors, so I suppose you could just take the bounds of that region. Just _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From Jack.Jansen@cwi.nl Mon Jan 27 10:35:12 1997 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Mon, 27 Jan 1997 11:35:12 +0100 Subject: [PYTHONMAC-SIG] Python + Tk8b + incr Tcl/Tk In-Reply-To: Message by Anthony Wilson , Sat, 25 Jan 1997 10:37:21 -0700 , Message-ID: <9701271035.AA27712=jack@snelboot.cwi.nl> > 1. Is there any further documentation on using Tk with python? I have read > the life-preserver docs,the examples with the python distribution, the pdf > reference docs, and i have the Programming Python book, but not a lot is > said about Tk usage, syntax, and supported widgets. I don't know, really. I myself got by with Ousterhouts' Tcl/Tk book and the documentation you mention. > 2. Are there any plans to incorporate the tk8b into the mac distribution > any time soon? I would love native look and feel on the mac, but will it > support the current tkinter widgets for current programs. Definitely, as soon as there is a final distribution. > 3. Are there any plans to incorporate the other packages that are > extensions of tk, such as incr tk or blt, on the mac? Is this too > difficult to implement or just not enough people and time to do the > implementation. Not that I know of. There's little mac-specific code in the Tkinter module, so as soon as anyone makes the packages useable for Unix or Windows Python it'll probably run on the Mac as well. There is of course the question of how useful such things are: especially incrtcl seems to be mainly interested because it addresses shortcomings of the language tcl, and those really shouldn't bother Python users of Tk... > 4. Is it possible for anyone to just get the source code for the packages > mentioned in 3. and try to compile them for python use? How hard/difficult > is such a task? I don't know, really. But if you're willing to give it a try: all Python sources and projects and such are available... -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From billpy@mail.demon.net Sat Jan 25 22:27:35 1997 From: billpy@mail.demon.net (Bill Bedford) Date: Sat, 25 Jan 1997 22:27:35 +0000 Subject: [PYTHONMAC-SIG] Scripting Demo In-Reply-To: <9612191009.AA08974=jack@schelvis.cwi.nl> References: Message by Bill Bedford , Wed, 18 Dec 1996 22:52:16 +0000 , Message-ID: I've finally got the Eudora/scripting demo to work as it should. To do this I used this patch in aepack.py -------------------- line 68 def pack(x, forcetype = None): """Pack a python object into an AE descriptor""" if type(x) is TupleType: x, forcetype = x ----------------- And this is added to each method in Eudora_Suite.py which expects a boolian --------------- for k in _arguments.keys(): if _arguments[k] == 0: _arguments[k] = ('false', 'bool') else: _arguments[k] = ('true', 'bool') aetools.keysubst(_arguments, self._argmap_reply) _arguments['----'] = _object --------------- In fact this should be added to every AppleEvent method that expects a boolean, so perhaps gensuitemodule.py should be changed to add this code. ----------------------------------------------------------------------- Bill Bedford Designer of Photo-Etches billb@mousa.demon.co.uk owner Brit_Rail-L --- british railways historical list ----------------------------------------------------------------------- _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From mike@xochi.com Tue Jan 28 17:21:50 1997 From: mike@xochi.com (Michael Diehr) Date: Tue, 28 Jan 1997 10:21:50 -0700 Subject: [PYTHONMAC-SIG] Full Screen Window Message-ID: You need to turn off the menu bar as well... here's some sample code I wrote that also handles the Control Strip as well... RgnHandle gMyMBarRgn = NULL; short gOldMBarH; Boolean controlStripHidden = false; void Hide(void) { // short oldH; // RgnHandle MyMBarRgn=NewRgn(); //new region Rect MyMBarRect; long gestaltInfo; // Try to hide control strip controlstip.h gestalt.h if (Gestalt(gestaltControlStripAttr,&gestaltInfo) == noErr) { if (SBIsControlStripVisible()) { SBShowHideControlStrip(false); controlStripHidden = true; } } gMyMBarRgn=NewRgn(); //new region gOldMBarH=LMGetMBarHeight(); LMSetMBarHeight(0); DrawMenuBar(); MyMBarRect=qd.screenBits.bounds; MyMBarRect.bottom=qd.screenBits.bounds.top+gOldMBarH; RectRgn(gMyMBarRgn,&MyMBarRect); UnionRgn(LMGetGrayRgn(),gMyMBarRgn,LMGetGrayRgn()); PaintOne(NULL,LMGetGrayRgn()); } void Show(void) { long gestaltInfo; if (gMyMBarRgn) { DiffRgn(LMGetGrayRgn(),gMyMBarRgn,LMGetGrayRgn()); //restore initial Rgn DisposeRgn(gMyMBarRgn); gMyMBarRgn = NULL; LMSetMBarHeight(gOldMBarH); DrawMenuBar(); PaintOne(NULL,LMGetGrayRgn()); if (Gestalt(gestaltControlStripAttr,&gestaltInfo) == noErr) { if (controlStripHidden) { SBShowHideControlStrip(true); controlStripHidden = false; } } } } -- Michael Diehr E-mail : mailto:mike@xochi.com Xochi Media WWW : http://www.xochi.com/mike 510 Stratford Ct #210A Direct Line : +1.619.481.2238 Del Mar CA 92014-2740 Fax : +1.619.481.9487 _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________ From wilsona@plk.af.mil Tue Jan 28 22:53:07 1997 From: wilsona@plk.af.mil (Anthony Wilson) Date: Tue, 28 Jan 1997 15:53:07 -0700 Subject: [PYTHONMAC-SIG] Numeric Python on the Mac? Message-ID: Has anyone tried and/or succeded in porting Numeric Python on the Mac? If so, could send me or post the instructions on how to compile the module and conncet to macpython. If not, I think it might be useful. I'm willing to help, but be forewarned that I am not a programmer. TIA, Anthony Wilson :-) wilsona@plk.af.mil Learn to Live and Live to Learn _______________ PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org _______________