def _initialize_dialog_widgets(self): self.vbox.set_spacing(8) self.topcontainer = gtk.Frame("<b>%s</b>" % _("Categories")) self.topcontainer.props.label_widget.set_use_markup(True) self.topcontainer.set_shadow_type(gtk.SHADOW_NONE) self.topcontainer_alignment = gtk.Alignment() self.topcontainer_alignment.set_padding(10, 0, 12, 0) self.topcontainer.add(self.topcontainer_alignment) self.fieldbox = gtk.VBox(homogeneous=False, spacing=6) self.list = ViewCategory() self.list.set_size_request(300, 150) # ScrolledWindow self.scrolledwindow = gtk.ScrolledWindow() self.scrolledwindow.set_shadow_type(gtk.SHADOW_OUT) self.scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.scrolledwindow.add(self.list) self.table = gtk.Table(rows=2, columns=2, homogeneous=False) self.table.set_col_spacing(0, 6) self.table.set_row_spacing(0, 6) self.namelabel = gtk.Label() self.namelabel.set_markup("%s " % _("Name:")) self.namelabel.set_alignment(0.00, 0.50) self.colorlabel = gtk.Label() self.colorlabel.set_markup("%s " % _("Color:")) self.colorlabel.set_alignment(0.00, 0.50) self.name_ = gtk.Entry() self.color = gtk.ColorButton() self.table.attach(self.namelabel, 0, 1, 0, 1, gtk.FILL, gtk.FILL) self.table.attach(self.colorlabel, 0, 1, 1, 2, gtk.FILL, gtk.FILL) self.table.attach(self.name_, 1, 2, 0, 1) self.table.attach(self.color, 1, 2, 1, 2) self.actionspack = gtk.HButtonBox() self.actionspack.set_layout(gtk.BUTTONBOX_END) self.actionspack.set_spacing(6) self.newbutton = gtk.Button(stock=gtk.STOCK_NEW) self.savebutton = gtk.Button(stock=gtk.STOCK_SAVE) self.deletebutton = gtk.Button(stock=gtk.STOCK_DELETE) self.actionspack.pack_start(self.newbutton) self.actionspack.pack_start(self.savebutton) self.actionspack.pack_start(self.deletebutton) if not self.new: self.fieldbox.pack_start(self.scrolledwindow, expand=True, fill=True) self.fieldbox.pack_start(self.table, expand=False, fill=True) if not self.new: self.fieldbox.pack_start(self.actionspack, expand=False, fill=True) self.topcontainer_alignment.add(self.fieldbox) self.vbox.pack_start(self.topcontainer, expand=True, fill=True, padding=10) # Show all widgets self.show_all()