From c70e39cff653509a81d432d652352e94f36764f5 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 23 Aug 1999 22:05:09 +0000 Subject: go back to checkboxes --- iw/package.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'iw/package.py') diff --git a/iw/package.py b/iw/package.py index 6f29394a1..56bbd3f3e 100644 --- a/iw/package.py +++ b/iw/package.py @@ -40,6 +40,7 @@ class IndividualPackageSelectionWindow (InstallWindow): elif isinstance (x, UpgradeExamineWindow): return UpgradeExamineWindow return None + def build_tree (self, x): if (x == ()): return () @@ -395,10 +396,6 @@ class PackageSelectionWindow (InstallWindow): box = GtkVBox (FALSE, 0) - self.list = GtkCList () - self.list.set_row_height (50) - self.list.set_selection_mode (SELECTION_MULTIPLE) - for comp in self.todo.comps: if not comp.hidden: pixname = string.replace (comp.name, ' ', '_') @@ -412,24 +409,32 @@ class PackageSelectionWindow (InstallWindow): checkButton = None if pixname in xpms.__dict__.keys (): picture = xpms.__dict__[pixname] - - row = self.list.append ((comp.name,)) if picture: im = GdkImlib.create_image_from_xpm (picture) im.render () pix = im.make_pixmap () - self.list.set_pixtext (row, 0, comp.name, 5, pix) - if comp.selected: - self.list.select_row (row, 0) + hbox = GtkHBox (FALSE, 5) + hbox.pack_start (pix, FALSE, FALSE, 0) + label = GtkLabel (comp.name) + label.set_alignment (0.0, 0.5) + hbox.pack_start (label, TRUE, TRUE, 0) + checkButton = GtkCheckButton () + checkButton.add (hbox) + else: + checkButton = GtkCheckButton (comp.name) + checkButton.set_active (comp.selected) def toggled (widget, comp): if widget.get_active (): comp.select (1) else: comp.unselect (0) + + checkButton.connect ("toggled", toggled, comp) + + box.pack_start (checkButton) - self.list.columns_autosize () - sw.add (self.list) + sw.add_with_viewport (box) vbox = GtkVBox (FALSE, 5) self.individualPackages = GtkCheckButton ("Select individual packages") -- cgit