TweetFollow Us on Twitter

The SSCLI: Managed Languages, Samples and (more) Programming Utilities

Volume Number: 20 (2004)
Issue Number: 2
Column Tag: Programming

Casting Your .NET

by Andrew Troelsen

The SSCLI: Managed Languages, Samples and (more) Programming Utilities

Exploring .NET development on Mac OS X

Patching the SSCLI on Panther

Before we dig into the meat of this month's installment, allow me to address an issue regarding the process of building the SSCLI. Like myself, you may have purchased and installed Mac OS 10.3 (Panther) on your development machines. As you are aware, Panther upgrades numerous core Unix tools, including gcc (the GNU Compiler Collection). Given these changes, the Shared Source CLI will fail to build on new Panther machines, while upgrading an existing installation of Mac OS 10.2 to 10.3 may cause certain SSCLI command tools to become 'funky' (e.g., fail to execute).

Lucky for us, various independent patches do exist (as of today, no official patch from Microsoft exists, but check the SSCLI web site every now and again). The patch that I used to rebuild the SSCLI after installing Panther was developed by Dr Nigel Perry at the University of Canterbury. Now, given that your machine may have specific customizations, I cannot guarantee that the path I took to patch the SSCLI will be identical to your own. However here are the steps that worked for me:

  • Download the patch (rotor_mark2_diffs.txt.gz) from http://www.mondrian-script.org/rotor/

  • Run the gunzip utility to extract the patch file (panther_mark2_diffs.txt) and copy it to /sscli directory

  • Apply the patch by changing to your /sscli directory and run the following Terminal command (Listing 1)

Listing 1. Patching the SSCLI on Panther

patch -p1 <panther_mark2_diffs.txt

At this point, you can rebuild the SSCLI as described in the November issue. It is worth noting that I needed to issue the './buildall' command more than once to fully rebuild the entire code base (while selectively ignoring non-critical build-errors). In any case, hopefully these instructions will do the trick. With this out of the way, let's dig deeper into the SSCLI.

Select Samples of the SSCLI

As mentioned in a previous article, the SSCLI ships with various sample applications that illustrate numerous aspects of the CLI (Common Language Infrastructure) and Base Class Libraries (BCL), the full list of which can be viewed by opening /sscli/samples/samples_index.html. In this installment, I'll introduce you to some (but by no means all) intriguing sample applications, specifically:

  • The JScript.NET, cLisp and myC compilers

  • Codetohtml, corcls and typefinder

  • Pigpad

Understand that the goal of this issue is not to dive into all the gory details of the underlying technologies surrounding these samples. Rather, here we will learn about a number of samples that either (a) explore the language and platform agnostic aspects of .NET or (b) showcase useful developer tools. Rest assured that the technologies used in these sample applications (such as reflection and dynamic code generation) will be explored at a later time.

Before we begin, recall that the /sscli/samples directory contains a majority of the SSCLI sample code. You may directly view, modify and compile these files at the command line using csc (detailed in the December issue). Also recall the SSCLI sample applications are compiled when you build the SSCLI and are placed under the /sscli/build/v1.ppcfstchk.rotor/samples directory. These applications are ready to run at the Terminal (or xterm) using the clix application launcher. Pick your poison, enable an SSCLI Terminal session, and read on.

Exploring the Alternative 'Managed Languages' of the SSCLI

In the .NET universe, the term managed language refers to a programming language which is .NET aware; meaning, the corresponding compiler (a.k.a. a managed compiler) has been updated to understand the .NET platform. Out of the box, the SSCLI ships with a total of five managed compilers (two of which are research-oriented in nature):

  • The C# compiler (csc)

  • The raw CIL compiler (ilasm)

  • The JScript.NET compiler (jsc)

  • An experimental LISP-based .NET compiler (cLisp)

  • An experimental C-based .NET compiler (myC)

Given that the previous issue examined the basic details of working with csc and ilasm, let's take some time to examine the three remaining managed compilers of the SSCLI.

The JScript.NET Compiler

The JScript.NET compiler allows you to build .NET solutions using the syntax of the JScript (a.k.a. ECMA-script) language. Unlike traditional JScript however, the JScript.NET compiler (jsc) transforms the input *.js files into a true-blue .NET assembly rather than a simple blurb of code to be processed by a scripting engine. In addition to this compelling change, JScript.NET also supports the following enhancements to the original ECMA 262 specification:

  • Support for strongly typed data

  • Full-blown object-orientation

  • Support for type partitioning via 'packages'

  • Complete access to the .NET base class libraries

