GtkSharp/Source/Samples/Sections/Widgets/LevelBarSection.cs
Pedro Larouca eec217a5c5 [Samples] some more widgets (#13)
[Samples] Label, LevelBar, ProgressBar and Spinner sections
2018-01-29 14:39:29 +01:00

31 lines
748 B
C#

// This is free and unencumbered software released into the public domain.
// Happy coding!!! - GtkSharp Team
using Gtk;
namespace Samples
{
[Section(ContentType = typeof(LevelBar), Category = Category.Widgets)]
class LevelBarSection : ListSection
{
public LevelBarSection()
{
AddItem(CreateSimpleLevelBar());
}
public (string, Widget) CreateSimpleLevelBar()
{
// constructor takes MinValue, MaxValue
var lb = new LevelBar(0, 100);
// lets add a visible request size in our example
lb.WidthRequest = 100;
// set the value to 75%
lb.Value = 75d;
return ("Level Bar:", lb);
}
}
}