T35 on Spider and touch events

I am just starting with Fez Spider and upgraded the firmware yesterday. EMX version 4.1.8.0

I have this code.


void ProgramStarted() {
            display.SimpleGraphics.DisplayText("Hello world", Resources.GetFont(Resources.FontResources.NinaB), GT.Color.Blue, 10, 10);

            display.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(mainWindow_TouchDown);  // turns BackgroundColor blue
            display.WPFWindow.TouchUp += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchUp); // BackgroundColor red
}

The touch events are working, I see background color changing, blue and red.

When first starting up the screen quickly shows “Hello world” and then displays a white backgroundcolor.

When I comment out the touch events I see “Hello world”.

Is this normal behaviour, can I get it to show “Hello world” on startup?

Welcome!

It can be power related. Try powering it differently and see if it makes a difference.

Thanks!

I tried a 9v battery and a 12v power supply. Same results.

If I put in one of the touch events:

display.SimpleGraphics.DisplayText("Hello world", Resources.GetFont(Resources.FontResources.NinaB), GT.Color.Blue, 10, 10);

It displays the message.

I do not use WPF so I am guessing.

I think if you want to use WPF touch, you have to write the text using a WPF API, not via simple graphics.

Thanks Mike, that’s it.

This code is working now to see it at startup:


            Window window = display.WPFWindow;
            Canvas canvas = new Canvas();
            window.Child = canvas;

            
            Text txtMessage = new Text(Resources.GetFont(Resources.FontResources.NinaB), "Hello World");
            canvas.Children.Add(txtMessage);
            Canvas.SetTop(txtMessage, 200);
            Canvas.SetLeft(txtMessage, 90);