示例#1
0
        public void TBESG_AddRemove_RemoveAll()
        {
            ToggleButtonExclusiveSelectionGroup grp = new ToggleButtonExclusiveSelectionGroup();

            Gtk.ToggleButton toAdd  = new Gtk.ToggleButton();
            Gtk.ToggleButton toAdd2 = new Gtk.ToggleButton();
            Gtk.ToggleButton toAdd3 = new Gtk.ToggleButton();
            Gtk.ToggleButton toAdd4 = new Gtk.ToggleButton();
            Gtk.ToggleButton toAdd5 = new Gtk.ToggleButton();

            grp.Append(toAdd);
            grp.Append(toAdd2);
            grp.Append(toAdd3);
            grp.Append(toAdd4);
            grp.Append(toAdd5);

            Assert.AreEqual(5, grp.GetCountButton(), "There should be 5 buttons in the group");
            grp.Select(toAdd3);
            Assert.AreEqual(true, toAdd3.Active, "Control 3 should be selected.");

            grp.RemoveAll();
            Assert.AreEqual(0, grp.GetCountButton(), "There should be no button in the group");
            Assert.AreEqual(false, toAdd3.Active, "Control 3 should no longer be selected.");
        }