Ryujinx-GtkSharp/Source/Workload/GtkSharp.Workload.Template.CSharp/content/GtkSharp.Application.CSharp/MainWindow.cs
Trung Nguyen 60376ae510
feat: GtkSharp net6 workload (#351)
* feat: GtkSharp net6 workload

* feat(Workload): GtkSharp template packs

* chore: Support .NET SDK 6.0.300

And also changed the build script to target SDK bands.

* build: Workload install and uninstall targets
2022-05-29 10:55:50 +02:00

36 lines
911 B
C#

using System;
using Gtk;
using UI = Gtk.Builder.ObjectAttribute;
namespace GtkNamespace
{
class MainWindow : Window
{
[UI] private Label _label1 = null;
[UI] private Button _button1 = null;
private int _counter;
public MainWindow() : this(new Builder("MainWindow.glade")) { }
private MainWindow(Builder builder) : base(builder.GetRawOwnedObject("MainWindow"))
{
builder.Autoconnect(this);
DeleteEvent += Window_DeleteEvent;
_button1.Clicked += Button1_Clicked;
}
private void Window_DeleteEvent(object sender, DeleteEventArgs a)
{
Application.Quit();
}
private void Button1_Clicked(object sender, EventArgs a)
{
_counter++;
_label1.Text = "Hello World! This button has been clicked " + _counter + " time(s).";
}
}
}