Convert Gtk HBox and VBox widgets into Box widgets

This commit is contained in:
Nick Hall 2015-02-06 22:24:35 +00:00
parent e2718770b9
commit 9c8afdd155
47 changed files with 133 additions and 132 deletions

View File

@ -58,7 +58,7 @@ from .glade import Glade
#-------------------------------------------------------------------------
__LOG = logging.getLogger(".ColumnOrder")
class ColumnOrder(Gtk.VBox):
class ColumnOrder(Gtk.Box):
"""
Column ordering selection widget
"""
@ -74,7 +74,7 @@ class ColumnOrder(Gtk.VBox):
tree: are the columns for a treeview, if so, the first columns is not
changable
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.treeview = tree
self.colnames = column_names
@ -95,7 +95,7 @@ class ColumnOrder(Gtk.VBox):
self.pack_start(Gtk.Label(label=_('Drag and drop the columns to change'
' the order')), False, False, 0)
self.pack_start(Gtk.Label(label=' '), False, False,0)
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.set_spacing(10)
hbox.pack_start(Gtk.Label(label=' '), True, True, 0)
scroll = Gtk.ScrolledWindow()
@ -105,7 +105,7 @@ class ColumnOrder(Gtk.VBox):
self.tree.set_reorderable(True)
scroll.add(self.tree)
self.apply_button = Gtk.Button(stock='gtk-apply')
btns = Gtk.HButtonBox()
btns = Gtk.ButtonBox()
btns.set_layout(Gtk.ButtonBoxStyle.END)
btns.pack_start(self.apply_button, True, True, 0)
hbox.pack_start(btns, False, True, 0)

View File

@ -329,7 +329,7 @@ class ConfigureDialog(ManagedWindow):
if not config:
config = self.__config
lwidget = BasicLabel("%s: " %label)
hbox = Gtk.HBox()
hbox = Gtk.Box()
if path:
entry.set_text(path)
entry.connect('changed', callback_label)
@ -972,7 +972,7 @@ class GrampsPreferences(ConfigureDialog):
lwidget = BasicLabel("%s: " % _('Name format'))
lwidget.set_use_underline(True)
lwidget.set_mnemonic_widget(self.fmt_obox)
hbox = Gtk.HBox()
hbox = Gtk.Box()
btn = Gtk.Button("%s..." % _('Edit') )
btn.connect('clicked', self.cb_name_dialog)
hbox.pack_start(self.fmt_obox, True, True, 0)

View File

@ -483,7 +483,7 @@ def format_maker():
type_selector = GrampsFormatWidget()
type_selector.set(format_list)
box = Gtk.HBox()
box = Gtk.Box()
label = Gtk.Label(label=_('Select file _type:'))
label.set_use_underline(True)
label.set_mnemonic_widget(type_selector)

View File

@ -380,7 +380,7 @@ def main(args):
def test_info(obj):
InfoDialog('The title', 'This is a lot of info\n to show to all!', parent=win)
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
win.add(vbox)
btn1 = Gtk.Button('Info dialog')

View File

@ -98,7 +98,7 @@ class BackRefList(EmbeddedList):
self.edit_btn = SimpleButton(Gtk.STOCK_EDIT, self.edit_button_clicked)
self.edit_btn.set_tooltip_text(_('Edit reference'))
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.set_spacing(6)
hbox.pack_start(self.edit_btn, False, True, 0)
hbox.show_all()

View File

@ -161,7 +161,7 @@ class ButtonTab(GrampsTab):
else:
self.jump_btn = None
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.set_spacing(6)
if top_label:
hbox.pack_start(self.top_label, False, True, 0)

View File

