Skip to content

Commit da34a34

Browse files
committed
Pass column actions into EntryGrid for future use.
1 parent c1124cb commit da34a34

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Form/editform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,8 @@ def create_table(self):
748748
self.model = Gtk.ListStore(*[str] * (len(columns) + 1))
749749
self.entry_grid.set_model(self.model)
750750
tooltips = [column[1] for column in columns]
751-
self.entry_grid.set_columns(self.columns, tooltips)
751+
actions = [column[3] for column in columns]
752+
self.entry_grid.set_columns(self.columns, tooltips, actions)
752753
self.entry_grid.build()
753754

754755
def populate_gui(self, event):

Form/entrygrid.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ def _draw(self, widget, cr):
6969
#------------------------------------------------------------------------
7070
class EntryGrid(Gtk.Grid):
7171

72-
def __init__(self, headings=None, tooltips=None, model=None, callback=None):
72+
def __init__(self, headings=None, tooltips=None, actions=None, model=None, callback=None):
7373
Gtk.Grid.__init__(self)
7474

7575
self.headings = headings
7676
self.tooltips = tooltips
77+
self.actions = actions
7778
self.model = model
7879
self.widgets = []
7980
self.indicators = []
@@ -91,9 +92,10 @@ def set_model(self, model):
9192
if len(self.model) > 0:
9293
self.selected = model.get_iter((0,))
9394

94-
def set_columns(self, columns, tooltips):
95+
def set_columns(self, columns, tooltips, actions):
9596
self.headings = columns
9697
self.tooltips = tooltips
98+
self.actions = actions
9799

98100
def build(self):
99101

@@ -187,6 +189,7 @@ def rows_reordered(self, model, path, iter_, new_order):
187189
def clean_up(self):
188190
self.headings = None
189191
self.tooltips = None
192+
self.actions = None
190193
self.model = None
191194
self.widgets = None
192195
self.indicators = None

0 commit comments

Comments
 (0)