    {-# LINE 2 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
    {-# LANGUAGE OverloadedStrings #-}

    {-# LINE 3 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) Widget MenuItem
    --
    -- Author : Axel Simon
    --
    -- Created: 15 May 2001
    --
    -- Copyright (C) 1999-2005 Axel Simon
    --
    -- This library is free software; you can redistribute it and/or
    -- modify it under the terms of the GNU Lesser General Public
    -- License as published by the Free Software Foundation; either
    -- version 2.1 of the License, or (at your option) any later version.
    --
    -- This library is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -- Lesser General Public License for more details.
    --
    -- NOTES
    --
    -- This widget derives from 'Item'. Since CList and CTree are deprecated, it
    -- is the only child of that widget. The three signals defined by Item are
    -- therefore bound in this module.
    --
    -- TODO
    --
    -- figure out what the signals \"toggle-size-allocate\" and
    -- \"toggle-size-request\" are good for and bind them if useful
    --
    -- figure out if the connectToToggle signal is useful at all
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- The widget used for item in menus
    --
    module Graphics.UI.Gtk.MenuComboToolbar.MenuItem (
    -- * Detail
    --
    -- | The 'MenuItem' widget and the derived widgets are the only valid children
    -- for menus. Their function is to correctly handle highlighting, alignment,
    -- events and submenus.
    --
    -- As it derives from 'Bin' it can hold any valid child widget, although only
    -- a few are really useful.

    -- * Class Hierarchy
    -- |
    -- @
    -- | 'GObject'
    -- | +----'Object'
    -- | +----'Widget'
    -- | +----'Container'
    -- | +----'Bin'
    -- | +----'Item'
    -- | +----MenuItem
    -- | +----'CheckMenuItem'
    -- | +----'ImageMenuItem'
    -- | +----'SeparatorMenuItem'
    -- | +----'TearoffMenuItem'
    -- @

    -- * Types
      MenuItem,
      MenuItemClass,
      castToMenuItem, gTypeMenuItem,
      toMenuItem,

    -- * Constructors
      menuItemNew,
      menuItemNewWithLabel,
      menuItemNewWithMnemonic,

    -- * Methods

      menuItemSetLabel,
      menuItemGetLabel,
      menuItemSetUseUnderline,
      menuItemGetUseUnderline,

      menuItemSetSubmenu,
      menuItemGetSubmenu,
      menuItemRemoveSubmenu,
      menuItemEmitSelect,
      menuItemEmitDeselect,
      menuItemEmitActivate,
      menuItemSetRightJustified,
      menuItemGetRightJustified,
      menuItemSetAccelPath,

    -- * Attributes
      menuItemSubmenu,
      menuItemRightJustified,

      menuItemLabel,
      menuItemUseUnderline,

    -- * Signals
      menuItemActivatedItem,
      menuItemActivated,
      menuItemActivateItem,
      menuItemActivate,
      menuItemSelect,
      menuItemDeselect,
      menuItemToggle,
    {-# LINE 128 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
      ) where

    import Control.Monad (liftM)

    import System.Glib.FFI
    import System.Glib.UTFString
    import System.Glib.Attributes
    import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
    import Graphics.UI.Gtk.Types
    {-# LINE 137 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
    import Graphics.UI.Gtk.Signals
    {-# LINE 138 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}

    {-# LINE 140 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}

    --------------------
    -- Constructors

    -- | Creates a new 'MenuItem'.
    --
    menuItemNew :: IO MenuItem
    menuItemNew :: IO MenuItem
    menuItemNew =
      (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
    -> IO (Ptr MenuItem) -> IO MenuItem
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
    forall {a}. (ForeignPtr MenuItem -> MenuItem, FinalizerPtr a)
    mkMenuItem (IO (Ptr MenuItem) -> IO MenuItem)
    -> IO (Ptr MenuItem) -> IO MenuItem
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Widget -> Ptr MenuItem)
    -> IO (Ptr Widget) -> IO (Ptr MenuItem)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr MenuItem
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr MenuItem) (IO (Ptr Widget) -> IO (Ptr MenuItem))
    -> IO (Ptr Widget) -> IO (Ptr MenuItem)
    forall a b. (a -> b) -> a -> b
    $
      IO (Ptr Widget)
    gtk_menu_item_new
    {-# LINE 151 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}

    -- | Creates a new 'MenuItem' whose child is a 'Label'.
    --
    menuItemNewWithLabel :: GlibString string
     => string -- ^ @label@ - the text for the label
     -> IO MenuItem
    menuItemNewWithLabel :: forall string. GlibString string => string -> IO MenuItem
    menuItemNewWithLabel string
    label =
      (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
    -> IO (Ptr MenuItem) -> IO MenuItem
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
    forall {a}. (ForeignPtr MenuItem -> MenuItem, FinalizerPtr a)
    mkMenuItem (IO (Ptr MenuItem) -> IO MenuItem)
    -> IO (Ptr MenuItem) -> IO MenuItem
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Widget -> Ptr MenuItem)
    -> IO (Ptr Widget) -> IO (Ptr MenuItem)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr MenuItem
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr MenuItem) (IO (Ptr Widget) -> IO (Ptr MenuItem))
    -> IO (Ptr Widget) -> IO (Ptr MenuItem)
    forall a b. (a -> b) -> a -> b
    $
      string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    label ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \CString
    labelPtr ->
      CString -> IO (Ptr Widget)
    gtk_menu_item_new_with_label
    {-# LINE 162 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        labelPtr

    -- | Creates a new 'MenuItem' containing a label. The label will be created
    -- using 'labelNewWithMnemonic', so underscores in @label@ indicate the
    -- mnemonic for the menu item.
    --
    menuItemNewWithMnemonic :: GlibString string
     => string -- ^ @label@ - The text of the label, with an underscore in
                    -- front of the mnemonic character
     -> IO MenuItem
    menuItemNewWithMnemonic :: forall string. GlibString string => string -> IO MenuItem
    menuItemNewWithMnemonic string
    label =
      (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
    -> IO (Ptr MenuItem) -> IO MenuItem
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
    forall {a}. (ForeignPtr MenuItem -> MenuItem, FinalizerPtr a)
    mkMenuItem (IO (Ptr MenuItem) -> IO MenuItem)
    -> IO (Ptr MenuItem) -> IO MenuItem
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Widget -> Ptr MenuItem)
    -> IO (Ptr Widget) -> IO (Ptr MenuItem)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr MenuItem
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr MenuItem) (IO (Ptr Widget) -> IO (Ptr MenuItem))
    -> IO (Ptr Widget) -> IO (Ptr MenuItem)
    forall a b. (a -> b) -> a -> b
    $
      string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    label ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \CString
    labelPtr ->
      CString -> IO (Ptr Widget)
    gtk_menu_item_new_with_mnemonic
    {-# LINE 177 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        labelPtr

    --------------------
    -- Methods

    -- | Sets text on the MenuItem label

    menuItemSetLabel :: (MenuItemClass self, GlibString string) => self -> string -> IO ()
    menuItemSetLabel :: forall self string.
    (MenuItemClass self, GlibString string) =>
    self -> string -> IO ()
    menuItemSetLabel self
    self string
    label =
      string -> (CString -> IO ()) -> IO ()
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    label ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ (\(MenuItem ForeignPtr MenuItem
    arg1) CString
    arg2 -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> CString -> IO ()
    gtk_menu_item_set_label Ptr MenuItem
    argPtr1 CString
    arg2) (self -> MenuItem
    forall o. MenuItemClass o => o -> MenuItem
    toMenuItem self
    self)

    -- | Gets text on the MenuItem label
    menuItemGetLabel :: (MenuItemClass self, GlibString string) => self -> IO string
    menuItemGetLabel :: forall self string.
    (MenuItemClass self, GlibString string) =>
    self -> IO string
    menuItemGetLabel self
    self =
      (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO CString) -> IO CString
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO CString) -> IO CString)
    -> (Ptr MenuItem -> IO CString) -> IO CString
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO CString
    gtk_menu_item_get_label Ptr MenuItem
    argPtr1)
    {-# LINE 192 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)
      IO CString -> (CString -> IO string) -> IO string
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= \CString
    strPtr -> if CString
    strPtr CString -> CString -> Bool
    forall a. Eq a => a -> a -> Bool
    == CString
    forall a. Ptr a
    nullPtr
                       then string -> IO string
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return string
    ""
                       else CString -> IO string
    forall s. GlibString s => CString -> IO s
    peekUTFString CString
    strPtr

    -- | If True, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
    --
    menuItemSetUseUnderline :: (MenuItemClass self) => self -> Bool -> IO ()
    menuItemSetUseUnderline :: forall self. MenuItemClass self => self -> Bool -> IO ()
    menuItemSetUseUnderline self
    self =
      (\(MenuItem ForeignPtr MenuItem
    arg1) CInt
    arg2 -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> CInt -> IO ()
    gtk_menu_item_set_use_underline Ptr MenuItem
    argPtr1 CInt
    arg2) (self -> MenuItem
    forall o. MenuItemClass o => o -> MenuItem
    toMenuItem self
    self) (CInt -> IO ()) -> (Bool -> CInt) -> Bool -> IO ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool

    -- | Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.
    --
    menuItemGetUseUnderline :: (MenuItemClass self) => self -> IO Bool
    menuItemGetUseUnderline :: forall self. MenuItemClass self => self -> IO Bool
    menuItemGetUseUnderline self
    self =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $ (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO CInt) -> IO CInt)
    -> (Ptr MenuItem -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO CInt
    gtk_menu_item_get_use_underline Ptr MenuItem
    argPtr1)
    {-# LINE 208 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)

    -- | Sets the item's submenu, or changes it.
    --
    menuItemSetSubmenu :: (MenuItemClass self, MenuClass submenu) => self -> submenu -> IO ()
    menuItemSetSubmenu :: forall self submenu.
    (MenuItemClass self, MenuClass submenu) =>
    self -> submenu -> IO ()
    menuItemSetSubmenu self
    self submenu
    submenu =
      (\(MenuItem ForeignPtr MenuItem
    arg1) (Widget ForeignPtr Widget
    arg2) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Widget
    arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Widget
    argPtr2 ->Ptr MenuItem -> Ptr Widget -> IO ()
    gtk_menu_item_set_submenu Ptr MenuItem
    argPtr1 Ptr Widget
    argPtr2)
    {-# LINE 216 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)
        (submenu -> Widget
    forall o. WidgetClass o => o -> Widget
    toWidget submenu
    submenu)

    -- | Gets the submenu underneath this menu item, if any. See
    -- 'menuItemSetSubmenu'.
    --
    menuItemGetSubmenu :: MenuItemClass self => self
     -> IO (Maybe Widget) -- ^ returns submenu for this menu item, or @Nothing@ if
                          -- none.
    menuItemGetSubmenu :: forall self. MenuItemClass self => self -> IO (Maybe Widget)
    menuItemGetSubmenu self
    self =
      (IO (Ptr Widget) -> IO Widget)
    -> IO (Ptr Widget) -> IO (Maybe Widget)
    forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
    maybeNull ((ForeignPtr Widget -> Widget, FinalizerPtr Widget)
    -> IO (Ptr Widget) -> IO Widget
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
    forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
    mkWidget) (IO (Ptr Widget) -> IO (Maybe Widget))
    -> IO (Ptr Widget) -> IO (Maybe Widget)
    forall a b. (a -> b) -> a -> b
    $
      (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem
    -> (Ptr MenuItem -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (Ptr MenuItem -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO (Ptr Widget)
    gtk_menu_item_get_submenu Ptr MenuItem
    argPtr1)
    {-# LINE 228 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)

    -- | Removes the item's submenu.
    --
    menuItemRemoveSubmenu :: MenuItemClass self => self -> IO ()
    menuItemRemoveSubmenu :: forall self. MenuItemClass self => self -> IO ()
    menuItemRemoveSubmenu self
    self =
      (\(MenuItem ForeignPtr MenuItem
    arg1) (Widget ForeignPtr Widget
    arg2) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Widget
    arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Widget
    argPtr2 ->Ptr MenuItem -> Ptr Widget -> IO ()
    gtk_menu_item_set_submenu Ptr MenuItem
    argPtr1 Ptr Widget
    argPtr2)
    {-# LINE 235 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)
        (ForeignPtr Widget -> Widget
    Widget (ForeignPtr Widget -> Widget) -> ForeignPtr Widget -> Widget
    forall a b. (a -> b) -> a -> b
    $ IO (ForeignPtr Widget) -> ForeignPtr Widget
    forall a. IO a -> a
    unsafePerformIO (IO (ForeignPtr Widget) -> ForeignPtr Widget)
    -> IO (ForeignPtr Widget) -> ForeignPtr Widget
    forall a b. (a -> b) -> a -> b
    $ Ptr Widget -> IO (ForeignPtr Widget)
    forall a. Ptr a -> IO (ForeignPtr a)
    newForeignPtr_ Ptr Widget
    forall a. Ptr a
    nullPtr)

    -- | Select the menu item. Emits the \"select\" signal on the item.
    --
    menuItemEmitSelect :: MenuItemClass self => self -> IO ()
    menuItemEmitSelect :: forall self. MenuItemClass self => self -> IO ()
    menuItemEmitSelect self
    self =
      (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO ()
    gtk_menu_item_select Ptr MenuItem
    argPtr1)
    {-# LINE 243 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)

    -- | Deselect the menu item. Emits the \"deselect\" signal on the item.
    --
    menuItemEmitDeselect :: MenuItemClass self => self -> IO ()
    menuItemEmitDeselect :: forall self. MenuItemClass self => self -> IO ()
    menuItemEmitDeselect self
    self =
      (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO ()
    gtk_menu_item_deselect Ptr MenuItem
    argPtr1)
    {-# LINE 250 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)

    -- | Simulate a click on the menu item. Emits the \"activate\" signal on the item.
    --
    menuItemEmitActivate :: MenuItemClass self => self -> IO ()
    menuItemEmitActivate :: forall self. MenuItemClass self => self -> IO ()
    menuItemEmitActivate self
    self =
      (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO ()
    gtk_menu_item_activate Ptr MenuItem
    argPtr1)
    {-# LINE 257 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)

    -- | Sets whether the menu item appears justified at the right side of a menu
    -- bar. This was traditionally done for \"Help\" menu items, but is now
    -- considered a bad idea. (If the widget layout is reversed for a right-to-left
    -- language like Hebrew or Arabic, right-justified-menu-items appear at the
    -- left.)
    --
    menuItemSetRightJustified :: MenuItemClass self => self
     -> Bool -- ^ @rightJustified@ - if @True@ the menu item will appear at the
              -- far right if added to a menu bar.
     -> IO ()
    menuItemSetRightJustified :: forall self. MenuItemClass self => self -> Bool -> IO ()
    menuItemSetRightJustified self
    self Bool
    rightJustified =
      (\(MenuItem ForeignPtr MenuItem
    arg1) CInt
    arg2 -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> CInt -> IO ()
    gtk_menu_item_set_right_justified Ptr MenuItem
    argPtr1 CInt
    arg2)
    {-# LINE 271 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)
        (Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool Bool
    rightJustified)

    -- | Gets whether the menu item appears justified at the right side of the
    -- menu bar.
    --
    menuItemGetRightJustified :: MenuItemClass self => self -> IO Bool
    menuItemGetRightJustified :: forall self. MenuItemClass self => self -> IO Bool
    menuItemGetRightJustified self
    self =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      (\(MenuItem ForeignPtr MenuItem
    arg1) -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO CInt) -> IO CInt)
    -> (Ptr MenuItem -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> IO CInt
    gtk_menu_item_get_right_justified Ptr MenuItem
    argPtr1)
    {-# LINE 281 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)

    -- | Set the accelerator path on the menu item, through which runtime changes of
    -- the menu item's accelerator caused by the user can be identified and saved
    -- to persistent storage (see 'accelMapSave' on this). To setup a default
    -- accelerator for this menu item, call 'accelMapAddEntry' with the same accel
    -- path. See also 'accelMapAddEntry' on the specifics of accelerator paths, and
    -- 'menuSetAccelPath' for a more convenient variant of this function.
    --
    -- This function is basically a convenience wrapper that handles calling
    -- 'widgetSetAccelPath' with the appropriate accelerator group for the menu
    -- item.
    --
    -- Note that you do need to set an accelerator on the parent menu with
    -- 'menuSetAccelGroup' for this to work.
    --
    menuItemSetAccelPath :: (MenuItemClass self, GlibString string) => self
     -> Maybe string -- ^ @accelPath@ - accelerator path, corresponding to this
                     -- menu item's functionality, or @Nothing@ to unset the
                     -- current path.
     -> IO ()
    menuItemSetAccelPath :: forall self string.
    (MenuItemClass self, GlibString string) =>
    self -> Maybe string -> IO ()
    menuItemSetAccelPath self
    self Maybe string
    accelPath =
      (string -> (CString -> IO ()) -> IO ())
    -> Maybe string -> (CString -> IO ()) -> IO ()
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith string -> (CString -> IO ()) -> IO ()
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString Maybe string
    accelPath ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \CString
    accelPathPtr ->
      (\(MenuItem ForeignPtr MenuItem
    arg1) CString
    arg2 -> ForeignPtr MenuItem -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr MenuItem
    arg1 ((Ptr MenuItem -> IO ()) -> IO ())
    -> (Ptr MenuItem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr MenuItem
    argPtr1 ->Ptr MenuItem -> CString -> IO ()
    gtk_menu_item_set_accel_path Ptr MenuItem
    argPtr1 CString
    arg2)
    {-# LINE 305 "./Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs" #-}
        (toMenuItem self)
        CString
    accelPathPtr

    --------------------
    -- Attributes

    -- | \'submenu\' property. See 'menuItemGetSubmenu' and 'menuItemSetSubmenu'
    --
    menuItemSubmenu :: (MenuItemClass self, MenuClass submenu) => ReadWriteAttr self (Maybe Widget) submenu
    menuItemSubmenu :: forall self submenu.
    (MenuItemClass self, MenuClass submenu) =>
    ReadWriteAttr self (Maybe Widget) submenu
    menuItemSubmenu = (self -> IO (Maybe Widget))
    -> (self -> submenu -> IO ())
    -> ReadWriteAttr self (Maybe Widget) submenu
    forall o a b.
    (o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
    newAttr
      self -> IO (Maybe Widget)
    forall self. MenuItemClass self => self -> IO (Maybe Widget)
    menuItemGetSubmenu
      self -> submenu -> IO ()
    forall self submenu.
    (MenuItemClass self, MenuClass submenu) =>
    self -> submenu -> IO ()
    menuItemSetSubmenu

    -- | \'rightJustified\' property. See 'menuItemGetRightJustified' and
    -- 'menuItemSetRightJustified'
    --
    menuItemRightJustified :: MenuItemClass self => Attr self Bool
    menuItemRightJustified :: forall self. MenuItemClass self => Attr self Bool
    menuItemRightJustified = (self -> IO Bool)
    -> (self -> Bool -> IO ()) -> ReadWriteAttr self Bool Bool
    forall o a b.
    (o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
    newAttr
      self -> IO Bool
    forall self. MenuItemClass self => self -> IO Bool
    menuItemGetRightJustified
      self -> Bool -> IO ()
    forall self. MenuItemClass self => self -> Bool -> IO ()
    menuItemSetRightJustified

    -- | \'label\' property. See 'menuItemSetLabel' and 'menuItemGetLabel'
    --
    menuItemLabel :: (MenuItemClass self, GlibString string) => Attr self string
    menuItemLabel :: forall self string.
    (MenuItemClass self, GlibString string) =>
    Attr self string
    menuItemLabel = (self -> IO string)
    -> (self -> string -> IO ()) -> ReadWriteAttr self string string
    forall o a b.
    (o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
    newAttr
      self -> IO string
    forall self string.
    (MenuItemClass self, GlibString string) =>
    self -> IO string
    menuItemGetLabel
      self -> string -> IO ()
    forall self string.
    (MenuItemClass self, GlibString string) =>
    self -> string -> IO ()
    menuItemSetLabel

    -- | \'useUnderline\' property. See 'menuItemSetUseUnderline' and
    -- 'menuItemGetUseEUnderline'
    --
    menuItemUseUnderline :: MenuItemClass self => Attr self Bool
    menuItemUseUnderline :: forall self. MenuItemClass self => Attr self Bool
    menuItemUseUnderline = (self -> IO Bool)
    -> (self -> Bool -> IO ()) -> ReadWriteAttr self Bool Bool
    forall o a b.
    (o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
    newAttr
      self -> IO Bool
    forall self. MenuItemClass self => self -> IO Bool
    menuItemGetUseUnderline
      self -> Bool -> IO ()
    forall self. MenuItemClass self => self -> Bool -> IO ()
    menuItemSetUseUnderline

    --------------------
    -- Signals

    -- | The user has chosen the menu item.
    --
    -- * This is the only function applications normally connect to.
    -- It is not emitted if the item has a submenu.
    --
    menuItemActivated :: MenuItemClass self => Signal self (IO ())
    menuItemActivated :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemActivated = (Bool -> self -> IO () -> IO (ConnectId self))
    -> Signal self (IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> IO () -> IO (ConnectId obj)
    connect_NONE__NONE String
    "activate")

    -- | Deprecated. See 'menuItemActivated'.
    menuItemActivate :: MenuItemClass self => Signal self (IO ())
    menuItemActivate :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemActivate = Signal self (IO ())
    forall self. MenuItemClass self => Signal self (IO ())
    menuItemActivated

    -- | Emitted when the user chooses a menu item that has a submenu.
    --
    -- * This signal is not emitted if the menu item does not have a
    -- submenu.
    --
    menuItemActivatedItem :: MenuItemClass self => Signal self (IO ())
    menuItemActivatedItem :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemActivatedItem = (Bool -> self -> IO () -> IO (ConnectId self))
    -> Signal self (IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> IO () -> IO (ConnectId obj)
    connect_NONE__NONE String
    "activate-item")

    -- | Deprecated. See 'menuItemActivatedItem'.
    menuItemActivateItem :: MenuItemClass self => Signal self (IO ())
    menuItemActivateItem :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemActivateItem = Signal self (IO ())
    forall self. MenuItemClass self => Signal self (IO ())
    menuItemActivatedItem

    -- | This signal is emitted when the item is selected.
    --
    menuItemSelect :: MenuItemClass i => Signal i (IO ())
    menuItemSelect :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemSelect = (Bool -> i -> IO () -> IO (ConnectId i)) -> Signal i (IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> i -> IO () -> IO (ConnectId i)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> IO () -> IO (ConnectId obj)
    connect_NONE__NONE String
    "select")

    -- | This signal is emitted when the item is deselected.
    --
    menuItemDeselect :: MenuItemClass i => Signal i (IO ())
    menuItemDeselect :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemDeselect = (Bool -> i -> IO () -> IO (ConnectId i)) -> Signal i (IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> i -> IO () -> IO (ConnectId i)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> IO () -> IO (ConnectId obj)
    connect_NONE__NONE String
    "deselect")

    -- | This signal is emitted when the item is toggled.
    --
    menuItemToggle :: MenuItemClass i => Signal i (IO ())
    menuItemToggle :: forall self. MenuItemClass self => Signal self (IO ())
    menuItemToggle = (Bool -> i -> IO () -> IO (ConnectId i)) -> Signal i (IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> i -> IO () -> IO (ConnectId i)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> IO () -> IO (ConnectId obj)
    connect_NONE__NONE String
    "toggle")

    foreign import ccall unsafe "gtk_menu_item_new"
      gtk_menu_item_new :: (IO (Ptr Widget))

    foreign import ccall unsafe "gtk_menu_item_new_with_label"
      gtk_menu_item_new_with_label :: ((Ptr CChar) -> (IO (Ptr Widget)))

    foreign import ccall unsafe "gtk_menu_item_new_with_mnemonic"
      gtk_menu_item_new_with_mnemonic :: ((Ptr CChar) -> (IO (Ptr Widget)))

    foreign import ccall safe "gtk_menu_item_set_label"
      gtk_menu_item_set_label :: ((Ptr MenuItem) -> ((Ptr CChar) -> (IO ())))

    foreign import ccall safe "gtk_menu_item_get_label"
      gtk_menu_item_get_label :: ((Ptr MenuItem) -> (IO (Ptr CChar)))

    foreign import ccall safe "gtk_menu_item_set_use_underline"
      gtk_menu_item_set_use_underline :: ((Ptr MenuItem) -> (CInt -> (IO ())))

    foreign import ccall safe "gtk_menu_item_get_use_underline"
      gtk_menu_item_get_use_underline :: ((Ptr MenuItem) -> (IO CInt))

    foreign import ccall safe "gtk_menu_item_set_submenu"
      gtk_menu_item_set_submenu :: ((Ptr MenuItem) -> ((Ptr Widget) -> (IO ())))

    foreign import ccall unsafe "gtk_menu_item_get_submenu"
      gtk_menu_item_get_submenu :: ((Ptr MenuItem) -> (IO (Ptr Widget)))

    foreign import ccall safe "gtk_menu_item_select"
      gtk_menu_item_select :: ((Ptr MenuItem) -> (IO ()))

    foreign import ccall safe "gtk_menu_item_deselect"
      gtk_menu_item_deselect :: ((Ptr MenuItem) -> (IO ()))

    foreign import ccall safe "gtk_menu_item_activate"
      gtk_menu_item_activate :: ((Ptr MenuItem) -> (IO ()))

    foreign import ccall safe "gtk_menu_item_set_right_justified"
      gtk_menu_item_set_right_justified :: ((Ptr MenuItem) -> (CInt -> (IO ())))

    foreign import ccall unsafe "gtk_menu_item_get_right_justified"
      gtk_menu_item_get_right_justified :: ((Ptr MenuItem) -> (IO CInt))

    foreign import ccall safe "gtk_menu_item_set_accel_path"
      gtk_menu_item_set_accel_path :: ((Ptr MenuItem) -> ((Ptr CChar) -> (IO ())))