no more submodule
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// This is free and unencumbered software released into the public domain.
|
||||
// Happy coding!!! - GtkSharp Team
|
||||
|
||||
using System;
|
||||
using Gtk;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
[Section(ContentType = typeof(AboutDialog), Category = Category.Dialogs)]
|
||||
class AboutDialogSection : Box
|
||||
{
|
||||
public AboutDialogSection() : base(Orientation.Vertical, 0)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using Gtk;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
[Section(ContentType = typeof(FileChooserDialog), Category = Category.Dialogs)]
|
||||
class FileChooserDialogSection : ListSection
|
||||
{
|
||||
public FileChooserDialogSection ()
|
||||
{
|
||||
AddItem ($"Press button to open {nameof(FileChooserDialog)} :", new FileChooserDialogDemo ("Press me"));
|
||||
}
|
||||
}
|
||||
|
||||
class FileChooserDialogDemo : Button
|
||||
{
|
||||
public FileChooserDialogDemo (string text) : base (text) { }
|
||||
|
||||
protected override void OnPressed ()
|
||||
{
|
||||
var fcd = new FileChooserDialog ("Open File", null, FileChooserAction.Open);
|
||||
fcd.AddButton (Stock.Cancel, ResponseType.Cancel);
|
||||
fcd.AddButton (Stock.Open, ResponseType.Ok);
|
||||
fcd.DefaultResponse = ResponseType.Ok;
|
||||
fcd.SelectMultiple = false;
|
||||
|
||||
ResponseType response = (ResponseType) fcd.Run ();
|
||||
if (response == ResponseType.Ok)
|
||||
ApplicationOutput.WriteLine (fcd.Filename);
|
||||
fcd.Destroy ();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user