mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
27 lines
652 B
C#
27 lines
652 B
C#
![]() |
// This is free and unencumbered software released into the public domain.
|
|||
|
// Happy coding!!! - GtkSharp Team
|
|||
|
|
|||
|
using Gtk;
|
|||
|
|
|||
|
namespace Samples
|
|||
|
{
|
|||
|
[Section(Name = "Switch Button", Category = Category.Widgets)]
|
|||
|
class SwitchButtonSection : ListSection
|
|||
|
{
|
|||
|
public SwitchButtonSection()
|
|||
|
{
|
|||
|
AddItem(CreateSwitchButton());
|
|||
|
}
|
|||
|
|
|||
|
public (string, Widget) CreateSwitchButton()
|
|||
|
{
|
|||
|
var btn = new Switch();
|
|||
|
|
|||
|
btn.ButtonReleaseEvent += (o, args) =>
|
|||
|
ApplicationOutput.WriteLine(o, $"Switch is now: {!btn.Active}");
|
|||
|
|
|||
|
return ("Switch:", btn);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|