work on list entry handling stuff

This commit is contained in:
Lynne Megido 2020-09-01 00:20:56 +10:00
parent cf2ebfe3a5
commit ec8cea760d
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
3 changed files with 20 additions and 3 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
poop/
BuypeebApp.exe
BuypeebApp.exe
ui.glade~

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkListStore" id="lstItems">
<object class="GtkListStore" id="ListItems">
<columns>
<!-- column-name Name -->
<column type="gchararray"/>
@ -290,7 +290,7 @@
<object class="GtkTreeView">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">lstItems</property>
<property name="model">ListItems</property>
<property name="rules_hint">True</property>
<property name="search_column">1</property>
<property name="activate_on_single_click">True</property>