dynamicMenuNew :: MonadIO m => DynamicMenuConfig -> m Gtk.Widget
dynamicMenuNew DynamicMenuConfig
                 { dmClickWidget = clickWidget
                 , dmPopulateMenu = populateMenu
                 } = do
  button <- Gtk.menuButtonNew
  menu <- Gtk.menuNew
  Gtk.containerAdd button clickWidget
  Gtk.menuButtonSetPopup button $ Just menu

  _ <- Gtk.onButtonPressed button $ emptyMenu menu >> populateMenu menu

  Gtk.widgetShowAll button

  Gtk.toWidget button
dynamicMenuNew :: MonadIO m => DynamicMenuConfig -> m Gtk.Widget
dynamicMenuNew DynamicMenuConfig
                 { dmClickWidget = clickWidget
                 , dmPopulateMenu = populateMenu
                 } = do
  button <- Gtk.menuButtonNew
  menu <- Gtk.menuNew
  Gtk.containerAdd button clickWidget
  Gtk.menuButtonSetPopup button $ Just menu

  _ <- Gtk.onButtonPressed button $ emptyMenu menu >> populateMenu menu

  Gtk.widgetShowAll button

  Gtk.toWidget button
dynamicMenuNew DynamicMenuConfig
                 { dmClickWidget = clickWidget
                 , dmPopulateMenu = populateMenu
                 } = do
  button <- Gtk.menuButtonNew
  menu <- Gtk.menuNew
  Gtk.containerAdd button clickWidget
  Gtk.menuButtonSetPopup button $ Just menu

  _ <- Gtk.onButtonPressed button $ emptyMenu menu >> populateMenu menu

  Gtk.widgetShowAll button

  Gtk.toWidget button