buypeeb-cs/AddItemDialogue.cs

31 lines
735 B
C#
Raw Normal View History

2020-09-01 09:58:35 +00:00
using Gtk;
namespace Buypeeb {
internal class AddItemDialogue : Dialog {
private readonly Entry entryURL;
private readonly Entry entryName;
2020-09-01 09:58:35 +00:00
public AddItemDialogue() : this(new Builder("add.glade")) { }
private AddItemDialogue(Builder builder) : base(builder.GetObject("DialogueAdd").Handle) {
Title = "Add item";
2020-09-01 09:58:35 +00:00
builder.Autoconnect(this);
entryURL = (Entry)builder.GetObject("EntryAddURL");
entryName = (Entry)builder.GetObject("EntryAddName");
2020-09-01 09:58:35 +00:00
DeleteEvent += Window_Shutdown;
}
private static void Window_Shutdown(object sender, DeleteEventArgs args) {
2020-09-01 09:58:35 +00:00
Application.Quit();
}
public string GetURL() {
return entryURL.Text;
2020-09-01 09:58:35 +00:00
}
public string GetName() {
return entryName.Text;
2020-09-01 09:58:35 +00:00
}
}
}