newSelectButtonsFrame :: (Container par) => par -> IO SelButtonFrame
newSelectButtonsFrame b3 = do
  selFrame <- newFrame b3 []
  pack selFrame [Expand Off, Fill None, Side AtLeft, Anchor SouthWest]

  selHBox <- newHBox selFrame []
  pack selHBox [Expand Off, Fill None, Anchor West]

  selectAllButton <- newButton selHBox [text "Select all"]
  pack selectAllButton [Expand Off, Fill None]

  deselectAllButton <- newButton selHBox [text "Deselect all"]
  pack deselectAllButton [Expand Off, Fill None]
  -- events
  selectAll <- clicked selectAllButton
  deselectAll <- clicked deselectAllButton
  return SBF
    { selAllEv = selectAll
    , deselAllEv = deselectAll
    , sbfBtns = [deselectAllButton, selectAllButton]
    , sbfBtnFrame = selFrame }
newSelectButtonsFrame :: (Container par) => par -> IO SelButtonFrame
newSelectButtonsFrame b3 = do
  selFrame <- newFrame b3 []
  pack selFrame [Expand Off, Fill None, Side AtLeft, Anchor SouthWest]

  selHBox <- newHBox selFrame []
  pack selHBox [Expand Off, Fill None, Anchor West]

  selectAllButton <- newButton selHBox [text "Select all"]
  pack selectAllButton [Expand Off, Fill None]

  deselectAllButton <- newButton selHBox [text "Deselect all"]
  pack deselectAllButton [Expand Off, Fill None]
  -- events
  selectAll <- clicked selectAllButton
  deselectAll <- clicked deselectAllButton
  return SBF
    { selAllEv = selectAll
    , deselAllEv = deselectAll
    , sbfBtns = [deselectAllButton, selectAllButton]
    , sbfBtnFrame = selFrame }
newSelectButtonsFrame b3 = do
  selFrame <- newFrame b3 []
  pack selFrame [Expand Off, Fill None, Side AtLeft, Anchor SouthWest]

  selHBox <- newHBox selFrame []
  pack selHBox [Expand Off, Fill None, Anchor West]

  selectAllButton <- newButton selHBox [text "Select all"]
  pack selectAllButton [Expand Off, Fill None]

  deselectAllButton <- newButton selHBox [text "Deselect all"]
  pack deselectAllButton [Expand Off, Fill None]
  -- events
  selectAll <- clicked selectAllButton
  deselectAll <- clicked deselectAllButton
  return SBF
    { selAllEv = selectAll
    , deselAllEv = deselectAll
    , sbfBtns = [deselectAllButton, selectAllButton]
    , sbfBtnFrame = selFrame }