Main Site Documentation

Window instaniation Issue?


#1

I have noticed an issuewith the use of the parameterless construction for Window.

Illustrated below:

using System;
using System.Threading;
using Microsoft.SPOT;

using GHIElectronics.NETMF.Hardware;

using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
using GHIElectronics.NETMF.Glide.UI;

namespace BasicTesting
{
    public class Program
    {
        //static Window window;           
        
        public static void Main()         
        {
            Window window; 
 #if true
            // this works
            window = new Window("main", 320, 240);
 #else
            // this results in a NullException when 
            // Glide.MainWindow = window; is executed
            window = new Window();
            window.Name = "main";
            window.Width = 320;
            window.Height = 240;
 #endif
            window.BackColor = Microsoft.SPOT.Presentation.Media.Color.White;

            TextBlock tb = new TextBlock("tb1", 255, 50, 50, 50, 24);
            tb.Text = "Testing";

            window.AddChild(tb);

            Glide.MainWindow = window;
            Thread.Sleep(-1);         
        } 
    }
}

#2

Shot in the dark, having only Pandas here: does it still explode if you set it up in portrait mode?


#3

It an issue with two ways of creating the same object. One way works and the other does not.

I don’t thnk Glide has the concept of portrait and landscape modes.


#4

Glide can run on any resolution and in portrait mode but glide needs devices with over 8mb of ram so panda is not an option

Please use new posts for new question in future.


#5

I had weird things with feztouch with switching between those modes… Like I said, it was a bitofa shot in the dark.


#6
window.Graphics = new Bitmap(320, 240);