f-script-talk Mailing List for F-Script (Page 13)
Brought to you by:
pmougin
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(8) |
May
(12) |
Jun
(3) |
Jul
(5) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(4) |
2003 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(14) |
Jun
(5) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
|
2004 |
Jan
(3) |
Feb
(9) |
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
(3) |
Aug
(3) |
Sep
(11) |
Oct
(29) |
Nov
|
Dec
(3) |
2005 |
Jan
(8) |
Feb
(12) |
Mar
|
Apr
(1) |
May
(31) |
Jun
|
Jul
(7) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
(13) |
Feb
(1) |
Mar
(5) |
Apr
(3) |
May
(1) |
Jun
(13) |
Jul
(2) |
Aug
(22) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
|
2007 |
Jan
(7) |
Feb
(3) |
Mar
(2) |
Apr
(5) |
May
|
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(3) |
Nov
(12) |
Dec
(5) |
2008 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(31) |
Jul
(9) |
Aug
(10) |
Sep
(3) |
Oct
(4) |
Nov
|
Dec
|
2009 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jonathan 'W. R. <ni...@re...> - 2004-09-11 03:51:52
|
Marcel Weiher, ma...@me..., wrote: >Expressing such things as message sends in as direct a fashion as >possible was always the goal of HOM, so it should be no surprise that >it works directly: > > [[NSDate collect] dateWithNaturalLanguageString: [dateStringArray >each]]; > >And yes, the last time I checked, HOM worked through F-Script. Cool! I glanced at your HOM but haven't really banged on it. Thanks for whetting my appetite! | Jonathan 'Wolf' Rentzsch http://rentzsch.com | Red Shed Software http://redshed.net | "better" necessarily means "different" |
From: Marcel W. <ma...@me...> - 2004-09-11 02:20:18
|
Hello Jonathan, On 10 Sep 2004, at 02:49, Jonathan 'Wolf' Rentzsch wrote: > I have an array of strings representing dates. I'd list to transform it > into an array of NSDates. I currently have: > >> a := {'7/26/04 7:35:00 PM', '7/27/04 11:33:00 AM'} >> [:e|NSDate dateWithNaturalLanguageString:e] value:@a > > This works, but is there a way to express this as a message send? > Something like: Expressing such things as message sends in as direct a fashion as possible was always the goal of HOM, so it should be no surprise that it works directly: [[NSDate collect] dateWithNaturalLanguageString: [dateStringArray each]]; And yes, the last time I checked, HOM worked through F-Script. Cheers, Marcel |
From: Jonathan 'W. R. <ni...@re...> - 2004-09-10 01:48:25
|
Greetings all, I have an array of strings representing dates. I'd list to transform it into an array of NSDates. I currently have: > a := {'7/26/04 7:35:00 PM', '7/27/04 11:33:00 AM'} > [:e|NSDate dateWithNaturalLanguageString:e] value:@a This works, but is there a way to express this as a message send? Something like: a [:e|NSDate dateWithNaturalLanguageString:e] Failing really elegant syntax, about about something Smalltalkish like: a do:[:e|NSDate dateWithNaturalLanguageString:e] | Jonathan 'Wolf' Rentzsch http://rentzsch.com | Red Shed Software http://redshed.net | "better" necessarily means "different" |
From: steve h. <ste...@ya...> - 2004-09-02 15:53:56
|
If I want to take, say the converter tutorial, and turn it into a double clickable/installable os x app just like any other. How do I do that? _______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush |
From: Philippe M. <pm...@ac...> - 2004-08-27 01:04:56
|
F-Script 1.2.7 release candidate is now available for download and test. Binaries + documentation -> http://www.fscript.org/download/FScriptBin-20040821.tar.gz Sources -> http://www.fscript.org/download/FScriptSources-20040821.tar.gz This version comes with plenty of new features (including Core Data support, pointer dereferencing, improved object browser etc.), which are described in the release notes included in the packages. I plan to publicly announce the release in a few weeks if no major problems are found in this version. Your feedback and comments are welcome. Best, Philippe Mougin |
From: Philippe M. <pm...@ac...> - 2004-08-01 14:06:03
|
Le 1 ao=FBt 04, =E0 07:12, jcb a =E9crit : > How do you send a pointer to an object as a parameter to a message? > We use the Pointer class to deal with pointers. See page 118 in the=20 F-Script manual. > I set up: > error :=3D NSDictionary > leScript :=3D NSAppleScript alloc > leScript initWithSource:'tell application \"Firefox\" activate end=20 > tell' > and then try > > leScript executeAndReturnError:&error Try this instead: error :=3D Pointer malloc:8. leScript :=3D NSAppleScript alloc initWithSource:'tell application=20 "Terminal" \n activate \n end tell'. leScript executeAndReturnError:error. This should activate the Terminal application. Note that you can't directly dereference Pointer objects with F-Script.=20= In this case, this means that you can't get at the dictionary pointed=20 by "error" if there is an error during the execution of the Applescript=20= script. This limitation will be removed in the next version of=20 F-Script, where we will have support for dereferencing. Best, Phil |
From: jcb <jc...@fa...> - 2004-08-01 05:12:15
|
How do you send a pointer to an object as a parameter to a message? I set up: error := NSDictionary leScript := NSAppleScript alloc leScript initWithSource:'tell application \"Firefox\" activate end tell' and then try leScript executeAndReturnError:&error no...how about leScript executeAndReturnError:#error leScript executeAndReturnError:error ...none of these are a pointer, which is what executeAndReturnError wants. Help! --jcurns |
From: Philippe M. <pm...@ac...> - 2004-07-31 21:07:50
|
The article you cited is a bit unclear on this point. The object browser does not automatically find all the object instances in the current application. It only displays either: - The object you provide to it if you open it using the browse: method defined on class System. Example: sys browse:'hello' - The objects that are defined in your F-Script workspace. Those are the objects that you (or some routine) have assigned to an F-Script variable (ex: the instruction "A := 6" assigns an NSNumber with a value of 6 to the variable A). Note that "sys" is a special variable that is automatically defined in your F-Script workspace. - The object that you select with the "Select view" button. - All the classes linked in the current application, when you use the "Classes" button From these objects, and by invoking the appropriate methods, you can often navigate to the objects that are of interest to you. Example: Clicking on the "Classes" button gives the list off all the classes in the application. Selecting the "NSUserDefault" class gives the list of class method for this class. Clicking on the "standardUserDefault" method invokes it and gives an NSUserDefault instance. Selecting it gives the list of its methods. Clicking on the "dictionaryRepresentation" method invokes it and returns a dictionary containing the current user default settings, etc... > and even with "select view" i cannot simply edit the text of a > value and manipulate the app in real-time. The browser lets you manipulate the app in real time by invoking methods on objects (by definition, objects are supposed to be manipulated like that: think encapsulation, abstract data type, etc...) Example: using the "select view" feature, select a button. The browser should display it (as well as some of its attributes). Select it in the object browser (click on the first row). The object browser should now display its methods. Now click on the "setTitle:" method, provide a string in the sheet that asks you for arguments (for instance type: 'hello' (with the simple cotes)), press return and look at your button on screen. Its title should now reads "hello". Best, Phil |
From: zuzu <sea...@gm...> - 2004-07-31 05:43:05
|
http://www.macdevcenter.com/lpt/a/1364 "When the browser opens, it displays a textual description of an object or list of objects. To do this, the browser asks objects for their description by sending the message printString. If you are familiar with F-Script, you will know that all objects respond to this message, whose default behavior is to call the standard NSObject method description. When you are browsing your workspace, the name of each variable is displayed to the left of the corresponding object description. Once you have identified the object to which you will send a message, you just need to select it by clicking on it." uh, no, no it doesn't. not for me on osx 10.2... instead the object browser merely displays "sys = <an instance of System>" i can use "select view" to click on gui objects to reveal NSButton or NSView... but that doesn't help me with NSObject, or getting a feel for the _mapping_ of the objects in an application. for example, i want to understand how TextEdit.app is composed... i've got it linked to F-Script with 'F-Script Anywhere'... supposidly it *should* display the instances of the objects loaded, their methods and values. but other than "select view", it doesn't. and even with "select view" i cannot simply edit the text of a value and manipulate the app in real-time. what am i doing wrong, with the intention of using the objective-c runtime to introspect running applications? TIA, -z p.s. sorry if this is a repeat post; i haven't received a list copy back yet, so i may have sent it before receiving membership confirmation (thus rejected by the system at the time). |
From: zuzu <sea...@gm...> - 2004-07-31 04:41:51
|
http://www.macdevcenter.com/lpt/a/1364 "When the browser opens, it displays a textual description of an object or list of objects. To do this, the browser asks objects for their description by sending the message printString. If you are familiar with F-Script, you will know that all objects respond to this message, whose default behavior is to call the standard NSObject method description. When you are browsing your workspace, the name of each variable is displayed to the left of the corresponding object description. Once you have identified the object to which you will send a message, you just need to select it by clicking on it." uh, no, no it doesn't. not for me on osx 10.2... instead the object browser merely displays "sys = <an instance of System>" i can use "select view" to click on gui objects to reveal NSButton or NSView... but that doesn't help me with NSObject, or getting a feel for the _mapping_ of the objects in an application. for example, i want to understand how TextEdit.app is composed... i've got it linked to F-Script with 'F-Script Anywhere'... supposidly it *should* display the instances of the objects loaded, their methods and values. but other than "select view", it doesn't. and even with "select view" i cannot simply edit the text of a value and manipulate the app in real-time. what am i doing wrong, with the intention of using the objective-c runtime to introspect running applications? TIA, -z |
From: Philippe M. <pm...@ac...> - 2004-04-30 18:12:55
|
Le 30 avr. 04, =E0 19:35, jcb a =E9crit : > Seems like this should work: > > leAddress :=3D ABAddressBook sharedAddressBook > > newPerson :=3D (ABPerson alloc) init > > newPerson setValue:'Kilgore' forProperty:kABFirstNameProperty > > newPerson setValue:'Trout' forProperty:kABLastNameProperty > > leAddress addPerson:newPerson > > error: an instance of ABAddressBook does not respond to "addPerson:" > Indeed, there is no addPerson: method defined on the ABAddressBook =20 class (as described in =20 http://developer.apple.com/documentation/UserExperience/Reference/=20 AddressBook/ObjC_classic/Classes/ABAddressBook.html). There is, however, an addRecord: method. This is probably what you want =20= to use. > > And this doesn't work either: > > newProps :=3D NSMutableDictionary dictionary > > newProps setObject:kABStringProperty forKey:'Favorite color' > > newProps setObject:kABStringProperty forKey:'College' > > newPerson addPropertiesAndTypes:newProps > > error: an instance of ABPerson does not respond to =20 > "addPropertiesAndTypes:" > > What am I doing wrong? > addPropertiesAndTypes: is a class method, not an instance method. You =20= can't invoke it on an instance of ABPerson, you are supposed to invoke =20= it on the ABPerson class itself. Best, Philippe Mougin |
From: jcb <jc...@fa...> - 2004-04-30 17:35:58
|
Seems like this should work: leAddress := ABAddressBook sharedAddressBook newPerson := (ABPerson alloc) init newPerson setValue:'Kilgore' forProperty:kABFirstNameProperty newPerson setValue:'Trout' forProperty:kABLastNameProperty leAddress addPerson:newPerson error: an instance of ABAddressBook does not respond to "addPerson:" And this doesn't work either: newProps := NSMutableDictionary dictionary newProps setObject:kABStringProperty forKey:'Favorite color' newProps setObject:kABStringProperty forKey:'College' newPerson addPropertiesAndTypes:newProps error: an instance of ABPerson does not respond to "addPropertiesAndTypes:" What am I doing wrong? --jcburns |
From: Philippe M. <pm...@ac...> - 2004-04-19 01:50:26
|
Thanks for your comments and your questions. Better than the spam we got recently on this list! > Okay, if no one else is asking, I have a couple of questions to put > out there (instead of spam). > > I'm playing with F-script nearly all the time. It's great fun...very > educational. > > But I do have these questions: > > 1) How do you remove an object (completely) from the sys workspace? > I've tried releasing them, but no. If I add NSWindow objects to the > workspace, I can't do saveSpace because NSWindows can't be archived > (freeze-dried), the error tells me. > An object is in the workspace if it is referenced by an F-Script variable or if it is referenced by an object which is in the workspace. This is why the workspace is usually a whole, complex, object graph. To remove an object from the workspace you have to make sure that it is neither referenced by an F-Script variables, nor by an object that is itself part of the workspace. For instance: > myWindow := NSWindow alloc initWithContentRect:(125<>513 extent:400<>200) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO. > array := {1, 2, 3, myWindow} After executing these two instructions, I have two more variables in my workspace: myWindow and myArray. To remove the window from the workspace I have to make sure that it is no more referenced by the "myWindow" variable, and no more referenced by the array (because the array is itself part of the workspace). To do that I might execute: > myWindow := nil and > array removeObjectAtIndex:3 > 2) How do you display a sheet (say, an alert) in a window. I keep > getting: > > error: argument 3 of method > beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo: > must be a compact Block > > What is a compact block? And why must it be there? > A compact block is something of the form: #mySelector It is the way to represents selectors in F-Script. In Objective-C, you would use @selector(mySelector) to denote the same selector. Compact blocks are automatically mapped to Objective-C selectors when passed as arguments to methods. Objective-C has both object types and non-object types. For instance, in Objective-C, selectors are not objects. In F-Script, everything is an object. This is why we need to define this kind of mapping between Objective-C non-object types and F-Script objects. Note that compact block are named like this because they are instances of the Block class, and thus can be manipulated like regular blocks. > And these comments: > > It's frustrating not to be able to use Cocoa convenience methods like > NSMakeRect and NSMakePoint. The end experience is that drawing becomes > a lot different from Cocoa (probably more like Smalltalk.) The problem here is that F-Script let you invoke Objective-C methods, but not functions like NSMakeRect etc. This is not a design decision, but a current limitation of F-Script. BTW, you're right, the F-Script way of dealing with points and rectangles is more Smalltalk-like. > It's frustrating that the journaling/log of a F-Script session isn't > saved between sessions. What's the point? I suppose you refer to the fact that the journal is reset when a new session begins. Well, I used the journal a lot, when developing the first versions of F-Script, as a way to record what I was doing in order to have that information when F-Script crashed. But your idea to keep the old records is interesting. Best, Philippe Mougin > I sure could use some examples of how to work with NSMatrix or NSCells > using F-Script's matrix orientation. > > Thanks for any enlightenment... > > --jcburns |
From: jcb <jc...@fa...> - 2004-04-18 15:29:56
|
Okay, if no one else is asking, I have a couple of questions to put out there (instead of spam). I'm playing with F-script nearly all the time. It's great fun...very educational. But I do have these questions: 1) How do you remove an object (completely) from the sys workspace? I've tried releasing them, but no. If I add NSWindow objects to the workspace, I can't do saveSpace because NSWindows can't be archived (freeze-dried), the error tells me. 2) How do you display a sheet (say, an alert) in a window. I keep getting: error: argument 3 of method beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo: must be a compact Block What is a compact block? And why must it be there? And these comments: It's frustrating not to be able to use Cocoa convenience methods like NSMakeRect and NSMakePoint. The end experience is that drawing becomes a lot different from Cocoa (probably more like Smalltalk.) It's frustrating that the journaling/log of a F-Script session isn't saved between sessions. What's the point? I sure could use some examples of how to work with NSMatrix or NSCells using F-Script's matrix orientation. Thanks for any enlightenment... --jcburns |
From: Enola B. <dqt...@na...> - 2004-04-15 22:56:15
|
minuscule ranks aide presence matterhorn artocarpus firebrick dicta beaked henpecked nonexempt querist palatial clerk falsie pitymys harry integument fascia troubadour servente unfoldment hyperon theism vambrace headache casablanca meristem smeared unicorn pullman |
From: Philippe M. <pm...@ac...> - 2004-04-01 21:34:39
|
Hi, The release candidate announced here a few days ago has been released as "F-Script 1.2.6". Release notes are available on-line at http://www.fscript.org/releaseNotes/ You can download F-Script 1.2.6 from http://www.fscript.org/download/download.htm Best, Philippe Mougin |
From: Philippe M. <pm...@ac...> - 2004-03-25 12:15:03
|
Hi, F-Script 1.2.6 release candidate is now available for download and test. Binaries + documentation -> http://www.fscript.org/download/FScriptBin-20040324.tar.gz Sources -> http://www.fscript.org/download/FScriptSources-20040324.tar.gz This version comes with many new features, which are described in the release notes included in the packages. I plan to publicly announce the release in a few days if no major problems are found in this version. Best, Philippe Mougin |
From: Philippe M. <pm...@ac...> - 2004-02-21 17:13:27
|
Le 21 f=E9vr. 04, =E0 14:14, Philippe de Rochambeau a =E9crit : > is there a way to clear the console in FScript? No easy way to do that. > Could code contained in a text file be loaded in a FScript block using=20= > Cocoa? Sure. For instance, I have a text file named "block.txt" stored on my=20 desktop, containing the source code of a block. I turn it into a block=20= in F-Script by loading it into an NSString and creating a block using=20 the "blockFromString:" method defined in class System. Example (in=20 F-Script): sys blockFromString: (NSString=20 stringWithContentsOfFile:'/Users/pmougin/Desktop/block.txt') If you don't have a System instance at hand (for example, suppose=20 you're doing this directly from Objective-C instead of F-Script), you=20 can use the "asBlock:" method defined in FSNSString (a category of=20 NSString provided by F-Script). Example (in Objective-C): [[NSString=20 stringWithContentsOfFile:@"/Users/pmougin/Desktop/block.txt"] asBlock] Best, Philippe Mougin= |
From: Philippe M. <pm...@ac...> - 2004-02-21 16:52:28
|
None that I am aware of. I know that Brian Hill (whose web site is at=20 http://personalpages.tds.net/~brian_hill/index.html) once developed an=20= Apache module called FSWeb to run F-Script server-side but I don't=20 think it is still maintained. However, there are several Smalltalk-based solutions for writing and=20 running web applications. An example is Seaside, at=20 http://beta4.com/seaside2/ Best, Philippe Mougin Le 21 f=E9vr. 04, =E0 05:19, Jan Steinman a =E9crit : > Sorry if this has been discussed, but is there an Apache module, or=20 > any other easy way to use f-script as a server-side scripting=20 > language? > > I'm fighting bugs in PHP, and keep thinking, "Gee, this would be a=20 > whole lot easier in Smalltalk or Objective-C..." > > : If a cluttered desk signs a cluttered mind, > : of what, then, is an empty desk a sign? > : Jan Steinman <http://www.Bytesmiths.com> > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick > _______________________________________________ > F-Script-talk mailing list > F-S...@li... > https://lists.sourceforge.net/lists/listinfo/f-script-talk > |
From: Philippe de R. <phi...@ww...> - 2004-02-21 13:21:39
|
Hello, is there a way to clear the console in FScript? Could code contained in a text file be loaded in a FScript block using Cocoa? PR |
From: Jan S. <Ja...@By...> - 2004-02-21 04:26:02
|
Sorry if this has been discussed, but is there an Apache module, or any other easy way to use f-script as a server-side scripting language? I'm fighting bugs in PHP, and keep thinking, "Gee, this would be a whole lot easier in Smalltalk or Objective-C..." : If a cluttered desk signs a cluttered mind, : of what, then, is an empty desk a sign? : Jan Steinman <http://www.Bytesmiths.com> |
From: Philippe M. <pm...@ac...> - 2004-02-21 00:50:17
|
Alas, no plan currently to implements access to OpenGL functions from=20 F-Script. As you experienced, F-Script only allows you to invoke Objective-C=20 methods, not C functions. In general, when you need to interface to=20 specific C functions from F-Script, it is relatively easy, for=20 Objective-C programmers, to wrap C-function with Objective-C methods=20 and call the latter from F-Script. This might be tedious if you need to=20= wrap a large set of C functions, tough. Best, Phil Le 21 f=E9vr. 04, =E0 01:17, Philippe de Rochambeau a =E9crit : > Philippe, > > do you have any plans to implement the OpenGLfunctions in FScript? > > I have tried to code tutorial0, which is available here=20 > http://divide.zerobyzero.ca/, in FScript, but to no avail because the=20= > OpenGL gl... functions are not accessible. > > Here's my code (the bottom part is untranslated Objective-C) for=20 > illustrative purposes, in case anyone is interested. > > ------------- > > scrWidth :=3D NSScreen mainScreen visibleFrame size width. > scrHeight :=3D NSScreen mainScreen visibleFrame size height. > winWidth :=3D 400. > winHeight :=3D 400. > "Centrer" > winX :=3D (scrWidth / 2) - (winWidth / 2). > winY :=3D (scrHeight / 2) - (winHeight / 2). > > "Instantiate and configure a window" > window :=3D NSWindow alloc initWithContentRect:(winX<>winY=20 > extent:winWidth<>winHeight) > styleMask:NSTitledWindowMask + NSClosableWindowMask+ > NSMiniaturizableWindowMask + NSResizableWindowMask > backing:NSBackingStoreBuffered defer:NO. > > "Put the window on screen" > window orderFront:nil. > > "Give a title to the window" > window setTitle:'Currency Converter'. > > nsgl :=3D NSOpenGLView alloc. > nsgl initWithFrame:winX<>winY winWidth<>winHeight . > > "Initialization" > nsglFormat :=3D NSOpenGLPixelFormat. > "NSOpenGLPixelFormatAttribute est juste un =E9num=E9ration de = constantes" > attr :=3D { > NSOpenGLPFADoubleBuffer, > NSOpenGLPFAAccelerated, > NSOpenGLPFAColorSize, BITS_PER_PIXEL, > NSOpenGLPFADepthSize, DEPTH_SIZE, > 0 }. > > > nsgl setPostsFrameChangedNotifications:YES. > > nsglFormat :=3D (NSOpenGLPixelFormat alloc) initWithAttributes:attr. > nsgl pixelFormat:nsglFormat. > > nsglFormat :=3D nil. > > (nsgl openGLContext) makeCurrentContext). > > "initGL method" > > glClearColor(0.0f, 0.0f, 0.0f, 0.0f); > > // Set the clear depth to 1. This is the initial (default) value. > // Set the depth function. This specifies when something will be = drawn. > // GL_LESS passes if the incoming > // depth value is LESS than the current value > // Turn the depth test on > > glClearDepth(1.0f); > glDepthFunc(GL_LESS); > glEnable(GL_DEPTH_TEST); > > // Set up a hint telling the computer to create the nicest (aka=20 > "costliest" or "most correct") > // image it can > // This hint is for the quality of color and texture mapping > > glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); > > // This hint is for antialiasing > > glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); > > ---------= |
From: Philippe de R. <phi...@ww...> - 2004-02-21 00:24:22
|
Philippe, do you have any plans to implement the OpenGLfunctions in FScript? I have tried to code tutorial0, which is available here=20 http://divide.zerobyzero.ca/, in FScript, but to no avail because the=20 OpenGL gl... functions are not accessible. Here's my code (the bottom part is untranslated Objective-C) for=20 illustrative purposes, in case anyone is interested. ------------- scrWidth :=3D NSScreen mainScreen visibleFrame size width. scrHeight :=3D NSScreen mainScreen visibleFrame size height. winWidth :=3D 400. winHeight :=3D 400. "Centrer" winX :=3D (scrWidth / 2) - (winWidth / 2). winY :=3D (scrHeight / 2) - (winHeight / 2). "Instantiate and configure a window" window :=3D NSWindow alloc initWithContentRect:(winX<>winY=20 extent:winWidth<>winHeight) styleMask:NSTitledWindowMask + NSClosableWindowMask+ NSMiniaturizableWindowMask + NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO. "Put the window on screen" window orderFront:nil. "Give a title to the window" window setTitle:'Currency Converter'. nsgl :=3D NSOpenGLView alloc. nsgl initWithFrame:winX<>winY winWidth<>winHeight . "Initialization" nsglFormat :=3D NSOpenGLPixelFormat. "NSOpenGLPixelFormatAttribute est juste un =E9num=E9ration de = constantes" attr :=3D { NSOpenGLPFADoubleBuffer, NSOpenGLPFAAccelerated, NSOpenGLPFAColorSize, BITS_PER_PIXEL, NSOpenGLPFADepthSize, DEPTH_SIZE, 0 }. nsgl setPostsFrameChangedNotifications:YES. nsglFormat :=3D (NSOpenGLPixelFormat alloc) initWithAttributes:attr. nsgl pixelFormat:nsglFormat. nsglFormat :=3D nil. (nsgl openGLContext) makeCurrentContext). "initGL method" glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Set the clear depth to 1. This is the initial (default) value. // Set the depth function. This specifies when something will be drawn. // GL_LESS passes if the incoming // depth value is LESS than the current value // Turn the depth test on glClearDepth(1.0f); glDepthFunc(GL_LESS); glEnable(GL_DEPTH_TEST); // Set up a hint telling the computer to create the nicest (aka=20 "costliest" or "most correct") // image it can // This hint is for the quality of color and texture mapping glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // This hint is for antialiasing glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); --------- =20= |
From: Philippe M. <pm...@ac...> - 2004-02-20 23:20:16
|
The method "log:" in class System can be used to achieve the same=20 effect than a call to NSLog() in Objective-C (i.e., logging a message=20 on stderr) . A predefined instance of System, named "sys" is always=20 defined. Example: sys log: 'scrWidth''s value is ' ++ scrWidth printString Note that NSLog() is used internally by the log: method. -------- F-Script does not define any new API to print something to stdout. You=20= can use the standard Cocoa classes, or roll your own. For instance,=20 using the Cocoa classes: NSFileHandle fileHandleWithStandardOutput writeData:('hello, world'=20 dataUsingEncoding:NSASCIIStringEncoding). This will print "hello, world" to stdout. Best, Philippe Mougin Le 20 f=E9vr. 04, =E0 13:32, Philippe de Rochambeau a =E9crit : > For instance, > > scrWidth :=3D NSScreen mainScreen visibleFrame size width. > scrHeight :=3D NSScreen mainScreen visibleFrame size height. > winWidth :=3D 400. > winHeight :=3D 200. > winX :=3D (scrWidth / 2) - (winWidth / 20). > winY :=3D (scrHeight / 2) - (winHeight / 20). > > 'scrWidth's value is ' ++ scrWidth. "This does not appear on stdout" > > "Instantiate and configure a window" > window :=3D NSWindow alloc initWithContentRect:(winX<>winY=20 > extent:winWidth<>winHeight) > styleMask:NSTitledWindowMask + NSClosableWindowMask+ > NSMiniaturizableWindowMask + NSResizableWindowMask > backing:NSBackingStoreBuffered defer:NO. > > (...) > > the > > 'scrWidth's value is ' ++ scrWidth. command above does not work. > > Many thanks. > > Philippe de Rochambeau |
From: Philippe de R. <phi...@ww...> - 2004-02-20 12:38:50
|
For instance, scrWidth := NSScreen mainScreen visibleFrame size width. scrHeight := NSScreen mainScreen visibleFrame size height. winWidth := 400. winHeight := 200. winX := (scrWidth / 2) - (winWidth / 20). winY := (scrHeight / 2) - (winHeight / 20). 'scrWidth's value is ' ++ scrWidth. "This does not appear on stdout" "Instantiate and configure a window" window := NSWindow alloc initWithContentRect:(winX<>winY extent:winWidth<>winHeight) styleMask:NSTitledWindowMask + NSClosableWindowMask+ NSMiniaturizableWindowMask + NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO. (...) the 'scrWidth's value is ' ++ scrWidth. command above does not work. Many thanks. Philippe de Rochambeau |