The JScript.NET compiler that ships with the SSCLI is very interesting in that the jsc code base (located under /sscli/jscript) is authored entirely in C#! Thus, given that jsc is in fact a .NET assembly, it must be executed via clix.

To view each of the options provided by the JScript.NET compiler, change to the directory containing jsc (/sscli/build/v1.ppcfstchk.rotor) and issue the following command from an SSCLI-enabled Terminal (Listing 2):

Listing 2. Launching the JScript.NET Compiler via clix

clix jsc

As you can see from the resulting output, many of the options provided by jsc are identical to those of csc. For example, jsc supports /output, /target and /reference flags as well as support for response files. One feature of jsc is unique however, and is described in Table 1.

The interesting option of jsc Meaning in Life

autoref This option (which is enabled by default) informs the compiler to automatically reference external assemblies based on the list of import statements in your *.js code files. Using this feature, you are not required to explicitly specify assemblies using the /r flag (as you would need to do in C#).

Table 1. The interesting flag of the JScript.NET compiler

While this is not the place to examine each and every aspect of the JScript.NET programming language, Listing 3 provides some sample code to use throughout this article:

Listing 3. SimpleJScript.js

// 'import' is a JScript.NET specific 
// keyword use to reference .NET namespaces. 
import System;  

// A simple class type.
class Person
{
       // State data of the type. 
   private var mName : String;
   private var mAge : int;

       // Type constructor.
   function Person(name : String, age : int)
   {
      this.mName = name;
      this.mAge = age;
   }
       // A read-only 'property'
   function get Name() : String
   {
      return this.mName;
   }
       // Read-write property. 
   function get Age() : int
   {
      return this.mAge;
   }
   function set Age(newAge : int)
   {
      if ((newAge >= 0) && (newAge <= 130))
         this.mAge = newAge;
      else
      {
         Console.WriteLine("Ug...bad value...");
      }
   }
}

// Prompt user for information about this person. 
Console.WriteLine("**The Amazing JScript.NET App**");
Console.Write("Enter person's name: ");
var name : String = Console.ReadLine();
Console.Write("Enter initial age of person: ");
var age : int = int.Parse(Console.ReadLine());

// Now create a person using input. 
var myPerson : Person = new Person(name, age);

// print name using intrinsic JScript f(x). 
print(myPerson.Name);

// Base class library call. 
Console.WriteLine(myPerson.Age);

// Change age with Age property and reprint. 
chucky.Age = 26;
Console.WriteLine("{0} is now {1} years old.", 
  myPerson.Name, myPerson.Age);
Console.WriteLine("All done. See ya");

The first point of interest is the JScript.NET 'import' keyword, which is similar in function to the C# 'using' keyword in that it allows you to specify the name of the .NET namespaces this file is manipulating.

Next is the 'class' keyword of JScript.NET used to define a .NET class type named 'Person'. Note that type member variables are defined using the 'var' keyword and the following syntax (Listing 4).

Listing 4. Defining Type Member Variables ala JScript.NET

class Person
{
   // AssessModifier var NameOfVariable : DataTypeOfVariable;
   private var mName : String;
   private var mAge : int;
...
}

Given that these data points have been defined as private, we need to provide a manner in which the object user can safely manipulate these values. Under the .NET platform, encapsulation services are provided (in part) by the use of type properties. Simply put, properties are get (accessor) and set (mutator) methods in disguise. Here, our Person class defines a read-only property termed Name and a read/write property named Age.

In JScript.NET, properties are declared using the 'function get' and 'function set' keywords. Like a traditional accessor/mutator pair, properties are used to control access to state data. In the case of our read-only Name property, we are returning a copy of the private mName member variable (Listing 5).

Listing 5. A Read-Only Property ala JScript.NET

class Person
{
       // AssessModifier var NameOfVariable : DataTypeOfVariable;
   private var mName : String;
   private var mAge : int;
...
}

The Age property is a bit more interesting in that the function set method performs simple data validation on the incoming parameter (Listing 6).

Listing 6. A Read/Write Property ala JScript.NET

// Note that properties must be defined
// with regard to the type of data they
// encapsulate.
function get Name() : String
{
   return this.mName;
}

The major benefit of using .NET properties, over accessor/mutator methods such as GetAge() and SetAge(), is the fact that it simplifies the syntax for the object user. Thus, rather than authoring the following Java-like code (Listing 7):

Listing 7. Traditional Get/Set methods

// Encapsulation using accessor/mutator methods. 
myPerson.SetAge(30);
var theAge : int = myPerson.GetAge();

We can simply write the following (Listing 8):

Listing 8. Properties in action

// Encapsulation using .NET properties.
myPerson.Age = 30; // Triggers set functionality.
var theAge : int = myPerson.Age; // Triggers get functionality.

Notice how properties provide the illusion that you are accessing a point of public data (which would be bad insofar the that would break encapsulation) while still honoring your data validation logic.

The final point is the block of 'freestanding' code at the end of the SimpleJScript.js file. Notice that we are blending the use of the .NET System.Console type as well as the JScript 'print' function to print our the values of the person to the Terminal window (Listing 9).

Listing 9. Blending BCL types with intrinsic JScript function calls

// Now create a person using input. 
var myPerson : Person = new Person(name, age);

// print name using intrinsic JScript f(x). 
print(myPerson.Name);

// Base class library call. 
Console.WriteLine(myPerson.Age);

Compiling and Running our JScript.NET Application

Assuming you have saved the previous code to a file named SimpleJScript.js, you can compile this file into a .NET code library with the command shown in Listing 10 (assure the input file is in the same location as jsc. If not, supply the full path):

Listing 10. Compiling our *.js file

clix jsc SimpleJScript.js

You can now run your assembly as you would expect (Listing 11).

Listing 11. Launching the JScript.NET compiler via clix

clix SimpleJScript 

Figure 1 illustrates one possible session.


Figure 1. SimpleJScript.exe at work.

Dissassembling Our JScript.NET-Based Assembly

If you have been playing around with the C# programming language, it may surprise you that JScript.NET allows programmers to define programming logic not contained within a type definition. C# (as well as most other .NET-aware languages) demand that all programming logic be contained within a type or type member definition. In reality, the same constraint is found with JScript.NET, however the compiler will take care of the details on your behalf. To illustrate, load your SimpleJScript.exe assembly into ildasm (Listing 12).

Listing 12. Dissecting SimpleJScript via ildasm

ildasm SimpleJScript 

As you look over the output, you will find that all of the global code has been automatically placed in a method named (surprise, surprise) 'Global Code', which is defined within a type named 'JScript 0'. This class type extends Microsoft.JScript.GlobalScope, which is defined within a helper assembly named Microsoft.JScript.dll (located under the /sscli/build/v1.ppcfstchk.rotor directory). Listing 13 shows the CIL of the type in question (edited for clarity).

Listing 13. The auto-generated 'JScript 0' Class Type

.class public auto ansi 'JScript 0'
  extends [Microsoft.JScript]
Microsoft.JScript.GlobalScope
{
  .method public instance object 
    'Global Code'() cil managed
  {

    // All of your global code is placed here...
  }
}

In addition to the 'JScript 0' type, jsc also generates a class named 'JScript Main' that defines the application's entry point: Main(). The Main() method leverages several types within the Microsoft.JScript.dll assembly to execute the program. Listing 14 hits the highlights.

Listing 14. The auto-generated Main() method

.class public auto ansi 'JScript Main'
  extends [mscorlib]System.Object
{
  .method public static void Main(string[] A_0) 
    cil managed
  {
    .entrypoint

    // Define a variable of type GlobalScope.
    .locals init (class [Microsoft.JScript]
      Microsoft.JScript.GlobalScope V_0)
...
    // Create the 'JScript 0' object.
    IL_001e: newobj instance void 
     'JScript 0'::.ctor(class[Microsoft.JScript]
     Microsoft.JScript.GlobalScope)
...
    // Now call the 'Global Code()' method.
    IL_0023:  call instance object 
      'JScript 0'::'Global Code'()
    IL_0028:  pop
    IL_0029:  ret
  }
}

This wraps up our exploration of the JScript sample application. If you are interested in exploring JScript.NET in greater detail, hundreds of articles and sample applications can be found online (just be sure to have a space between JScript and .NET when searching [JScript .NET not JScript.NET]).

The cLisp Compiler

The next sample application (cLisp) is a partial LISP compiler that targets the .NET platform. As mentioned, cLisp is more research-orientated in nature, in that it does not implement every aspect of the LISP programming language. However, the code base does provide an excellent foundation for those of you who are interested in extending cLisp with new functionality. As well, if you wish to build your own managed compiler that can function within the SSCLI, cLisp is a solid example to build upon.

Like the JScript.NET compiler, the cLisp compiler is authored in C#. If you navigate to the cLisp directory (/sscli/samples/compilers/clisp), you will find all of the necessary source code. As well, the cLisp directory contains a few *.lisp code files which can be used as input to the cLisp application. For example the fibo.lisp file computes a Fibonacci sequence (Listing 15).

Listing 15. fibo.lisp

(defun Fib (N)
  (if (<= N 0) 
      0 
    (if (= N 1) 
	1 
      (+ (Fib (- N 1)) (Fib (- N 2))
	 )
      )
    )
  )
(defun Fibo (N) (do ((count 0 (+ count 1))
		 (Fibo (car (Fib 0)) (cons Fibo (car (Fib count)))))
		((> count N)
		 Fibo)))
(Fibo 25)

Now, if you can't make heads or tails of the previous LISP code, don't sweat it. The point here is not to examine the syntactic details of LISP, but rather understand how LISP source code can be used to build a valid .NET image. To illustrate, navigate to the /sscli/build/v1.ppcfstchk.rotor/samples directory and compile fibo.lisp into an executable assembly using the following command (Listing 16).

Listing 16. Compiling *.lisp files via cLisp

clix clisp fibo.lisp

The resulting .NET assembly (fibo.exe) may now be launched using clix. Figure 2 shows the program's output.


Figure 2. Fibo.exe at Work.

Much like jsc, cLisp will auto-generate a class type and program entry point behind the scenes (this can be verified by loading Fibo.exe into ildasm). While this example is enticing, understand that given the fact that cLisp is an illustrative compiler, you do not have access to the BCL types.

A Brief Word Regarding the myC Compiler

Last but not least, it is worth pointing out that the SSCLI also ships with another research-oriented managed compiler named myC. This sample exposes a (very) limited subset of the C programming language to the .NET universe. Like cLisp, the sample code further illustrates the process of building a managed compiler. Sscli/samples/compilers/myc/myc.html describes the C# source code files used to build this managed compiler and I'll leave it to you to dig into the details if you so choose.

A Gamut of .NET Programming languages

The .NET platform may be manipulated using numerous programming languages, far beyond those that ship with the SSCLI. In the initial issue of this series (October, 2003) I listed a subset of .NET-aware compilers. If you wish to see a more all-encompassing list, navigate to http://www12.brinkster.com/brianr/languages.aspx. Here you will find links to compilers as diverse as Ada, Forth, Fortran, Java, LOGO (yes, I am not kidding), Mixal and Ruby as well as fully functionally C and LISP compilers.

Keep in mind however that many of these offerings target production level .NET distributions such as Mono, Portable .NET and Microsoft's CLR, and therefore may require a bit of tweaking to execute under the SSCLI. In just a few short issues, we will move from the research-oriented world of the SSCLI to a production-level distribution of the CLI named Portable .NET. At that time I will revisit the use of 'alternative' .NET programming languages.

Code Documentation and Type Analysis Samples

Now that you have had a chance to check out the compiler-centric examples of the SSCLI, we'll examine samples of the code-formatting / assembly-investigation ilk. Each of the examples we will examine here are found under the /samples/utilities subdirectory. First up, codetohtml.exe

The CodeToHtml Sample Application

The codetohtml sample application (which is written in JScript.NET) generates HTML files representing C# or JScript.NET source code. To illustrate codetohtml in action, supply the SimpleJScript.js file created earlier as a command line argument (Listing 17).

Listing 17. Processing SimpleJScript.js

clix codetohtml SimpleJScript.js

Figure 3 shows the default HTML format.


Figure 3. An HTML view of SimpleJScript.js

The runtime behavior of codetohtml is controlled by a set of initialization files, whose exact names are based on the language of the input file (for example, js_codetohtml.ini for JScript.NET and cs_codetohtml.ini for C#). Table 2 describes the role of each *.ini file.

CodeToHtml Initialization File          Meaning in Life
<lang>_codetohtml.ini                   This is the core file which specifies the names 
                                        of the other three related *.ini files as well 
                                        as the associated style sheet to use when generating 
                                        the HTML file.

<lang>_keywords.ini                     Contains a list of all active keywords for the 
                                        given language.

<lang>_futurereserved.ini               Contains a list of reserved keywords for the 
                                        given language.

<lang>_userdefined.ini                  Contains a list of user-defined types (such as 
                                        class names) to be recognized during the 
                                        formatting process.

Table 2. The initialization files of codetohtml

Of course, each of these files may be modified to control the format of the resulting HTML. To begin, open up js_codetohtml.ini using your text editor of choice (Listing 18):

Listing 18. Contents of js_codetohtml.ini

defstylesheet=codeblue.css
keywords=js_keywords.ini
userdefined=js_userdefined.ini
futurereserved=js_futurereserved.ini
replace=js_replace.ini
language=JScript

Note that the default style sheet is named codeblue.css. This may be changed to the other sample style sheet, codewhite.ccs, by updating the defstylesheet value. If you examine either file, you will find a set of styles used to format each token category (keywords, code comments, user defined types and so on). Listing 19 shows a partial listing.

Listing 19. Partial listing of codeblue.css

div.code
{
	background-color: rgb(0,0,128);
	font-family: "Lucida Console", "courier new", courier;
	color: rgb(255,255,0);
	font-size: x-small;
	padding: 1em;
	margin: 1em;
}
...
div.code span.userdefined
{
	color: rgb(51, 51, 0);
	font-weight: bold
}
...

To spice things up a bit, edit js_codetohtml.ini file to point to the codewhite.css style sheet. Next, modify js_userdefined.ini to recognize the System.Console type of the base class libraries by adding Console to the end of the list. At this point, run codetohtml once again specifying SimpleJScript.js as the input file. Notice in Figure 4 that each occurrence of the Console type is rendered using the 'userdefined' style.


Figure 4. Custom code to HTML formatting

Beyond creating custom style sheets for use by codetohtml, you will also want to check out the JScript.NET source code for this example (codetohtml.js) as it illustrates a number of interesting .NET base class library types. As you already know how to interact with the JScript.NET compiler, feel free to hack away to your heart's content.

The corcls and typefinder Sample Applications

Corcls and typefinder are essentially object browsing utilities (written in C#) that provide a lightweight alternative to ildasm. The corcls utility can be helpful when you simply wish to view the C# definition of a given type, rather than the underlying CIL code. If you run corcls at the command line (via clix), you will see a list of all available options. Table 3 documents a partial listing.

Interesting Options of Corcls 	Meaning in Life

-w                               Generates output in HTML format.

-m nameOfAssemblyToSearch        By default, corcls only searches a core .NET BCL 
                                 assembly named mscorlib.dll.  If you wish to browse 
                                 other assemblies (including your custom assemblies), 
                                 use the -m flag.

-noinherit                       Prevents the display of inherited methods and fields.

-v                               Displays only output visible (public and protected) 
                                 classes, methods, or fields.

-p                               Displays only output public classes, methods, or fields.

Table 3. Various flags of corcls

Again, by default, corcls only searches the core .NET assembly, mscorlib.dll. If you wish to view definitions for types defined in other assemblies, you will need to specify the '-m' option. By way of a few examples, Listing 20 will display type information for System.String, Listing 21 displays the same type as HTML (via the '-w' option) and Listing 22 dumps information about the Person type defined within SimpleJScript.exe (originally defined in JScript.NET). Be aware that when you run load external modules with the '-m' option, you will need to ensure a copy of the binary file is in the same directory as corcls itself.

Listing 20. Viewing System.String

clix corcls System.String

Listing 21. System.String as HTML

clix corcls -w System.String

Listing 22. Viewing Person

clix corcls -m SimpleJScript.exe Person

Figure 5 shows the result of executing Listing 22.


Figure 5. Viewing Person in the syntax of C#

The functionality of typefinder is similar to that of corcls, however this tool allows you to get much more specific. Using a set of display options, you can view various aspects of a type such as the set of interfaces it supports, the methods it contains and so forth. I'll allow you to explore the full set of options via the findtype.html file located under /sscli/samples/utilities/typefinder, however to prime the pump, Table 4 lists some possibilities.

Typefinder Option        Meaning in Life

-d: NameOfDirectory      Used to specify a directory which contains the assembly 
                         you wish to investigate.

-x                       Used to specify the fully qualified name of the type 
                         in a given assembly.

-a                       Shows all information for a given type, including inherited 
                         members (very helpful).

-e, -f, -i, -m, -p       Shows the events, fields, interfaces, methods or properties 
                         of a given type.  These flags may be combined into a 
                         single commend.

-r                       Include base class information.

Table 4. Select options of typefinder

As an example, the command shown in Listing 23 yields the output seen in Listing 24.

Listing 23. Working with typefinder

clix typefinder -xip System.String

Listing 24. Viewing the properties and interfaces of the System.String type

class      System.String
# Interfaces: 4
  interface System.IComparable
  interface System.ICloneable
  interface System.IConvertible
  interface System.Collections.IEnumerable
Properties
  Char Chars [Int32] 'get' 
  Int32 Length 'get'

When working with typefinder, be sure to check out the role of the '-d' option (as it will prove helpful when you wish to view types in external assemblies, such as SimpleJScript.exe).

This Little GUI is Platform Independent

To wrap up this installment, we will examine what could be the most inciting set of sample applications, the Platform Independent GUI (PIGUI). As mentioned earlier in this series, the SSCLI does not ship with an implementation of System.Windows.Forms (.NET's native GUI toolkit). However, to illustrate what can be done with the CLI, we are provided with a set of samples that leverage the tcl/tk libraries, represented on the Macintosh by two *.dylib files (libtcl8.4.dylib and libtk8.4.dylib). As a friendly reminder, recall that the process of installing tcl/tk was described in the November installment.

The SSCLI offers a handful of samples that leverage the tcl/tk libraries:

  • Hello: A simple application illustrating GUI event handling

  • PigPad: A text editor application

  • Tk: This sample builds the required assembly (sharedsourcecli.tk.dll) that wraps a subset of the tcl/tk libraries

The Tk sample code is very illumining for a few reasons. First, the code base illustrates how the .NET platform can communicate with the API of the underlying operating system (as well as native libraries) using a specific attribute named DllImportAttribute (attributes enable aspect-oriented programming [AOP] techniques under .NET, the full details of which will be described at a later time).

On a more practical level, the assembly generated by the Tk sample (sharedsourcecli.tk.dll) is required by all other PIGUI examples. Given this, you must ensure that a copy of sharedsourcecli.tk.dll is placed within the same directory as the executing assembly. Furthermore, you will most likely want to copy the tcl/tk libraries are in the same directory of the pigui sample application you wish to run. If you installed tcl/tk using Fink Commander, they should be under /sw/lib.

Enabling an X11 Session

To execute the PIGUI sample applications, you must initialize X11 (full screen or rootless), and run these SSCLI samples from an xterm session (as the Macintosh Terminal applet does not initialize the necessary X11 variables). Now, when you install Panther, you have the option to install X11, which it may be launched using the X11 applet located under the Applications/Utilities directory.

If you are not running Panther, you must obtain X11 from cyberspace. While there are numerous distributions of X11 for the Mac, I'd suggest you download and install Apple's office X11 implementation (consult http://www.apple.com for further details). For the remainder of this article, I will assume you are at least somewhat comfortable manipulating X11.

Playing with the PIGUIs

By default, Apple's X11 distribution makes use of the Quartz windows manager (quartz-wm), which can be verified by investigating your machine's .xinitrc file. Assuming you have activated X11, enable the SSCLI from an xterm window (via DoSscli) and navigate to the pigpad sample application located under the /sscli/build/v1.ppcfstchk.rotor/samples/pigui/pigpad directory. Finally, execute pigpad via clix. Figure 6 shows PIGUI running under the default Quartz windows manager.


Figure 6. PigPad under the Quartz Window Manager

If you edit your .xinitrc file to load an alternative window manager (which may be obtained via Fink Commander) you would find that pigpad takes on an entirely different look and feel. To prove the point, update .xinitrc to load your window manager of choice (Listing 24 illustrates the loading of Window Maker).

Listing 24. Loading Window Maker as the X11 Windows Manager

# The Apple WM.
# quartz-wm 

# Window Maker
exec /sw/bin/wmaker

Once you have updated and saved .xinitrc, close down and then restart X11. Now follow the previous steps to execute the pigpad sample application. Figure 7 shows the new look and feel.


Figure 7. PigPad under Window Maker

Very cool! If you are interested in digging into the "who, what, where and why" of how pigui does it's magic, your first step is to examine the documentation of the Tk wrapper (/sscli/samples/pigui/tk/tk_wrapper.html). Once you have a general sense of the exposed functionality, you should be able to alter the code base of pigpad (or pighello) to your liking.

Wrap Up

This installment rounded out your understanding of the SSCLI by showcasing a number of sample applications and managed languages. We began by exploring the JScript.NET programming language and learned how jsc can be used to build .NET assemblies using a scripting like syntax. We also took a very brief look at the cLisp and myC compilers, and examined a set of sample applications that allow you to explore the format of a given assembly in a more lightweight manner than ildasm. Finally, you had a chance to see how tcl/tk was used to build a platform independent GUI under the SSCLI.

The next issue marks a conceptual shift in this series. While these first issues concentrated on the overall nature of the .NET platform and the role of the SSCLI, the next several articles will pound of the syntax and semantics of C#, and see how this programming language expresses the type system (classes, interfaces, structures, enumerations and delegates) of .NET.


Andrew Troelsen is a seasoned .NET developer who has authored numerous books on the topic, including the award winning C# and the .NET Platform. He is employed as a full-time .NET trainer and consultant for Intertech Training (www.intertechtraining.com) who apologies for failing to submit his January article in time. You can contact (or scold) Andrew at atroelsen@mac.com.

 
AAPL
$105.22
Apple Inc.
+0.39
MSFT
$46.13
Microsoft Corpora
+1.11
GOOG
$539.78
Google Inc.
-4.20

MacTech Search:
Community Search:

Software Updates via MacUpdate

OS X Server 4.0 - For OS X 10.10 Yosemit...
Designed for OS X and iOS devices, OS X Server makes it easy to share files, schedule meetings, synchronize contacts, develop software, host your own website, publish wikis, configure Mac, iPhone,... Read more
TotalFinder 1.6.12 - Adds tabs, hotkeys,...
TotalFinder is a universally acclaimed navigational companion for your Mac. Enhance your Mac's Finder with features so smart and convenient, you won't believe you ever lived without them. Tab-based... Read more
BusyCal 2.6.3 - Powerful calendar app wi...
BusyCal is an award-winning desktop calendar that combines personal productivity features for individuals with powerful calendar sharing capabilities for families and workgroups. BusyCal's unique... Read more
calibre 2.7 - Complete e-library managem...
Calibre is a complete e-book library manager. Organize your collection, convert your books to multiple formats, and sync with all of your devices. Let Calibre be your multi-tasking digital... Read more
Skitch 2.7.3 - Take screenshots, annotat...
With Skitch, taking, annotating, and sharing screenshots or images is as fun as it is simple.Communicate and collaborate with images using Skitch and its intuitive, engaging drawing and annotating... Read more
Delicious Library 3.3.2 - Import, browse...
Delicious Library allows you to import, browse, and share all your books, movies, music, and video games with Delicious Library. Run your very own library from your home or office using our... Read more
Art Text 2.4.8 - Create high quality hea...
Art Text is an OS X application for creating high quality textual graphics, headings, logos, icons, Web site elements, and buttons. Thanks to multi-layer support, creating complex graphics is no... Read more
Live Interior 3D Pro 2.9.6 - Powerful an...
Live Interior 3D Pro is a powerful yet very intuitive interior designing application. View Video Tutorials It has every feature of Live Interior 3D Standard, plus some exclusive ones: Create multi... Read more
The Hit List 1.1.7 - Advanced reminder a...
The Hit List manages the daily chaos of your modern life. It's easy to learn - it's as easy as making lists. And it's powerful enough to let you plan, then forget, then act when the time is right.... Read more
jAlbum Pro 12.2.4 - Organize your digita...
jAlbum Pro has all the features you love in jAlbum, but comes with a commercial license. With jAlbum, you can create gorgeous custom photo galleries for the Web without writing a line of code!... Read more

Latest Forum Discussions

See All

Rami Ismail Opens Up distribute​() for D...
Rami Ismail Opens Up distribute​() for Developers Posted by Jessica Fisher on October 24th, 2014 [ permalink ] Rami Ismail, Chief Executive of Business and Development at indie game studio | Read more »
Great Hitman GO Goes on Sale and Gets Ne...
Great Hitman GO Goes on Sale and Gets New Update – Say That Three Times Fast Posted by Jessica Fisher on October 24th, 2014 [ permalink ] | Read more »
Rival Stars Basketball Review
Rival Stars Basketball Review By Jennifer Allen on October 24th, 2014 Our Rating: :: RESTRICTIVE BUT FUNUniversal App - Designed for iPhone and iPad Rival Stars Basketball is a fun mixture of basketball and card collecting but its... | Read more »
Rubicon Development Makes Over a Dozen o...
Rubicon Development Makes Over a Dozen of Their Games Free For This Weekend Only Posted by Jessica Fisher on October 24th, 2014 [ permalink ] | Read more »
I Am Dolphin Review
I Am Dolphin Review By Jennifer Allen on October 24th, 2014 Our Rating: :: NEARLY FIN-TASTICUniversal App - Designed for iPhone and iPad Swim around and eat nearly everything that moves in I Am Dolphin, a fun Ecco-ish kind of game... | Read more »
nPlayer looks to be the ultimate choice...
Developed by Newin Inc, nPlayer may seem like your standard video player – but is aiming to be the best in its field by providing high quality video play performance and support for a huge number of video formats and codecs. User reviews include... | Read more »
Fighting Fantasy: Caverns of the Snow Wi...
Fighting Fantasy: Caverns of the Snow Witch Review By Jennifer Allen on October 24th, 2014 Our Rating: :: CLASSY STORYTELLINGUniversal App - Designed for iPhone and iPad Fighting Fantasy: Caverns of the Snow Witch is a sterling... | Read more »
A Few Days Left (Games)
A Few Days Left 1.01 Device: iOS Universal Category: Games Price: $3.99, Version: 1.01 (iTunes) Description: Screenshots are in compliance to App Store's 4+ age rating! Please see App Preview for real game play! **Important: Make... | Read more »
Toca Boo (Education)
Toca Boo 1.0.2 Device: iOS Universal Category: Education Price: $2.99, Version: 1.0.2 (iTunes) Description: BOO! Did I scare you!? My name is Bonnie and my family loves to spook! Do you want to scare them back? Follow me and I'll... | Read more »
Intuon (Games)
Intuon 1.1 Device: iOS Universal Category: Games Price: $.99, Version: 1.1 (iTunes) Description: Join the battle with your intuition in a new hardcore game Intuon! How well do you trust your intuition? Can you find a needle in a... | Read more »

Price Scanner via MacPrices.net

Weekend sale: 13-inch 128GB MacBook Air for $...
Best Buy has the 2014 13-inch 1.4GHz 128GB MacBook Air on sale for $849.99, or $150 off MSRP, on their online store. Choose free home shipping or free local store pickup (if available). Price valid... Read more
Nimbus Note Cross=Platform Notes Utility
Nimbus Note will make sure you never forget or lose your valuable data again. Create and edit notes, save web pages, screenshots and any other type of data – and share it all with your friends and... Read more
NewerTech’s Snuglet Makes MagSafe 2 Power Con...
NewerTech has introduced the Snuglet, a precision-manufactured ring designed to sit inside your MagSafe 2 connector port, providing a more snug fit to prevent your power cable from unintentional... Read more
Apple Planning To Sacrifice Gross Margins To...
Digitimes Research’s Jim Hsiao says its analysts believe Apple is planning to sacrifice its gross margins to save its tablet business, which has recently fallen into decline. They project that Apple’... Read more
Who’s On Now? – First Instant-Connect Search...
It’s nighttime and your car has broken down on the side of the highway. You need a tow truck right away, so you open an app on your iPhone, search for the closest tow truck and send an instant... Read more
13-inch 2.5GHz MacBook Pro on sale for $949,...
Best Buy has the 13″ 2.5GHz MacBook Pro available for $949.99 on their online store. Choose free shipping or free instant local store pickup (if available). Their price is $150 off MSRP. Price is... Read more
Save up to $125 on Retina MacBook Pros
B&H Photo has the new 2014 13″ and 15″ Retina MacBook Pros on sale for up to $125 off MSRP. Shipping is free, and B&H charges NY sales tax only. They’ll also include free copies of Parallels... Read more
Apple refurbished Time Capsules available sta...
The Apple Store has certified refurbished Time Capsules available for up to $60 off MSRP. Apple’s one-year warranty is included with each Time Capsule, and shipping is free: - 2TB Time Capsule: $255... Read more
Textilus New Word, Notes and PDF Processor fo...
Textilus is new word-crunching, notes, and PDF processor designed exclusively for the iPad. I haven’t had time to thoroughly check it out yet, but it looks great and early reviews are positive.... Read more
WD My Passport Pro Bus-Powered Thunderbolt RA...
WD’s My Passport Pro RAID solution is powered by an integrated Thunderbolt cable for true portability and speeds as high as 233 MB/s. HighlightsOverviewSpecifications Transfer, Back Up And Edit In... Read more

Jobs Board

*Apple* Solutions Consultant - Apple Inc. (U...
…important role that the ASC serves is that of providing an excellent Apple Customer Experience. Responsibilities include: * Promoting Apple products and solutions Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Project Manager / Business Analyst, WW *Appl...
…a senior project manager / business analyst to work within our Worldwide Apple Fulfillment Operations and the Business Process Re-engineering team. This role will work Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.