Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Commit

Permalink
customize grid widgets attach flags
Browse files Browse the repository at this point in the history
  • Loading branch information
baverman committed Jan 13, 2011
1 parent 54c9767 commit 7f37eef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions taburet/ui/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def __init__(self, name, label=None, editable=True, width=None, align=0, default
self.default = default
self.align = align

def get_attach_flags(self):
return gtk.EXPAND|gtk.SHRINK|gtk.FILL

def create_widget(self, dirty_row):
e = gtk.Entry()

Expand Down Expand Up @@ -190,7 +193,7 @@ def __init__(self, columns):
for col, c in enumerate(self.columns):
h = self.headers[col] = c.get_title_widget()
self.attach(h, col, col + 1, 0, 1,
xoptions=gtk.EXPAND|gtk.SHRINK|gtk.FILL, yoptions=0)
xoptions=c.get_attach_flags(), yoptions=0)

self.visible_rows_count = 0

Expand Down Expand Up @@ -296,7 +299,7 @@ def fill_area_with_widgets(self):
w.first = True
self.grid.setdefault(row, {})[col] = w
self.attach(w, col, col + 1, row+1, row + 2,
xoptions=gtk.EXPAND|gtk.SHRINK|gtk.FILL, yoptions=0)
xoptions=c.get_attach_flags(), yoptions=0)

height += max(w.size_request()[1] for w in self.grid[row].values())
height += self.get_row_spacing(row)
Expand Down

0 comments on commit 7f37eef

Please sign in to comment.