@ -37,7 +37,7 @@ _RIGHT = Gdk.keyval_from_name("Right")
#
#-------------------------------------------------------------------------
class GrampsTab(Gtk.VBox):
class GrampsTab(Gtk.Box):
"""
This class provides the base level class for 'tabs', which are used to
fill in notebook tabs for GRAMPS edit dialogs.
@ -64,7 +64,7 @@ class GrampsTab(Gtk.VBox):
@param name: Notebook label name
@type name: str/unicode
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
# store information to pass to child windows
self.dbstate = dbstate
@ -102,9 +102,9 @@ class GrampsTab(Gtk.VBox):
by the derived class. Creates an container that has the label and
the icon in it.
@returns: widget to be used for the notebook label.
@rtype: Gtk.HBox
@rtype: Gtk.Box
"""
hbox = Gtk.HBox()
hbox = Gtk.Box()
icon = self.get_icon_name()
if isinstance(icon, tuple):
@ -143,7 +143,7 @@ class GrampsTab(Gtk.VBox):
container class is provided, and the object may manipulate the
child widgets contained in the container.
@returns: gtk widget
@rtype: Gtk.HBox
@rtype: Gtk.Box
"""
return self.label_container
@ -187,7 +187,7 @@ class GrampsTab(Gtk.VBox):
"""
Builds the interface for the derived class. This function should be
overridden in the derived class. Since the classes are derived from
Gtk.HBox, the self.pack_start, self.pack_end, and self.add functions
Gtk.Box, the self.pack_start, self.pack_end, and self.add functions
can be used to add widgets to the interface.
"""
pass

View File

@ -67,7 +67,7 @@ class EditPlaceName(ManagedWindow):
window.connect('response', self.response)
self.set_window(window, None, _('Place Name Editor'))
hbox = Gtk.HBox()
hbox = Gtk.Box()
label = Gtk.Label(_('Place Name:'))
self.entry = Gtk.Entry()
if index >= 0:

View File

@ -52,7 +52,7 @@ class SearchBar(object):
self.apply_text = ''
self.visible = False
self.filterbar = Gtk.HBox()
self.filterbar = Gtk.Box()
self.filter_text = Gtk.Entry()
self.filter_button = Gtk.Button(stock=Gtk.STOCK_FIND)
self.clear_button = Gtk.Button(stock=Gtk.STOCK_CLEAR)

View File

@ -224,7 +224,7 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(SPLASH)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(image, False, False, 5)
box.pack_start(label, False, False, 5)
@ -289,7 +289,7 @@ class ErrorReportAssistant(Gtk.Assistant):
button_box.pack_end(reset, False, False, 0)
button_box.pack_end(clear, False, False, 0)
error_details_box = Gtk.VBox()
error_details_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
error_details_box.pack_start(label, False, False, 0)
error_details_box.pack_start(sw_frame, True, True, 0)
error_details_box.pack_start(button_box, False, False, 0)
@ -316,11 +316,11 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(ICON)
heading = Gtk.HBox()
heading = Gtk.Box()
heading.pack_start(side_label, True, True, 5)
heading.pack_start(image, False, False, 5)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(heading, False, False, 5)
box.pack_start(error_details_frame, True, True, 0)
@ -370,7 +370,7 @@ class ErrorReportAssistant(Gtk.Assistant):
button_box.pack_end(reset, False, False, 0)
button_box.pack_end(clear, False, False, 0)
sys_information_box = Gtk.VBox()
sys_information_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
sys_information_box.pack_start(label, False, False, 0)
sys_information_box.pack_start(sw_frame, True, True, 0)
sys_information_box.pack_start(button_box, False, False, 0)
@ -395,11 +395,11 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(ICON)
heading = Gtk.HBox()
heading = Gtk.Box()
heading.pack_start(side_label, True, True, 5)
heading.pack_start(image, False, False, 5)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(heading, False, False, 5)
box.pack_start(sys_information_frame, True, True, 0)
@ -443,7 +443,7 @@ class ErrorReportAssistant(Gtk.Assistant):
button_box.pack_end(clear, False, False, 0)
user_information_box = Gtk.VBox()
user_information_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
user_information_box.pack_start(label, False, False, 0)
user_information_box.pack_start(sw_frame, True, True, 0)
user_information_box.pack_start(button_box, False, False, 0)
@ -467,11 +467,11 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(ICON)
heading = Gtk.HBox()
heading = Gtk.Box()
heading.pack_start(side_label, True, True, 5)
heading.pack_start(image, False, False, 5)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(heading, False, False, 5)
box.pack_start(user_information_frame, True, True, 0)
@ -509,7 +509,7 @@ class ErrorReportAssistant(Gtk.Assistant):
sw_frame = Gtk.Frame()
sw_frame.add(swin)
summary_box = Gtk.VBox()
summary_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
summary_box.pack_start(label, False, False, 0)
summary_box.pack_start(sw_frame, True, True, 0)
@ -534,11 +534,11 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(ICON)
heading = Gtk.HBox()
heading = Gtk.Box()
heading.pack_start(side_label, True, True, 5)
heading.pack_start(image, False, False, 5)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(heading, False, False, 5)
box.pack_start(summary_frame, True, True, 0)
@ -574,10 +574,10 @@ class ErrorReportAssistant(Gtk.Assistant):
url_button = Gtk.Button("File bug report")
url_button.connect('clicked', self._start_gramps_bts_in_browser)
url_button_vbox = Gtk.VBox()
url_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
url_button_vbox.pack_start(url_button, True, False, 0)
url_box = Gtk.HBox()
url_box = Gtk.Box()
url_box.pack_start(url_label, True, True, 0)
url_box.pack_start(url_button_vbox, False, False, 0)
@ -601,10 +601,10 @@ class ErrorReportAssistant(Gtk.Assistant):
clip_button = Gtk.Button("Copy to clipboard")
clip_button.connect('clicked', self._copy_to_clipboard)
clip_button_vbox = Gtk.VBox()
clip_button_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
clip_button_vbox.pack_start(clip_button, True, False, 0)
clip_box = Gtk.HBox()
clip_box = Gtk.Box()
clip_box.pack_start(clip_label, True, True, 0)
clip_box.pack_start(clip_button_vbox, False, False, 0)
@ -617,7 +617,7 @@ class ErrorReportAssistant(Gtk.Assistant):
clip_frame.add(clip_align)
inner_box = Gtk.VBox()
inner_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
inner_box.pack_start(label, False, False, 0)
inner_box.pack_start(clip_frame, False, False, 0)
inner_box.pack_start(url_frame, False, False, 0)
@ -643,11 +643,11 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(ICON)
heading = Gtk.HBox()
heading = Gtk.Box()
heading.pack_start(side_label, True, True, 5)
heading.pack_start(image, False, False, 5)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(heading, False, False, 5)
box.pack_start(outer_frame, True, True, 0)
@ -671,7 +671,7 @@ class ErrorReportAssistant(Gtk.Assistant):
image = Gtk.Image()
image.set_from_file(SPLASH)
box = Gtk.VBox()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(image, False, False, 5)
box.pack_start(label, False, False, 5)

View File

@ -85,7 +85,7 @@ class ErrorView(object):
vbox = self.top.get_content_area()
vbox.set_spacing(5)
self.top.set_border_width(12)
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.set_spacing(12)
image = Gtk.Image()
image.set_from_stock(Gtk.STOCK_DIALOG_ERROR, Gtk.IconSize.DIALOG)

View File

@ -91,17 +91,17 @@ class Navigator(object):
self.cat_view_group = None
self.merge_ids = []
self.top = Gtk.VBox()
self.top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
frame = Gtk.Frame()
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.show()
frame.add(hbox)
frame.show()
self.select_button = Gtk.ToggleButton()
self.select_button.set_relief(Gtk.ReliefStyle.NONE)
select_hbox = Gtk.HBox()
select_hbox = Gtk.Box()
self.title_label = Gtk.Label(label='')
arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN,
shadow_type=Gtk.ShadowType.NONE)

View File

@ -490,13 +490,13 @@ class GuiBooleanOption(Gtk.CheckButton):
# GuiEnumeratedListOption class
#
#-------------------------------------------------------------------------
class GuiEnumeratedListOption(Gtk.HBox):
class GuiEnumeratedListOption(Gtk.Box):
"""
This class displays an option that provides a finite number of values.
Each possible value is assigned a value and a description.
"""
def __init__(self, option, dbstate, uistate, track, override):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
evtBox = Gtk.EventBox()
self.__option = option
self.__combo = Gtk.ComboBoxText()
@ -587,7 +587,7 @@ class GuiEnumeratedListOption(Gtk.HBox):
# GuiPersonOption class
#
#-------------------------------------------------------------------------
class GuiPersonOption(Gtk.HBox):
class GuiPersonOption(Gtk.Box):
"""
This class displays an option that allows a person from the
database to be selected.
@ -598,7 +598,7 @@ class GuiPersonOption(Gtk.HBox):
@type option: gen.plug.menu.PersonOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -712,7 +712,7 @@ class GuiPersonOption(Gtk.HBox):
# GuiFamilyOption class
#
#-------------------------------------------------------------------------
class GuiFamilyOption(Gtk.HBox):
class GuiFamilyOption(Gtk.Box):
"""
This class displays an option that allows a family from the
database to be selected.
@ -723,7 +723,7 @@ class GuiFamilyOption(Gtk.HBox):
@type option: gen.plug.menu.FamilyOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -901,7 +901,7 @@ class GuiFamilyOption(Gtk.HBox):
# GuiNoteOption class
#
#-------------------------------------------------------------------------
class GuiNoteOption(Gtk.HBox):
class GuiNoteOption(Gtk.Box):
"""
This class displays an option that allows a note from the
database to be selected.
@ -912,7 +912,7 @@ class GuiNoteOption(Gtk.HBox):
@type option: gen.plug.menu.NoteOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -1005,7 +1005,7 @@ class GuiNoteOption(Gtk.HBox):
# GuiMediaOption class
#
#-------------------------------------------------------------------------
class GuiMediaOption(Gtk.HBox):
class GuiMediaOption(Gtk.Box):
"""
This class displays an option that allows a media object from the
database to be selected.
@ -1016,7 +1016,7 @@ class GuiMediaOption(Gtk.HBox):
@type option: gen.plug.menu.MediaOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -1106,7 +1106,7 @@ class GuiMediaOption(Gtk.HBox):
# GuiPersonListOption class
#
#-------------------------------------------------------------------------
class GuiPersonListOption(Gtk.HBox):
class GuiPersonListOption(Gtk.Box):
"""
This class displays a widget that allows multiple people from the
database to be selected.
@ -1117,7 +1117,7 @@ class GuiPersonListOption(Gtk.HBox):
@type option: gen.plug.menu.PersonListOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -1283,7 +1283,7 @@ class GuiPersonListOption(Gtk.HBox):
# GuiPlaceListOption class
#
#-------------------------------------------------------------------------
class GuiPlaceListOption(Gtk.HBox):
class GuiPlaceListOption(Gtk.Box):
"""
This class displays a widget that allows multiple places from the
database to be selected.
@ -1294,7 +1294,7 @@ class GuiPlaceListOption(Gtk.HBox):
@type option: gen.plug.menu.PlaceListOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -1426,7 +1426,7 @@ class GuiPlaceListOption(Gtk.HBox):
# GuiSurnameColorOption class
#
#-------------------------------------------------------------------------
class GuiSurnameColorOption(Gtk.HBox):
class GuiSurnameColorOption(Gtk.Box):
"""
This class displays a widget that allows multiple surnames to be
selected from the database, and to assign a colour (not necessarily
@ -1438,7 +1438,7 @@ class GuiSurnameColorOption(Gtk.HBox):
@type option: gen.plug.menu.SurnameColorOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__dbstate = dbstate
self.__db = dbstate.get_database()
@ -1618,7 +1618,7 @@ class GuiSurnameColorOption(Gtk.HBox):
# GuiDestinationOption class
#
#-------------------------------------------------------------------------
class GuiDestinationOption(Gtk.HBox):
class GuiDestinationOption(Gtk.Box):
"""
This class displays an option that allows the user to select a
DestinationOption.
@ -1629,7 +1629,7 @@ class GuiDestinationOption(Gtk.HBox):
@type option: gen.plug.menu.DestinationOption
@return: nothing
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__entry = Gtk.Entry()
self.__entry.set_text( self.__option.get_value() )
@ -1787,13 +1787,13 @@ class GuiStyleOption(GuiEnumeratedListOption):
# GuiBooleanListOption class
#
#-------------------------------------------------------------------------
class GuiBooleanListOption(Gtk.HBox):
class GuiBooleanListOption(Gtk.Box):
"""
This class displays an option that provides a list of check boxes.
Each possible value is assigned a value and a description.
"""
def __init__(self, option, dbstate, uistate, track, override):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.__option = option
self.__cbutton = []
@ -1804,7 +1804,7 @@ class GuiBooleanListOption(Gtk.HBox):
COLUMNS = 3
column = []
for i in range(COLUMNS):
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.pack_start(vbox, True, True, 0)
column.append(vbox)
vbox.show()

View File

@ -24,10 +24,10 @@ import os
from gi.repository import Gtk
from gi.repository import GObject
from gramps.gen.constfunc import conv_to_unicode, get_curr_dir, uni_to_gui
class FileEntry(Gtk.HBox):
class FileEntry(Gtk.Box):
""" A widget that allows the user to select a file from the file system """
def __init__(self, defname, title):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.title = title
self.dir = False

View File

@ -131,11 +131,11 @@ class OrientationComboBox(Gtk.ComboBox):
# PaperFrame
#
#-------------------------------------------------------------------------
class PaperFrame(Gtk.HBox):
class PaperFrame(Gtk.Box):
"""PaperFrame provides all the entry necessary to specify a paper style. """
def __init__(self,default_metric,default_name,default_orientation,
margins=[2.54,2.54,2.54,2.54], custom=[29.7,21.0]):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
glade_xml = Glade()
self.paper_grid = glade_xml.get_object('paper_grid')

View File

@ -349,7 +349,7 @@ class StyleEditor(object):
self.vbox.remove(widget)
for i in range(t.get_columns()):
hbox = Gtk.HBox()
hbox = Gtk.Box()
label = Gtk.Label(_('Column %d:') % (i + 1))
hbox.pack_start(label, False, False, 6)
spin = Gtk.SpinButton()

View File

@ -371,9 +371,9 @@ class ViewManager(CLIManager):
self.window.set_has_resize_grip(True)
self.window.set_default_size(width, height)
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add(vbox)
hpane = Gtk.HPaned()
hpane = Gtk.Paned()
self.ebox = Gtk.EventBox()
self.navigator = Navigator(self)
@ -393,7 +393,7 @@ class ViewManager(CLIManager):
self.toolbar = self.uimanager.get_widget('/ToolBar')
vbox.pack_start(self.menubar, False, True, 0)
vbox.pack_start(self.toolbar, False, True, 0)
vbox.add(hpane)
vbox.pack_start(hpane, True, True, 0)
self.statusbar = Statusbar()
self.statusbar.show()
vbox.pack_end(self.statusbar, False, True, 0)
@ -981,7 +981,7 @@ class ViewManager(CLIManager):
self.pages.append(page)
# create icon/label for notebook tab (useful for debugging)
hbox = Gtk.HBox()
hbox = Gtk.Box()
image = Gtk.Image()
image.set_from_stock(page.get_stock(), Gtk.IconSize.MENU)
hbox.pack_start(image, False, True, 0)
@ -1232,7 +1232,7 @@ class ViewManager(CLIManager):
close_button = window.add_button(Gtk.STOCK_CLOSE,
Gtk.ResponseType.CLOSE)
vbox = window.get_content_area()
hbox = Gtk.HBox()
hbox = Gtk.Box()
label = Gtk.Label(label=_("Path:"))
label.set_justify(Gtk.Justification.LEFT)
label.set_size_request(90, -1)
@ -1252,7 +1252,7 @@ class ViewManager(CLIManager):
button.add(image)
hbox.pack_end(button, False, True, 0)
vbox.pack_start(hbox, False, True, 0)
hbox = Gtk.HBox()
hbox = Gtk.Box()
label = Gtk.Label(label=_("File:"))
label.set_justify(Gtk.Justification.LEFT)
label.set_size_request(90, -1)
@ -1271,7 +1271,7 @@ class ViewManager(CLIManager):
})
hbox.pack_end(file_entry, True, True, 0)
vbox.pack_start(hbox, False, True, 0)
hbox = Gtk.HBox()
hbox = Gtk.Box()
bytes = 0
mbytes = "0"
for media in self.dbstate.db.iter_media_objects():

View File

@ -216,7 +216,7 @@ class Bookmarks :
% _("Organize Bookmarks"))
label.set_use_markup(True)
self.top.vbox.pack_start(label, 0, 0, 5)
box = Gtk.HBox()
box = Gtk.Box()
self.top.vbox.pack_start(box, 1, 1, 5)
name_titles = [(_('Name'), -1, 200), (_('ID'), -1, 50), ('', -1, 0)]

View File

@ -143,7 +143,7 @@ class ListView(NavigationView):
contains the interface. This containter will be inserted into
a Gtk.Notebook page.
"""
self.vbox = Gtk.VBox()
self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.vbox.set_border_width(4)
self.vbox.set_spacing(4)
@ -1010,7 +1010,7 @@ class ListView(NavigationView):
combobox = Gtk.ComboBoxText()
label = Gtk.Label(label=_("Format:"))
label.set_alignment(1.0, 0.5)
box = Gtk.HBox()
box = Gtk.Box()
box.pack_start(label, True, True, padding=12)
box.pack_start(combobox, False, False, 0)
combobox.append_text(_('CSV'))

View File

@ -350,7 +350,7 @@ class NavigationView(PageView):
dialog.vbox.add(label)
dialog.vbox.set_spacing(10)
dialog.vbox.set_border_width(12)
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.pack_start(Gtk.Label("%s: " % _('ID', True, True, 0)), False)
text = Gtk.Entry()
text.set_activates_default(True)

View File

@ -626,7 +626,7 @@ class DummyPage(PageView):
PageView.__init__(self, title, pdata, dbstate, uistate)
def build_widget(self):
box = Gtk.VBox(homogeneous=False, spacing=1)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=1)
#top widget at the top
box.pack_start(Gtk.Label(label=_('View %(name)s: %(msg)s') % {
'name': self.title,

View File

@ -379,7 +379,7 @@ class OrganizeTagsDialog(object):
% _("Organize Tags"))
label.set_use_markup(True)
top.vbox.pack_start(label, 0, 0, 5)
box = Gtk.HBox()
box = Gtk.Box()
top.vbox.pack_start(box, 1, 1, 5)
name_titles = [('', NOSORT, 20, INTEGER), # Priority
@ -587,7 +587,7 @@ class EditTag(object):
top.set_transient_for(self.parent_window)
top.vbox.set_spacing(5)
hbox = Gtk.HBox()
hbox = Gtk.Box()
top.vbox.pack_start(hbox, False, False, 10)
label = Gtk.Label(label=_('Tag Name:'))

View File

@ -49,10 +49,10 @@ from gramps.gen.lib.date import Date
# DateEntry class
#
#-------------------------------------------------------------------------
class DateEntry(Gtk.HBox):
class DateEntry(Gtk.Box):
def __init__(self, uistate, track):
Gtk.HBox.__init__(self)
Gtk.Box.__init__(self)
self.entry = ValidatableMaskedEntry()
self.entry.set_width_chars(13)
self.pack_start(self.entry, True, True, 0)

View File

@ -112,7 +112,8 @@ class GrampletBar(Gtk.Notebook):
self.set_scrollable(True)
book_button = Gtk.Button()
box = Gtk.VBox() # Arrow is too small unless in a Vbox
# Arrow is too small unless in a box
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN,
shadow_type=Gtk.ShadowType.NONE)
arrow.show()
@ -691,12 +692,12 @@ class DetachedWindow(ManagedWindow):
# TabLabel class
#
#-------------------------------------------------------------------------
class TabLabel(Gtk.HBox):
class TabLabel(Gtk.Box):
"""
Create a tab label consisting of a label and a close button.
"""
def __init__(self, gramplet, callback):
Gtk.HBox.__init__(self)
Gtk.Box.__init__(self)
self.text = gramplet.title
self.set_spacing(4)

View File

@ -157,7 +157,7 @@ class InteractiveSearchBox():
frame.show()
self._search_window.add(frame)
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.show()
frame.add(vbox)
vbox.set_border_width(3)

View File

@ -128,7 +128,7 @@ class LinkLabel(Gtk.EventBox):
self.label.set_use_markup(True)
self.label.set_alignment(0, 0.5)
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.pack_start(self.label, False, False, 0)
if label[1]:
hbox.pack_start(GenderLabel(label[1]), False, False, 0)
@ -186,9 +186,9 @@ class LinkLabel(Gtk.EventBox):
# EditLabel class
#
#-------------------------------------------------------------------------
class EditLabel(Gtk.HBox):
class EditLabel(Gtk.Box):
def __init__(self, text):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
label = BasicLabel(text)
self.pack_start(label, False, True, 0)
self.pack_start(Gtk.Image.new_from_stock(Gtk.STOCK_EDIT,
@ -242,10 +242,10 @@ class MarkupLabel(Gtk.Label):
# DualMarkupLabel class
#
#-------------------------------------------------------------------------
class DualMarkupLabel(Gtk.HBox):
class DualMarkupLabel(Gtk.Box):
def __init__(self, text, alt, x_align=0, y_align=0.5):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
label = Gtk.Label(label=text)
label.set_alignment(x_align, y_align)
label.set_use_markup(True)

View File

@ -41,10 +41,10 @@ from gi.repository import Gtk
# LinkBox class
#
#-------------------------------------------------------------------------
class LinkBox(Gtk.HBox):
class LinkBox(Gtk.Box):
def __init__(self, link, button):
GObject.GObject.__init__(self)
Gtk.Box.__init__(self)
self.set_spacing(6)
self.pack_start(link, False, True, 0)
if button:

View File

@ -410,7 +410,7 @@ class ProgressMonitor(object):
# _GtkProgressBar
#
#-------------------------------------------------------------------------
class _GtkProgressBar(Gtk.VBox):
class _GtkProgressBar(Gtk.Box):
"""
This widget displays the progress bar and labels for a progress
indicator. It provides an interface to updating the progress bar.
@ -421,7 +421,7 @@ class _GtkProgressBar(Gtk.VBox):
:param long_op_status: the status of the operation.
:type long_op_status: :class:`.LongOpStatus`
"""
GObject.GObject.__init__(self)
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
msg = long_op_status.get_msg()
self._old_val = -1
@ -430,7 +430,7 @@ class _GtkProgressBar(Gtk.VBox):
#self.set_border_width(24)
self._pbar = Gtk.ProgressBar()
self._hbox = Gtk.HBox()
self._hbox = Gtk.Box()
# Only display the cancel button is the operation
# can be canceled.

View File

@ -45,12 +45,12 @@ from . import WarnButton
# Statusbar class
#
#-------------------------------------------------------------------------
class Statusbar(Gtk.HBox):
class Statusbar(Gtk.Box):
"""
A status bar
"""
def __init__(self):
Gtk.HBox.__init__(self)
Gtk.Box.__init__(self)
self.set_spacing(4)
self.set_border_width(2)

View File

@ -1423,7 +1423,7 @@ def main(args):
Gtk.main_quit()
win.connect('delete-event', cb)
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
win.add(vbox)
label = Gtk.Label(label='Pre-filled entry validated against the given list:')

View File

@ -56,8 +56,8 @@ class AgeOnDateGramplet(Gramplet):
from gi.repository import Gtk
# GUI setup:
self.set_tooltip(_("Enter a date, click Run"))
vbox = Gtk.VBox()
hbox = Gtk.HBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox = Gtk.Box()
# label, entry
description = Gtk.TextView()
description.set_wrap_mode(Gtk.WrapMode.WORD)

View File

@ -41,7 +41,7 @@ class CalendarGramplet(Gramplet):
self.gui.calendar.set_display_options(
Gtk.CalendarDisplayOptions.SHOW_HEADING)
self.gui.get_container_widget().remove(self.gui.textview)
vbox = Gtk.VBox(homogeneous=False, spacing=0)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(self.gui.calendar, False, False, 0)
self.gui.get_container_widget().add_with_viewport(vbox)
vbox.show_all()

View File

@ -70,7 +70,7 @@ class PythonEvaluation(Gramplet):
"""
Build the GUI interface.
"""
self.top = Gtk.VBox()
self.top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.top.set_border_width(6)
self.ebuf = self.__add_text_view(_("Evaluation"))

View File

@ -37,7 +37,7 @@ class Gallery(Gramplet):
Build the GUI interface.
"""
self.image_list = []
self.top = Gtk.HBox(homogeneous=False, spacing=3)
self.top = Gtk.Box(spacing=3)
return self.top
def clear_images(self):

View File

@ -79,7 +79,7 @@ class Leak(Gramplet):
"""
Build the GUI interface.
"""
self.top = Gtk.VBox()
self.top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.top.set_border_width(6)
self.label = Gtk.Label()

View File

@ -35,7 +35,7 @@ class MediaPreview(Gramplet):
"""
Build the GUI interface.
"""
self.top = Gtk.HBox()
self.top = Gtk.Box()
self.photo = Photo(self.uistate.screen_height() < 1000)
self.top.pack_start(self.photo, fill=True, expand=False, padding=5)
self.top.show_all()

View File

@ -40,9 +40,9 @@ class Notes(Gramplet):
"""
Build the GUI interface.
"""
top = Gtk.VBox(homogeneous=False)
top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox = Gtk.HBox()
hbox = Gtk.Box()
self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked)
self.left.set_sensitive(False)
hbox.pack_start(self.left, False, False, 0)

View File

@ -40,9 +40,9 @@ class ToDo(Gramplet):
"""
Build the GUI interface.
"""
top = Gtk.VBox(homogeneous=False)
top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox = Gtk.HBox()
hbox = Gtk.Box()
self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked)
self.left.set_tooltip_text(_('Previous To Do note'))
self.left.set_sensitive(False)

View File

@ -43,9 +43,9 @@ class ToDoGramplet(Gramplet):
"""
Build the GUI interface.
"""
top = Gtk.VBox(homogeneous=False)
top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox = Gtk.HBox()
hbox = Gtk.Box()
self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked)
self.left.set_tooltip_text(_('Previous To Do note'))
self.left.set_sensitive(False)

View File

@ -82,7 +82,7 @@ class WelcomeGramplet(Gramplet):
"""
Build the GUI interface.
"""
top = Gtk.VBox(homogeneous=False)
top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)

View File

@ -100,7 +100,7 @@ class OsmGps():
"""
create the vbox
"""
self.vbox = Gtk.VBox(homogeneous=False, spacing=0)
self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
cache_path = config.get('geography.path')
if not os.path.isdir(cache_path):
try:

View File

@ -72,7 +72,7 @@ class CategorySidebar(BaseSidebar):
self.merge_ids = []
self.window = Gtk.ScrolledWindow()
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add_with_viewport(vbox)
self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.window.show()
@ -176,7 +176,7 @@ class CategorySidebar(BaseSidebar):
# add the image. If we are using text, use the BUTTON (larger) size.
# otherwise, use the smaller size
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.show()
image = Gtk.Image()
if use_text:

View File

@ -171,7 +171,7 @@ class DropdownSidebar(BaseSidebar):
# add the image. If we are using text, use the BUTTON (larger) size.
# otherwise, use the smaller size
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.show()
image = Gtk.Image()
if use_text:

View File

@ -60,7 +60,7 @@ class ExpanderSidebar(BaseSidebar):
self.lookup = {}
self.window = Gtk.ScrolledWindow()
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add_with_viewport(vbox)
self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.window.show()
@ -71,7 +71,7 @@ class ExpanderSidebar(BaseSidebar):
expander = Gtk.Expander()
self.expanders.append(expander)
catbox = Gtk.HBox()
catbox = Gtk.Box()
image = Gtk.Image()
image.set_from_stock(cat_icon, Gtk.IconSize.BUTTON)
catbox.pack_start(image, False, False, 4)
@ -81,7 +81,7 @@ class ExpanderSidebar(BaseSidebar):
catbox.set_tooltip_text(cat_name)
expander.set_label_widget(catbox)
viewbox = Gtk.VBox()
viewbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
for view_num, view_name, view_icon in views[cat_num]:
# create the button and add it to the sidebar
button = self.__make_sidebar_button(use_text, cat_num, view_num,
@ -167,7 +167,7 @@ class ExpanderSidebar(BaseSidebar):
Create the sidebar button. The page_title is the text associated with
the button.
"""
top = Gtk.HBox()
top = Gtk.Box()
# create the button
button = Gtk.ToggleButton()
@ -186,7 +186,7 @@ class ExpanderSidebar(BaseSidebar):
# add the image. If we are using text, use the BUTTON (larger) size.
# otherwise, use the smaller size
hbox = Gtk.HBox()
hbox = Gtk.Box()
hbox.show()
image = Gtk.Image()
if use_text:

View File

@ -117,19 +117,19 @@ class PatchNames(tool.BatchTool, ManagedWindow):
(Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT))
winprefix.vbox.set_spacing(5)
hboxpref = Gtk.HBox()
hboxpref = Gtk.Box()
hboxpref.pack_start(Gtk.Label(_('Prefixes to search for:')), False, False, 5)
self.prefixbox = Gtk.Entry()
self.prefixbox.set_text(', '.join(PREFIX_LIST))
hboxpref.pack_start(self.prefixbox, True, True, 0)
winprefix.vbox.pack_start(hboxpref, True, True, 0)
hboxcon = Gtk.HBox()
hboxcon = Gtk.Box()
hboxcon.pack_start(Gtk.Label(_('Connectors splitting surnames:')), False, False, 5)
self.conbox = Gtk.Entry()
self.conbox.set_text(', '.join(CONNECTOR_LIST))
hboxcon.pack_start(self.conbox, True, True, 0)
winprefix.vbox.pack_start(hboxcon, True, True, 0)
hboxconns = Gtk.HBox()
hboxconns = Gtk.Box()
hboxconns.pack_start(Gtk.Label(_('Connectors not splitting surnames:')), False, False, 5)
self.connsbox = Gtk.Entry()
self.connsbox.set_text(', '.join(CONNECTOR_LIST_NONSPLIT))

View File

@ -92,21 +92,21 @@ class PopulateSources(tool.Tool, ManagedWindow):
" number of citations.")
label.set_line_wrap(True)
hbox1 = Gtk.HBox()
hbox1 = Gtk.Box()
label_sources = Gtk.Label(label="Number of sources" + ":")
self.sources_entry = Gtk.Entry()
self.sources_entry.set_text("%d" % num_sources)
hbox1.pack_start(label_sources, False, True, 0)
hbox1.pack_start(self.sources_entry, True, True, 0)
hbox2 = Gtk.HBox()
hbox2 = Gtk.Box()
label_citations = Gtk.Label(label="Number of citations" + ":")
self.citations_entry = Gtk.Entry()
self.citations_entry.set_text("%d" % num_citations)
hbox2.pack_start(label_citations, False, True, 0)
hbox2.pack_start(self.citations_entry, True, True, 0)
vbox = Gtk.VBox()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(label, True, True, 0)
vbox.pack_start(hbox1, False, True, 0)
vbox.pack_start(hbox2, False, True, 0)

View File

@ -344,7 +344,7 @@ class HtmlView(NavigationView):
contains the interface. This containter will be inserted into
a Gtk.Notebook page.
"""
self.box = Gtk.VBox(spacing=4)
self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=4)
#top widget at the top
self.box.pack_start(self.top_widget(), False, False, 0 )
#web page under it in a scrolled window