Window gets no input

Sep 16, 2011 at 4:45 PM

Hello folks,

i created a window with a label and a button, but this window does not react to any input given.

i think the problem lies in my rectangles.

Code:

game1.cs

mainscreen.Desktop.Bounds = new UniRectangle(
          new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10%
          new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 100%
            );

dialog.designer.cs

button

            this.ExitButton.Text = "Exit"; 
            this.ExitButton.Bounds = new UniRectangle(
                new UniScalar(1.0f, -180.0f), new UniScalar(1.0f, -40.0f), 80, 24
                );
            this.ExitButton.Enabled = true;
            if (this.ExitButton.MouseHovering == true)
                this.ExitButton.Text = "hover";

main window

            this.Bounds = new UniRectangle(80.0f, 10.0f, 200.0f, 200.0f);

i also had a look on the inputmanager demo, but i dont rly think this problem concerns the mouse itself.

i would appreciate any help i get :)

regards

nop0x

Sep 19, 2011 at 2:53 PM

Do you have event handlers on those buttons?

Sep 19, 2011 at 3:36 PM

well yeah i had one but that doesnt work either for me.

i put it back in:

dialog.designer.cs

            this.ExitButton.Enabled = true;
            if (this.ExitButton.MouseHovering == true)
            {
                this.ExitButton.Text = "hover";
            }
                this.ExitButton.Pressed += new EventHandler(ExitButton_Pressed);

dialog.cs

        private void ExitButton_Pressed(object Sender, EventArgs arguments)
        {
            Close();
        }
doesn't work :(