Pass all parameters to Box.pack_start() and ...pack_end()

With PyGTK, several Box.pack_{start,end}() parameters had defaults [1,2].
With GTK3+pygi all values must be passed [3,4].

[1] http://developer.gnome.org/pygtk/stable/class-gtkbox.html#method-gtkbox--pack-start
[2] http://developer.gnome.org/pygtk/stable/class-gtkbox.html#method-gtkbox--pack-end
[3] http://developer.gnome.org/gtk/stable/GtkBox.html#gtk-box-pack-start
[4] http://developer.gnome.org/gtk/stable/GtkBox.html#gtk-box-pack-end

[assembled from several patches; replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
This commit is contained in:
Daniel Drake 2011-10-30 07:01:32 +00:00 committed by Simon Schampijer
parent 89ef6304a1
commit 2f7f95f9af
5 changed files with 20 additions and 22 deletions

View File

@ -179,11 +179,11 @@ class NamingAlert(gtk.Window):
toolbar = NamingToolbar() toolbar = NamingToolbar()
toolbar.connect('keep-clicked', self.__keep_cb) toolbar.connect('keep-clicked', self.__keep_cb)
vbox.pack_start(toolbar, False) vbox.pack_start(toolbar, False, False, 0)
toolbar.show() toolbar.show()
body = self._create_body() body = self._create_body()
vbox.pack_start(body, expand=True, fill=True) vbox.pack_start(body, True, True, 0)
body.show() body.show()
self._title.grab_focus() self._title.grab_focus()
@ -192,26 +192,24 @@ class NamingAlert(gtk.Window):
body = gtk.VBox(spacing=style.DEFAULT_SPACING) body = gtk.VBox(spacing=style.DEFAULT_SPACING)
body.set_border_width(style.DEFAULT_SPACING * 3) body.set_border_width(style.DEFAULT_SPACING * 3)
header = self._create_header() header = self._create_header()
body.pack_start(header, expand=False, padding=style.DEFAULT_PADDING) body.pack_start(header, False, False, style.DEFAULT_PADDING)
body.pack_start(self._create_separator(style.DEFAULT_SPACING), body.pack_start(self._create_separator(style.DEFAULT_SPACING), False, False, 0)
expand=False)
body.pack_start(self._create_label(_('Description:')), expand=False) body.pack_start(self._create_label(_('Description:')), False, False, 0)
description = self._activity.metadata.get('description', '') description = self._activity.metadata.get('description', '')
description_box, self._description = self._create_text_view(description) description_box, self._description = self._create_text_view(description)
body.pack_start(description_box, expand=True, fill=True) body.pack_start(description_box, True, True, 0)
body.pack_start(self._create_separator(style.DEFAULT_PADDING), body.pack_start(self._create_separator(style.DEFAULT_PADDING), False, False, 0)
expand=False)
body.pack_start(self._create_label(_('Tags:')), expand=False) body.pack_start(self._create_label(_('Tags:')), False, False, 0)
tags = self._activity.metadata.get('tags', '') tags = self._activity.metadata.get('tags', '')
tags_box, self._tags = self._create_text_view(tags) tags_box, self._tags = self._create_text_view(tags)
body.pack_start(tags_box, expand=True, fill=True) body.pack_start(tags_box, True, True, 0)
body.show_all() body.show_all()
return body return body

View File

@ -104,12 +104,12 @@ class Alert(gtk.EventBox):
self._msg_box = gtk.VBox() self._msg_box = gtk.VBox()
self._title_label = gtk.Label() self._title_label = gtk.Label()
self._title_label.set_alignment(0, 0.5) self._title_label.set_alignment(0, 0.5)
self._msg_box.pack_start(self._title_label, False) self._msg_box.pack_start(self._title_label, False, False, 0)
self._msg_label = gtk.Label() self._msg_label = gtk.Label()
self._msg_label.set_alignment(0, 0.5) self._msg_label.set_alignment(0, 0.5)
self._msg_box.pack_start(self._msg_label, False) self._msg_box.pack_start(self._msg_label, False, False, 0)
self._hbox.pack_start(self._msg_box, False) self._hbox.pack_start(self._msg_box, False, False, 0)
self._buttons_box = gtk.HButtonBox() self._buttons_box = gtk.HButtonBox()
self._buttons_box.set_layout(gtk.BUTTONBOX_END) self._buttons_box.set_layout(gtk.BUTTONBOX_END)
@ -154,7 +154,7 @@ class Alert(gtk.EventBox):
elif pspec.name == 'icon': elif pspec.name == 'icon':
if self._icon != value: if self._icon != value:
self._icon = value self._icon = value
self._hbox.pack_start(self._icon, False) self._hbox.pack_start(self._icon, False, False, 0)
self._hbox.reorder_child(self._icon, 0) self._hbox.reorder_child(self._icon, 0)
def do_get_property(self, pspec): def do_get_property(self, pspec):

View File

@ -104,8 +104,8 @@ class Notebook(gtk.Notebook):
tab_button.show() tab_button.show()
tab_label.show() tab_label.show()
tab_box.pack_start(tab_label, True) tab_box.pack_start(tab_label, True, False, 0)
tab_box.pack_start(tab_button, True) tab_box.pack_start(tab_button, True, False, 0)
tab_box.show_all() tab_box.show_all()
event_box.add(tab_box) event_box.add(tab_box)

View File

@ -43,7 +43,7 @@ class ToolComboBox(gtk.ToolItem):
hbox = gtk.HBox(False, style.DEFAULT_SPACING) hbox = gtk.HBox(False, style.DEFAULT_SPACING)
self.label = gtk.Label(self._label_text) self.label = gtk.Label(self._label_text)
hbox.pack_start(self.label, False) hbox.pack_start(self.label, False, False, 0)
self.label.show() self.label.show()
if combo: if combo:

View File

@ -233,14 +233,14 @@ class HTray(gtk.HBox):
gobject.GObject.__init__(self, **kwargs) gobject.GObject.__init__(self, **kwargs)
scroll_left = _TrayScrollButton('go-left', _PREVIOUS_PAGE) scroll_left = _TrayScrollButton('go-left', _PREVIOUS_PAGE)
self.pack_start(scroll_left, False) self.pack_start(scroll_left, False, False, 0)
self._viewport = _TrayViewport(gtk.ORIENTATION_HORIZONTAL) self._viewport = _TrayViewport(gtk.ORIENTATION_HORIZONTAL)
self.pack_start(self._viewport) self.pack_start(self._viewport)
self._viewport.show() self._viewport.show()
scroll_right = _TrayScrollButton('go-right', _NEXT_PAGE) scroll_right = _TrayScrollButton('go-right', _NEXT_PAGE)
self.pack_start(scroll_right, False) self.pack_start(scroll_right, False, False, 0)
scroll_left.viewport = self._viewport scroll_left.viewport = self._viewport
scroll_right.viewport = self._viewport scroll_right.viewport = self._viewport
@ -319,14 +319,14 @@ class VTray(gtk.VBox):
gobject.GObject.__init__(self, **kwargs) gobject.GObject.__init__(self, **kwargs)
scroll_up = _TrayScrollButton('go-up', _PREVIOUS_PAGE) scroll_up = _TrayScrollButton('go-up', _PREVIOUS_PAGE)
self.pack_start(scroll_up, False) self.pack_start(scroll_up, False, False, 0)
self._viewport = _TrayViewport(gtk.ORIENTATION_VERTICAL) self._viewport = _TrayViewport(gtk.ORIENTATION_VERTICAL)
self.pack_start(self._viewport) self.pack_start(self._viewport)
self._viewport.show() self._viewport.show()
scroll_down = _TrayScrollButton('go-down', _NEXT_PAGE) scroll_down = _TrayScrollButton('go-down', _NEXT_PAGE)
self.pack_start(scroll_down, False) self.pack_start(scroll_down, False, False, 0)
scroll_up.viewport = self._viewport scroll_up.viewport = self._viewport
scroll_down.viewport = self._viewport scroll_down.viewport = self._viewport