The following message is a courtesy copy of an article that has been posted to comp.lang.scheme as well.
Hi folks, I received a request for more primitives from Alex Shin, so I implemented them and fixed some bugs and added primitives for drawing text. There is one persistent bug that looks like it is not in my code. You get an exceeption if you click on an empty row of a new environment browser. Maybe Fred Kiefer can fix this. I'd be grateful! The problem goes away once you resize the browser. These are the three bugfixes: * memory leak in valToString fixed (now uses autoreleased strings throughout) * aesthetic: much better display of floating point numbers, which you may see e.g. in rootfinder.scm. * the close menu entry for image and environment windows did not work properly because I was removing them from an array as I was iterating over its elements: fixed. These are the new primitives, graphical ones come first. * string-size returns a pair containing the width and height of the string in the current font * draw-font sets the current font to a font of a given size * draw-string draws a string at the current position and advances the position to just behind the newly drawn string. There is a demo in "text.scm." You will probably have to change the font names in the demo to reflect the fonts that you have on your system e.g. as displayed in the font panel of Ink.app. Additional primitives: * string->symbol * symbol->string * integer->char * char->integer * string-ref * list->string * string->list * make-string * string-append * number->string (works for integers in bases between 2 and 36 and number->decimal floats) The test code for the above is in "strings.scm." I also added caar, caaar and friends to the library, for a total of twelve primitives. Enjoy! Best regards, Marko Riedel -- +------------------------------------------------------------+ | Marko Riedel, EDV Neue Arbeit gGmbH, [EMAIL PROTECTED] | | http://www.geocities.com/markoriedelde/index.html | +------------------------------------------------------------+ _______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
