work on list entry handling stuff
This commit is contained in:
parent
cf2ebfe3a5
commit
ec8cea760d
3 changed files with 20 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
poop/
|
poop/
|
||||||
BuypeebApp.exe
|
BuypeebApp.exe
|
||||||
|
ui.glade~
|
||||||
|
|
|
@ -21,11 +21,27 @@ using Gtk;
|
||||||
using UI = Gtk.Builder.ObjectAttribute;
|
using UI = Gtk.Builder.ObjectAttribute;
|
||||||
|
|
||||||
namespace Buypeeb {
|
namespace Buypeeb {
|
||||||
|
enum ItemColumns {
|
||||||
|
Name,
|
||||||
|
PriceYen,
|
||||||
|
PriceAUD,
|
||||||
|
Ending,
|
||||||
|
Id
|
||||||
|
}
|
||||||
|
|
||||||
class MainWindow : Window {
|
class MainWindow : Window {
|
||||||
|
|
||||||
|
private ListStore Items;
|
||||||
|
|
||||||
public MainWindow() : this(new Builder("ui.glade")) { }
|
public MainWindow() : this(new Builder("ui.glade")) { }
|
||||||
|
|
||||||
private MainWindow(Builder builder) : base(builder.GetObject("wndMain").Handle) {
|
private MainWindow(Builder builder) : base(builder.GetObject("wndMain").Handle) {
|
||||||
|
this.Title = "Buypeeb";
|
||||||
builder.Autoconnect(this);
|
builder.Autoconnect(this);
|
||||||
|
this.Items = (ListStore)builder.GetObject("ListItems");
|
||||||
|
foreach (object[] row in this.Items) {
|
||||||
|
Console.WriteLine(row[(int)ItemColumns.Name]);
|
||||||
|
}
|
||||||
DeleteEvent += Window_Shutdown;
|
DeleteEvent += Window_Shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
ui.glade
4
ui.glade
|
@ -2,7 +2,7 @@
|
||||||
<!-- Generated with glade 3.36.0 -->
|
<!-- Generated with glade 3.36.0 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22"/>
|
<requires lib="gtk+" version="3.22"/>
|
||||||
<object class="GtkListStore" id="lstItems">
|
<object class="GtkListStore" id="ListItems">
|
||||||
<columns>
|
<columns>
|
||||||
<!-- column-name Name -->
|
<!-- column-name Name -->
|
||||||
<column type="gchararray"/>
|
<column type="gchararray"/>
|
||||||
|
@ -290,7 +290,7 @@
|
||||||
<object class="GtkTreeView">
|
<object class="GtkTreeView">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">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="rules_hint">True</property>
|
||||||
<property name="search_column">1</property>
|
<property name="search_column">1</property>
|
||||||
<property name="activate_on_single_click">True</property>
|
<property name="activate_on_single_click">True</property>
|
||||||
|
|
Loading…
Reference in a new issue