Using Glide and FEZ Spider together is (almost) straightforward.
Compose the hardware in the Program.Gadgeteer window (include the Display).
It should be noted that some names collide (Button, Window) so you need to play tricks like fully qualifying some.
Here is an example:
static GHIElectronics.NETMF.Glide.Display.Window window;
void ProgramStarted()
{
// Create the Window XML string.
string xml;
xml = "<Glide Version=\"" + Glide.Version + "\">";
xml += "<Window Name=\"window\" Width=\"320\" Height=\"240\" BackColor=\"FFFFFF\">";
xml += "<TextBox Name=\"textBox\" X=\"85\" Y=\"104\" Width=\"150\" Height=\"32\" Alpha=\"255\" Text=\"Touch me\" TextAlign=\"Left\" Font=\"4\" FontColor=\"000000\"/>";
xml += "</Window>";
xml += "</Glide>";
// Resize any loaded Window to the LCD's size.
Glide.FitToScreen = true;
// Load the Window XML string.
window = GlideLoader.LoadWindow(xml);
// Assign the Window to MainWindow; rendering it to the LCD.
Glide.MainWindow = window;
GHIElectronics.NETMF.Glide.UI.TextBox textBox = (GHIElectronics.NETMF.Glide.UI.TextBox)window.GetChildByName("textBox");
textBox.TapEvent += new OnTap(textBox_TapEvent);
}
void textBox_TapEvent(object sender)
{
GHIElectronics.NETMF.Glide.UI.TextBox tb = (GHIElectronics.NETMF.Glide.UI.TextBox)sender;
tb.Alpha = 0;
}
However, touching the display will generate the following exception:
A first chance exception of type ‘System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll
An unhandled exception of type ‘System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll
Uncaught exception
#### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (3) ####
#### Message:
#### Microsoft.SPOT.Application::OnEvent [IP: 0098] ####
#### Microsoft.SPOT.EventSink::ProcessEvent [IP: 0023] ####
#### Microsoft.SPOT.EventSink::EventDispatchCallback [IP: 0014] ####
It looks like the touch events are not wired properly.