From ec8cea760d225599d8299741feda3abd2e5853d1 Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 1 Sep 2020 00:20:56 +1000 Subject: [PATCH] work on list entry handling stuff --- .gitignore | 3 ++- MainWindow.cs | 16 ++++++++++++++++ ui.glade | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8f4ece9..ea3d77c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ poop/ -BuypeebApp.exe \ No newline at end of file +BuypeebApp.exe +ui.glade~ diff --git a/MainWindow.cs b/MainWindow.cs index 07ea012..a53b410 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -21,11 +21,27 @@ using Gtk; using UI = Gtk.Builder.ObjectAttribute; namespace Buypeeb { + enum ItemColumns { + Name, + PriceYen, + PriceAUD, + Ending, + Id + } + class MainWindow : Window { + + private ListStore Items; + public MainWindow() : this(new Builder("ui.glade")) { } private MainWindow(Builder builder) : base(builder.GetObject("wndMain").Handle) { + this.Title = "Buypeeb"; builder.Autoconnect(this); + this.Items = (ListStore)builder.GetObject("ListItems"); + foreach (object[] row in this.Items) { + Console.WriteLine(row[(int)ItemColumns.Name]); + } DeleteEvent += Window_Shutdown; } diff --git a/ui.glade b/ui.glade index 54cc24b..e3dd972 100644 --- a/ui.glade +++ b/ui.glade @@ -2,7 +2,7 @@ - + @@ -290,7 +290,7 @@ True True - lstItems + ListItems True 1 True