no more submodule
This commit is contained in:
26
GtkSharp/Source/Samples/Sections/Widgets/SwitchSection.cs
Normal file
26
GtkSharp/Source/Samples/Sections/Widgets/SwitchSection.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
// This is free and unencumbered software released into the public domain.
|
||||
// Happy coding!!! - GtkSharp Team
|
||||
|
||||
using Gtk;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
[Section(ContentType = typeof(Switch), Category = Category.Widgets)]
|
||||
class SwitchSection : ListSection
|
||||
{
|
||||
public SwitchSection()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user