Mousup selectionchanged messages
That's unfortunate.. From: Richard Gaskin [EMAIL PROTECTED] Subject: notification of hilitedLine change? SelectionChanged only works on editable text fields, But I don;'t get that here... created a simple field added 3 lines and the following script: on selectionChanged answer Hello end selectionChanged And clicking on lines result in the expected dialogue... I have a few questions regarding message handling - not sure if there a reasons for them, but would like to know... 1) Autoarm blocks mouseDown messages (but not mouseUp 2) how to get the mouseUp when if it outside the control clicked on... ... Answer (just found -:) - the mouseRelease message! Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: borderwidthSolution?: effective rect
I think I may have missed a little of this thread, but I'd suggest that the most important property to most people was the visible rect. In other words the user usually want the rect so they can position the borders to line up visually with other objects. I haven't yet delved into the intricacies of the rect property so it would really help me and probably other people on the list if someone could list those properties that change the visible rect while keeping the rect according to Metacard the same. At the moment I end up fiddling around adding or subtracting a couple of pixels from the resize handlers, until it does what I want - hardly scientific -:) The first gotcha was with groups and borders - when you have a nice square object with things inside it and you group them and try to position the group... only to find it's positioned 4 pixels out, because of the invisible default 4 pixel border. So I'll add that to the list as number 1: 1) Group rect visible rect if margin 0 and showborder is off. 2) ? From: Richard Gaskin [EMAIL PROTECTED] Subject: borderwidthSolution?: effective rect Last week we were discussing the relative merits of having one fixed rect for a field regardless of the ephemeral focusBorder, or whether the focusBorder should be included in the rect as it is in 2.4b4. There seemed a consensus that a fixed rect was more useful than a dynamic one based on this ephemeral property, but it leave this question open: What do we do for the minority of cases where including the focusBorder in the rect would be useful? I would like to propose that we consider adopting the effective rect, which would return the complete rect of an object including any temporary decorations like the focusBorder. Would this be acceptable to the readers here (and more importantly, to Scott)? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: sockets
From: Rodney Tamblyn [EMAIL PROTECTED] Subject: sockets Date: Mon, 27 Aug 2001 17:08:59 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I have been having fun working with sockets in Metacard, and in general everything seems to work fine. Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? read from socket s with message newData is probably the best way...it threads the socket reading, so your program doesn't come to a halt. You just need to handle the newData message (or whatever you want to call it) which has the data and the socket. You should wrap your communications in something (i use reply/reply so you know when you have all of your data (i.e. if its a bunch of data, you might get a couple of messages with only part of the info). As far as leaving them open, I tried leaving them open for short bursts...something like Computer 1 Computer 2 Request Process Request Send OK or more data if OK, close socket if data, process and send back ok or data and continue until one says OK. Unless you are doing something high-speed like online gaming, I think that its smarter to close sockets...but I could be wrong at that.. Hope this helps! -ml In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Presumably there is a limit on the number of sockets MC can have open? When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com -- Mark J. Luetzelschwab [EMAIL PROTECTED] Graduate Research Assistant (v) (512) 232 6034 Instructional Technology(f) (512) 232 2322 Reading and Language Arts: http://www.texasreading.org Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: sockets
- Original Message - From: Rodney Tamblyn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 26, 2001 10:08 PM Subject: sockets I have been having fun working with sockets in Metacard, and in general everything seems to work fine. Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Have you tried using datagram (UDP or connectionless) sockets? This causes the sent data to arrive as a parameter variable of the arrival message rather than as a data stream to be read. For example (in event sequence order): -- in the receiving stack (at IP address 11.33.55.77) -- accept datagram connections on port 5 \ with message newConnection -- in the sending stack (at IP address 22.44.66.88) -- put 11.33.55.77:5 into tDestination open datagram socket to tDestination write (data data data data) to tDestination close socket tDestination -- back in the receiving stack -- on newConnection pSenderAddress, pSentData answer hostNameToAddress(hostName()) says: cr \ pSenderAddress sent the following: cr \ pSentData end newConnection If I got it right, the above code would display this message: 11.33.55.77 says: 22.44.66.88 sent the following: data data data data Food for thought. (I'm not sure if the newConnection UDP socket closes automatically or if it has to be closed with a close command.) Phil Presumably there is a limit on the number of sockets MC can have open? When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: borderwidthSolution?: effective rect
David Bovill wrote: I think I may have missed a little of this thread, but I'd suggest that the most important property to most people was the visible rect. In other words the user usually want the rect so they can position the borders to line up visually with other objects. I haven't yet delved into the intricacies of the rect property so it would really help me and probably other people on the list if someone could list those properties that change the visible rect while keeping the rect according to Metacard the same. At the moment I end up fiddling around adding or subtracting a couple of pixels from the resize handlers, until it does what I want - hardly scientific -:) The first gotcha was with groups and borders - when you have a nice square object with things inside it and you group them and try to position the group... only to find it's positioned 4 pixels out, because of the invisible default 4 pixel border. So I'll add that to the list as number 1: 1) Group rect visible rect if margin 0 and showborder is off. 2) ? The resize issue reveals the problem with including the focuBorder in the rect: It simply requires rewriting every resize handler in everything you want to move to 2.4. As for groups, this has already been accounted for: the border property of groups is 4 by default. Set that to 0 and you're done. -- Richard Gaskin Fourth World Media Corporation Multimedia Design and Development for Mac, Windows, UNIX, and the Web _ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 ICQ#60248349Fax: 323-225-0716 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: sockets
On Mon, 27 Aug 2001 Rodney Tamblyn [EMAIL PROTECTED] wrote: Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? The simpler read from socket x with message y is much more efficient, and is the *only* reasonable way to use sockets that will be exchanging large amounts of data or when communicating with a large number of other hosts. I find it more convenient even for smaller-scale development because as long as the host on the other end always writes a complete message (and as long as it's less than 4K in length), you don't have to worry about this length/data problem: all the data they wrote in a single write command will come in with the message. In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Definitely: setup time for a TCP socket is pretty large, so you want to leave a socket open as long as there's any chance that you'll need to read or write to it later (this is the issue behind the Keep-Alive extension to the HTTP that was the big feature added for version 1.1 of that protocol). Note that socketTimeout messages will be sent periodically if the socket is inactive for the amount of time specified in the socketTimeoutInterval property. You can either just ignore them or use them as a cue to close the socket and notify the user that something has gone wrong. Presumably there is a limit on the number of sockets MC can have open? Yes, but it depends on the OS and even on how a particular system is set up. A generally-safe lower bound is 20. When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? No, TCP does that automatically. When the connection is dropped at the other end (or someplace in the middle ;-) MetaCard will get an event that will result in a socketClosed or socketError message being sent, depending on exactly what happened. Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. The libURL script is getting to be a little large to use as a source of examples, but it wouldn't hurt to browse through it. I also have a little telnet client that I'd be willing to send to anyone who needs examples of how to communicate with a telnet server or to get a general idea of how two hosts can communicate. Regards, Scott Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com Scott Raney [EMAIL PROTECTED] http://www.metacard.com MetaCard: You know, there's an easier way to do that... Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
RE: borderwidthSolution?: effective rect
Title: RE: borderwidthSolution?: effective rect Actually, I believe it is the *margin* property that is set to 4 by default. My first action when making a group is to immediately set the margins of groupID to 0. Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Richard Gaskin Sent: Monday, August 27, 2001 1:17 PM To: [EMAIL PROTECTED] Subject: Re: borderwidthSolution?: effective rect David Bovill wrote: I think I may have missed a little of this thread, but I'd suggest that the most important property to most people was the visible rect. In other words the user usually want the rect so they can position the borders to line up visually with other objects. I haven't yet delved into the intricacies of the rect property so it would really help me and probably other people on the list if someone could list those properties that change the visible rect while keeping the rect according to Metacard the same. At the moment I end up fiddling around adding or subtracting a couple of pixels from the resize handlers, until it does what I want - hardly scientific -:) The first gotcha was with groups and borders - when you have a nice square object with things inside it and you group them and try to position the group... only to find it's positioned 4 pixels out, because of the invisible default 4 pixel border. So I'll add that to the list as number 1: 1) Group rect visible rect if margin 0 and showborder is off. 2) ? The resize issue reveals the problem with including the focuBorder in the rect: It simply requires rewriting every resize handler in everything you want to move to 2.4. As for groups, this has already been accounted for: the border property of groups is 4 by default. Set that to 0 and you're done. -- Richard Gaskin Fourth World Media Corporation Multimedia Design and Development for Mac, Windows, UNIX, and the Web _ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 ICQ#60248349 Fax: 323-225-0716 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: borderwidthSolution?: effective rect
Ken Ray wrote: Actually, I believe it is the *margin* property that is set to 4 by default. My first action when making a group is to immediately set the margins of groupID to 0. Correct -- good catch. -- Richard Gaskin Fourth World Media Corporation Multimedia Design and Development for Mac, Windows, UNIX, and the Web _ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 ICQ#60248349Fax: 323-225-0716 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Round function bug
Bug? The documentation for the round function states that .5 or larger rounds up. But apparently, it is not consistent, and sometimes rounding up occurs at 0.5, not = 0.5. round(1.335, 2) returns 1.34 but round(38.175, 2) returns 38.17 on my machine. I'm thinking as a work around, just add a small number like 0.0001 to every call to round. Comments? Sadhu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Rounding Bug, eeek!
| | From: Richard Herz [EMAIL PROTECTED] | | Subject: Re: Math errors, HELP! | | Date: Tue, 14 Aug 2001 14:15:45 -0700 | | | | | | The code you supplied and put into EXAMPLE 2 below works OK. EXAMPLE 1 | | below shows a similar rounding problem that can occur with the MC format | | function. The format function with a format of %6.2f rounds 1.3350 to 1.33, | | whereas round(1.3350, 2) returns 1.34. My summer students discovered this | | last week in homework 1 with similar behavior of MC format function and True | | Basic's PRINT USING instruction. None of this may have solved your problem, | | so good luck! . Oh dear, I am still having grief with the rounding function, and it seems like a bug to me. I put this into the message box put round(1 * 0.50 * 76.35, 2) Now, this should resolve to round(38.175, 2) = 38.18. But try it, it returns 38.17. EEK, a BUG! If someone can suggest a work around, I'd be very grateful. Sadhu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
File Swapping
I need my app to send a small text file to a directory on my web site. I also need my app to download small text files from a directory on my web site. Okay ... any ideas? Jack Rarick Braintree Athletic Systems Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
exploring LibURL - among vs contains and arrays
Title: exploring LibURL - among vs contains and arrays Thanks Phil, Mark and Scott for the responses to my sockets enquiry Further to Scott's suggestion I've been looking through the LibURL stack. Consider amongs vs contains: newUrl is among the lines of the keys of tQue a is among the words of a b c d -- true vs: newUrl is in the keys of tQue the keys of tQue contains newUrl Among operator matches a specific chunk (eg a word or a line), so is more precise. Otherwise these commands seem analogous with each other. Is among faster? This isn't an operator I use very much but I think perhaps it is superior to using in or contains. Comments? Arrays Further to my earlier post on arrays within arrays: While is is not possible to do this: put seat into parts[a] put parts into car[elements] it is possible to do this: put seat into car[elements[a]] put wheel into car[elements[b]] put car[elements[a]] #--seat Limitations: - You can't retrieve a whole sub-array put car[elements] into theElements #empty - The keys won't show elements whose value is a sub-array put the keys of car #no pun intended! -- empty So one can build multi-dimensional arrays, but cannot put a whole array into an element of another array. Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com