{-# LINE 2 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
-- -*-haskell-*-
-- GIMP Toolkit (GTK) Widget Menu
--
-- Author : Axel Simon
--
-- Created: 21 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.
--
-- TODO
--
-- The following not bound functions might be useful:
-- menuSetAccelGroup, menuSetAccelGroup, menuReposition
--
-- The function menuPopup at a specific position is difficult to bind:
-- The callback function that determines at which position the menu is
-- to be shown is keept after the call returns. Maybe we could destroy
-- this function pointer with a destory event?
--
-- |
-- Maintainer : gtk2hs-users@lists.sourceforge.net
-- Stability : provisional
-- Portability : portable (depends on GHC)
--
-- A menu widget
--
module Graphics.UI.Gtk.MenuComboToolbar.Menu (
-- * Detail
--
-- | A 'Menu' is a 'MenuShell' that implements a drop down menu consisting of
-- a list of 'MenuItem' objects which can be navigated and activated by the
-- user to perform application functions.
--
-- A 'Menu' is most commonly dropped down by activating a 'MenuItem' in a
-- 'MenuBar' or popped up by activating a 'MenuItem' in another 'Menu'.
--
-- A 'Menu' can also be popped up by activating a 'OptionMenu'. Other
-- composite widgets such as the 'Notebook' can pop up a 'Menu' as well.
--
-- Applications can display a 'Menu' as a popup menu by calling the
-- 'menuPopup' function.

-- * Class Hierarchy
-- |
-- @
-- | 'GObject'
-- | +----'Object'
-- | +----'Widget'
-- | +----'Container'
-- | +----'MenuShell'
-- | +----Menu
-- @

-- * Types
  Menu,
  MenuClass,
  castToMenu, gTypeMenu,
  toMenu,

-- * Constructors
  menuNew,

-- * Methods
  menuReorderChild,
  menuPopup,
  menuSetAccelGroup,
  menuGetAccelGroup,
  menuSetAccelPath,
  menuSetTitle,
  menuGetTitle,
  menuPopdown,
  menuReposition,
  menuGetActive,
  menuSetActive,
  menuSetTearoffState,
  menuGetTearoffState,
  menuAttachToWidget,
  menuDetach,
  menuGetAttachWidget,

  menuSetScreen,


  menuSetMonitor,
  menuAttach,


  menuGetForAttachWidget,


-- * Attributes

  menuTearoffState,

  menuAccelGroup,
  menuActive,
  menuTitle,

-- * Child Attributes
  menuChildLeftAttach,
  menuChildRightAttach,
  menuChildTopAttach,
  menuChildBottomAttach,
  ) where

import Control.Monad (liftM)
import Data.Maybe (fromMaybe)

import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 127 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
import Graphics.UI.Gtk.Abstract.ContainerChildProperties
import Graphics.UI.Gtk.Gdk.Events (MouseButton, TimeStamp)


{-# LINE 131 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}

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

-- | Creates a new 'Menu'.
--
menuNew :: IO Menu
menuNew :: IO Menu
menuNew =
  (ForeignPtr Menu -> Menu, FinalizerPtr Menu)
-> IO (Ptr Menu) -> IO Menu
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Menu -> Menu, FinalizerPtr Menu)
forall {a}. (ForeignPtr Menu -> Menu, FinalizerPtr a)
mkMenu (IO (Ptr Menu) -> IO Menu) -> IO (Ptr Menu) -> IO Menu
forall a b. (a -> b) -> a -> b
$
  (Ptr Widget -> Ptr Menu) -> IO (Ptr Widget) -> IO (Ptr Menu)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Menu
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Menu) (IO (Ptr Widget) -> IO (Ptr Menu))
-> IO (Ptr Widget) -> IO (Ptr Menu)
forall a b. (a -> b) -> a -> b
$
  IO (Ptr Widget)
gtk_menu_new
{-# LINE 142 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}

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

-- | Moves a 'MenuItem' to a new position within the 'Menu'.
--
menuReorderChild :: (MenuClass self, MenuItemClass child) => self
 -> child -- ^ @child@ - the 'MenuItem' to move.
 -> Int -- ^ @position@ - the new position to place @child@. Positions are
          -- numbered from 0 to n-1.
 -> IO ()
menuReorderChild :: forall self child.
(MenuClass self, MenuItemClass child) =>
self -> child -> Int -> IO ()
menuReorderChild self
self child
child Int
position =
  (\(Menu ForeignPtr Menu
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
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 Menu -> Ptr Widget -> CInt -> IO ()
gtk_menu_reorder_child Ptr Menu
argPtr1 Ptr Widget
argPtr2 CInt
arg3)
{-# LINE 155 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
position)

-- | Popup a context menu where a button press occurred.
--
-- * This function must be called in response to a button click. It opens
-- the given menu at a place determined by the last emitted event (hence
-- the requirement that this function is called as response to a button
-- press signal).
--
menuPopup :: MenuClass self => self -- ^ The menu to be shown.
  -> Maybe (MouseButton, TimeStamp)
  -- ^ The mouse button returned by 'Graphics.UI.Gtk.Gdk.EventM.eventButton' and
  -- the time of the event returned by 'Graphics.UI.Gtk.Gdk.eventTime'. These
  -- values are used to match the corresponding release of the button. If this
  -- context menu is shown by programmatic means, supply @Nothing@.
  -> IO ()
menuPopup :: forall self.
MenuClass self =>
self -> Maybe (MouseButton, TimeStamp) -> IO ()
menuPopup self
self (Just (MouseButton
b,TimeStamp
t)) =
  (\(Menu ForeignPtr Menu
arg1) (Widget ForeignPtr Widget
arg2) (Widget ForeignPtr Widget
arg3) FunPtr
  (Ptr Menu -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr () -> IO ())
arg4 Ptr ()
arg5 CUInt
arg6 CUInt
arg7 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
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 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg3 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr3 ->Ptr Menu
-> Ptr Widget
-> Ptr Widget
-> FunPtr
     (Ptr Menu -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr () -> IO ())
-> Ptr ()
-> CUInt
-> CUInt
-> IO ()
gtk_menu_popup Ptr Menu
argPtr1 Ptr Widget
argPtr2 Ptr Widget
argPtr3 FunPtr
  (Ptr Menu -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr () -> IO ())
arg4 Ptr ()
arg5 CUInt
arg6 CUInt
arg7)
{-# LINE 175 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (ForeignPtr Widget -> Widget
Widget ForeignPtr Widget
forall a. ForeignPtr a
nullForeignPtr)
    (ForeignPtr Widget -> Widget
Widget ForeignPtr Widget
forall a. ForeignPtr a
nullForeignPtr)
    FunPtr
  (Ptr Menu -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr () -> IO ())
forall a. FunPtr a
nullFunPtr
    Ptr ()
forall a. Ptr a
nullPtr
    ((Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (MouseButton -> Int) -> MouseButton -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MouseButton -> Int
forall a. Enum a => a -> Int
fromEnum) MouseButton
b)
    (TimeStamp -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral TimeStamp
t)
menuPopup self
self Maybe (MouseButton, TimeStamp)
Nothing = do
  CUInt
t <- IO CUInt
gtk_get_current_event_time
{-# LINE 184 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
  (\(Menu arg1) (Widget arg2) (Widget arg3) arg4 arg5 arg6 arg7 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_menu_popup argPtr1 argPtr2 argPtr3 arg4 arg5 arg6 arg7)
{-# LINE 185 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (Widget nullForeignPtr)
    (Widget nullForeignPtr)
    nullFunPtr nullPtr 0 t

-- | Set the 'AccelGroup' which holds global accelerators for the menu. This
-- accelerator group needs to also be added to all windows that this menu is
-- being used in with 'windowAddAccelGroup', in order for those windows to
-- support all the accelerators contained in this group.
--
menuSetAccelGroup :: MenuClass self => self
 -> AccelGroup -- ^ @accelGroup@ - the 'AccelGroup' to be associated with the
               -- menu.
 -> IO ()
menuSetAccelGroup :: forall self. MenuClass self => self -> AccelGroup -> IO ()
menuSetAccelGroup self
self AccelGroup
accelGroup =
  (\(Menu ForeignPtr Menu
arg1) (AccelGroup ForeignPtr AccelGroup
arg2) -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->ForeignPtr AccelGroup -> (Ptr AccelGroup -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr AccelGroup
arg2 ((Ptr AccelGroup -> IO ()) -> IO ())
-> (Ptr AccelGroup -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr AccelGroup
argPtr2 ->Ptr Menu -> Ptr AccelGroup -> IO ()
gtk_menu_set_accel_group Ptr Menu
argPtr1 Ptr AccelGroup
argPtr2)
{-# LINE 201 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    AccelGroup
accelGroup

-- | Gets the 'AccelGroup' which holds global accelerators for the menu. See
-- 'menuSetAccelGroup'.
--
menuGetAccelGroup :: MenuClass self => self
 -> IO AccelGroup -- ^ returns the 'AccelGroup' associated with the menu.
menuGetAccelGroup :: forall self. MenuClass self => self -> IO AccelGroup
menuGetAccelGroup self
self =
  (ForeignPtr AccelGroup -> AccelGroup, FinalizerPtr AccelGroup)
-> IO (Ptr AccelGroup) -> IO AccelGroup
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr AccelGroup -> AccelGroup, FinalizerPtr AccelGroup)
forall {a}. (ForeignPtr AccelGroup -> AccelGroup, FinalizerPtr a)
mkAccelGroup (IO (Ptr AccelGroup) -> IO AccelGroup)
-> IO (Ptr AccelGroup) -> IO AccelGroup
forall a b. (a -> b) -> a -> b
$
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu
-> (Ptr Menu -> IO (Ptr AccelGroup)) -> IO (Ptr AccelGroup)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO (Ptr AccelGroup)) -> IO (Ptr AccelGroup))
-> (Ptr Menu -> IO (Ptr AccelGroup)) -> IO (Ptr AccelGroup)
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO (Ptr AccelGroup)
gtk_menu_get_accel_group Ptr Menu
argPtr1)
{-# LINE 212 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)

-- | Sets an accelerator path for this menu from which accelerator paths for
-- its immediate children, its menu items, can be constructed. The main purpose
-- of this function is to spare the programmer the inconvenience of having to
-- call 'menuItemSetAccelPath' on each menu item that should support runtime
-- user changable accelerators. Instead, by just calling 'menuSetAccelPath' on
-- their parent, each menu item of this menu, that contains a label describing
-- its purpose, automatically gets an accel path assigned.
--
-- For example, a menu containing menu items \"New\" and \"Exit\", will, after
-- calling
--
-- > menu `menuSetAccelPath` "<Gnumeric-Sheet>/File"
--
-- assign its items the accel paths: @\"\<Gnumeric-Sheet\>\/File\/New\"@ and
-- @\"\<Gnumeric-Sheet\>\/File\/Exit\"@.
--
-- Assigning accel paths to menu items then enables the user to change their
-- accelerators at runtime. More details about accelerator paths and their
-- default setups can be found at 'accelMapAddEntry'.
--
menuSetAccelPath :: (MenuClass self, GlibString string) => self
 -> string -- ^ @accelPath@ - a valid accelerator path
 -> IO ()
menuSetAccelPath :: forall self string.
(MenuClass self, GlibString string) =>
self -> string -> IO ()
menuSetAccelPath self
self string
accelPath =
  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
accelPath ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
accelPathPtr ->
  (\(Menu ForeignPtr Menu
arg1) CString
arg2 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> CString -> IO ()
gtk_menu_set_accel_path Ptr Menu
argPtr1 CString
arg2)
{-# LINE 240 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    CString
accelPathPtr

-- | Sets the title string for the menu. The title is displayed when the menu
-- is shown as a tearoff menu.
--
menuSetTitle :: (MenuClass self, GlibString string) => self -> string -> IO ()
menuSetTitle :: forall self string.
(MenuClass self, GlibString string) =>
self -> string -> IO ()
menuSetTitle self
self string
title =
  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
title ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
titlePtr ->
  (\(Menu ForeignPtr Menu
arg1) CString
arg2 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> CString -> IO ()
gtk_menu_set_title Ptr Menu
argPtr1 CString
arg2)
{-# LINE 250 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    CString
titlePtr

-- | Returns the title of the menu. See 'menuSetTitle'.
--
menuGetTitle :: (MenuClass self, GlibString string) => self
 -> IO (Maybe string) -- ^ returns the title of the menu, or @Nothing@ if the
                      -- menu has no title set on it.
menuGetTitle :: forall self string.
(MenuClass self, GlibString string) =>
self -> IO (Maybe string)
menuGetTitle self
self =
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO CString) -> IO CString)
-> (Ptr Menu -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO CString
gtk_menu_get_title Ptr Menu
argPtr1)
{-# LINE 260 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
  IO CString -> (CString -> IO (Maybe string)) -> IO (Maybe 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 -> IO string) -> CString -> IO (Maybe string)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek CString -> IO string
forall s. GlibString s => CString -> IO s
peekUTFString

-- | Removes the menu from the screen.
--
menuPopdown :: MenuClass self => self -> IO ()
menuPopdown :: forall self. MenuClass self => self -> IO ()
menuPopdown self
self =
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO ()
gtk_menu_popdown Ptr Menu
argPtr1)
{-# LINE 268 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)

-- | Repositions the menu according to its position function.
--
menuReposition :: MenuClass self => self -> IO ()
menuReposition :: forall self. MenuClass self => self -> IO ()
menuReposition self
self =
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO ()
gtk_menu_reposition Ptr Menu
argPtr1)
{-# LINE 275 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)

-- | Returns the selected menu item from the menu. This is used by the
-- 'OptionMenu'.
--
menuGetActive :: MenuClass self => self
 -> IO MenuItem -- ^ returns the 'MenuItem' that was last selected in the menu.
                -- If a selection has not yet been made, the first menu item is
                -- selected.
menuGetActive :: forall self. MenuClass self => self -> IO MenuItem
menuGetActive self
self =
  (ForeignPtr MenuItem -> MenuItem, FinalizerPtr MenuItem)
-> IO (Ptr MenuItem) -> IO MenuItem
forall obj.
ObjectClass 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
$
  String -> IO (Ptr MenuItem) -> IO (Ptr MenuItem)
forall a. String -> IO (Ptr a) -> IO (Ptr a)
throwIfNull String
"menuGetActive: menu contains no menu items." (IO (Ptr MenuItem) -> IO (Ptr MenuItem))
-> IO (Ptr MenuItem) -> IO (Ptr 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 (IO (Ptr Widget) -> IO (Ptr MenuItem))
-> IO (Ptr Widget) -> IO (Ptr MenuItem)
forall a b. (a -> b) -> a -> b
$
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Menu -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO (Ptr Widget)
gtk_menu_get_active Ptr Menu
argPtr1)
{-# LINE 289 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)

-- | Selects the specified menu item within the menu. This is used by the
-- 'OptionMenu' and should not be used by anyone else.
--
menuSetActive :: MenuClass self => self
 -> Int -- ^ @index@ - the index of the menu item to select. Index values
          -- are from 0 to n-1.
 -> IO ()
menuSetActive :: forall self. MenuClass self => self -> Int -> IO ()
menuSetActive self
self Int
index =
  (\(Menu ForeignPtr Menu
arg1) CUInt
arg2 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> CUInt -> IO ()
gtk_menu_set_active Ptr Menu
argPtr1 CUInt
arg2)
{-# LINE 300 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
index)

-- | Changes the tearoff state of the menu. A menu is normally displayed as
-- drop down menu which persists as long as the menu is active. It can also be
-- displayed as a tearoff menu which persists until it is closed or reattached.
--
menuSetTearoffState :: MenuClass self => self
 -> Bool -- ^ @tornOff@ - If @True@, menu is displayed as a tearoff menu.
 -> IO ()
menuSetTearoffState :: forall self. MenuClass self => self -> Bool -> IO ()
menuSetTearoffState self
self Bool
tornOff =
  (\(Menu ForeignPtr Menu
arg1) CInt
arg2 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> CInt -> IO ()
gtk_menu_set_tearoff_state Ptr Menu
argPtr1 CInt
arg2)
{-# LINE 312 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
tornOff)

-- | Returns whether the menu is torn off. See 'menuSetTearoffState'.
--
menuGetTearoffState :: MenuClass self => self
 -> IO Bool -- ^ returns @True@ if the menu is currently torn off.
menuGetTearoffState :: forall self. MenuClass self => self -> IO Bool
menuGetTearoffState 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
$
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO CInt) -> IO CInt)
-> (Ptr Menu -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO CInt
gtk_menu_get_tearoff_state Ptr Menu
argPtr1)
{-# LINE 322 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)

-- | Attach this menu to another widget.
--
menuAttachToWidget :: (MenuClass self, WidgetClass attachWidget) => self -> attachWidget -> IO ()
menuAttachToWidget :: forall self attachWidget.
(MenuClass self, WidgetClass attachWidget) =>
self -> attachWidget -> IO ()
menuAttachToWidget self
self attachWidget
attachWidget =
  (\(Menu ForeignPtr Menu
arg1) (Widget ForeignPtr Widget
arg2) FunPtr (Ptr Widget -> Ptr Menu -> IO ())
arg3 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
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 Menu
-> Ptr Widget -> FunPtr (Ptr Widget -> Ptr Menu -> IO ()) -> IO ()
gtk_menu_attach_to_widget Ptr Menu
argPtr1 Ptr Widget
argPtr2 FunPtr (Ptr Widget -> Ptr Menu -> IO ())
arg3)
{-# LINE 329 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (attachWidget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget attachWidget
attachWidget)
    FunPtr (Ptr Widget -> Ptr Menu -> IO ())
forall a. FunPtr a
nullFunPtr

-- | Detach this menu from the widget it is attached to.
--
menuDetach :: MenuClass self => self -> IO ()
menuDetach :: forall self. MenuClass self => self -> IO ()
menuDetach self
self =
  (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO ()
gtk_menu_detach Ptr Menu
argPtr1)
{-# LINE 338 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)

-- | Get the widget this menu is attached to. Returns Nothing if this is a
-- tearoff (context) menu.
--
menuGetAttachWidget :: MenuClass self => self -> IO (Maybe Widget)
menuGetAttachWidget :: forall self. MenuClass self => self -> IO (Maybe Widget)
menuGetAttachWidget self
self = do
  Ptr Widget
wPtr <- (\(Menu ForeignPtr Menu
arg1) -> ForeignPtr Menu -> (Ptr Menu -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Menu -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> IO (Ptr Widget)
gtk_menu_get_attach_widget Ptr Menu
argPtr1) (self -> Menu
forall o. MenuClass o => o -> Menu
toMenu self
self)
  if Ptr Widget
wPtrPtr Widget -> Ptr Widget -> Bool
forall a. Eq a => a -> a -> Bool
==Ptr Widget
forall a. Ptr a
nullPtr then Maybe Widget -> IO (Maybe Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Widget
forall a. Maybe a
Nothing else (Widget -> Maybe Widget) -> IO Widget -> IO (Maybe Widget)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Widget -> Maybe Widget
forall a. a -> Maybe a
Just (IO Widget -> IO (Maybe Widget)) -> IO Widget -> IO (Maybe Widget)
forall a b. (a -> b) -> a -> b
$
    (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
ObjectClass 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 (Ptr Widget -> IO (Ptr Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Widget
wPtr)


-- | Sets the 'Screen' on which the menu will be displayed.
--
-- * Available since Gtk+ version 2.2
--
menuSetScreen :: MenuClass self => self
 -> Maybe Screen -- ^ @screen@ - a 'Screen', or @Nothing@ if the screen should
                 -- be determined by the widget the menu is attached to.
 -> IO ()
menuSetScreen :: forall self. MenuClass self => self -> Maybe Screen -> IO ()
menuSetScreen self
self Maybe Screen
screen =
  (\(Menu ForeignPtr Menu
arg1) (Screen ForeignPtr Screen
arg2) -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->ForeignPtr Screen -> (Ptr Screen -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Screen
arg2 ((Ptr Screen -> IO ()) -> IO ()) -> (Ptr Screen -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Screen
argPtr2 ->Ptr Menu -> Ptr Screen -> IO ()
gtk_menu_set_screen Ptr Menu
argPtr1 Ptr Screen
argPtr2)
{-# LINE 360 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (Screen -> Maybe Screen -> Screen
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr Screen -> Screen
Screen ForeignPtr Screen
forall a. ForeignPtr a
nullForeignPtr) Maybe Screen
screen)



-- | Informs Gtk+ on which monitor a menu should be popped up. See
-- 'screenGetMonitorGeometry'.
--
-- * Available since Gtk+ version 2.4
--
menuSetMonitor :: MenuClass self => self
 -> Int -- ^ @monitorNum@ - the number of the monitor on which the menu
          -- should be popped up
 -> IO ()
menuSetMonitor :: forall self. MenuClass self => self -> Int -> IO ()
menuSetMonitor self
self Int
monitorNum =
  (\(Menu ForeignPtr Menu
arg1) CInt
arg2 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
argPtr1 ->Ptr Menu -> CInt -> IO ()
gtk_menu_set_monitor Ptr Menu
argPtr1 CInt
arg2)
{-# LINE 376 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
monitorNum)

-- | Adds a new 'MenuItem' to a (table) menu. The number of \'cells\' that an
-- item will occupy is specified by @leftAttach@, @rightAttach@, @topAttach@
-- and @bottomAttach@. These each represent the leftmost, rightmost, uppermost
-- and lower column and row numbers of the table. (Columns and rows are indexed
-- from zero).
--
-- Note that this function is not related to 'menuDetach'.
--
-- * Available since Gtk+ version 2.4
--
menuAttach :: (MenuClass self, MenuItemClass child) => self
 -> child -- ^ @child@ - a 'MenuItem'.
 -> Int -- ^ @leftAttach@ - The column number to attach the left side of the
          -- item to.
 -> Int -- ^ @rightAttach@ - The column number to attach the right side of
          -- the item to.
 -> Int -- ^ @topAttach@ - The row number to attach the top of the item to.
 -> Int -- ^ @bottomAttach@ - The row number to attach the bottom of the
          -- item to.
 -> IO ()
menuAttach :: forall self child.
(MenuClass self, MenuItemClass child) =>
self -> child -> Int -> Int -> Int -> Int -> IO ()
menuAttach self
self child
child Int
leftAttach Int
rightAttach Int
topAttach Int
bottomAttach =
  (\(Menu ForeignPtr Menu
arg1) (Widget ForeignPtr Widget
arg2) CUInt
arg3 CUInt
arg4 CUInt
arg5 CUInt
arg6 -> ForeignPtr Menu -> (Ptr Menu -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Menu
arg1 ((Ptr Menu -> IO ()) -> IO ()) -> (Ptr Menu -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Menu
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 Menu -> Ptr Widget -> CUInt -> CUInt -> CUInt -> CUInt -> IO ()
gtk_menu_attach Ptr Menu
argPtr1 Ptr Widget
argPtr2 CUInt
arg3 CUInt
arg4 CUInt
arg5 CUInt
arg6)
{-# LINE 401 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toMenu self)
    (child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
    (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
leftAttach)
    (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
rightAttach)
    (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
topAttach)
    (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
bottomAttach)



-- | Returns a list of the menus which are attached to this widget.
--
-- * Available since Gtk+ version 2.6
--
menuGetForAttachWidget :: WidgetClass widget =>
    widget -- ^ @widget@ - a 'Widget'
 -> IO [Menu]
menuGetForAttachWidget :: forall widget. WidgetClass widget => widget -> IO [Menu]
menuGetForAttachWidget widget
widget =
  (\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget -> (Ptr Widget -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr Widget -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr ())
gtk_menu_get_for_attach_widget Ptr Widget
argPtr1)
{-# LINE 419 "./Graphics/UI/Gtk/MenuComboToolbar/Menu.chs" #-}
    (toWidget widget)
  IO (Ptr ()) -> (Ptr () -> IO [Ptr Menu]) -> IO [Ptr Menu]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr () -> IO [Ptr Menu]
forall a. Ptr () -> IO [Ptr a]
fromGList
  IO [Ptr Menu] -> ([Ptr Menu] -> IO [Menu]) -> IO [Menu]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (Ptr Menu -> IO Menu) -> [Ptr Menu] -> IO [Menu]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (\Ptr Menu
elemPtr -> (ForeignPtr Menu -> Menu, FinalizerPtr Menu)
-> IO (Ptr Menu) -> IO Menu
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Menu -> Menu, FinalizerPtr Menu)
forall {a}. (ForeignPtr Menu -> Menu, FinalizerPtr a)
mkMenu (Ptr Menu -> IO (Ptr Menu)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Menu
elemPtr))


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

-- | A title that may be displayed by the window manager when this menu is
-- torn-off.
--
-- Default value: \"\"
--
menuTitle :: (MenuClass self, GlibString string) => Attr self string
menuTitle :: forall self string.
(MenuClass self, GlibString string) =>
Attr self string
menuTitle = String -> Attr self string
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj string
newAttrFromStringProperty String
"tearoff-title"


-- | A boolean that indicates whether the menu is torn-off.
--
-- Default value: @False@
--
menuTearoffState :: MenuClass self => Attr self Bool
menuTearoffState :: forall self. MenuClass self => Attr self Bool
menuTearoffState = (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. MenuClass self => self -> IO Bool
menuGetTearoffState
  self -> Bool -> IO ()
forall self. MenuClass self => self -> Bool -> IO ()
menuSetTearoffState


-- | \'accelGroup\' property. See 'menuGetAccelGroup' and 'menuSetAccelGroup'
--
menuAccelGroup :: MenuClass self => Attr self AccelGroup
menuAccelGroup :: forall self. MenuClass self => Attr self AccelGroup
menuAccelGroup = (self -> IO AccelGroup)
-> (self -> AccelGroup -> IO ())
-> ReadWriteAttr self AccelGroup AccelGroup
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
  self -> IO AccelGroup
forall self. MenuClass self => self -> IO AccelGroup
menuGetAccelGroup
  self -> AccelGroup -> IO ()
forall self. MenuClass self => self -> AccelGroup -> IO ()
menuSetAccelGroup

-- | \'active\' property. See 'menuGetActive' and 'menuSetActive'
--
menuActive :: MenuClass self => ReadWriteAttr self MenuItem Int
menuActive :: forall self. MenuClass self => ReadWriteAttr self MenuItem Int
menuActive = (self -> IO MenuItem)
-> (self -> Int -> IO ()) -> ReadWriteAttr self MenuItem Int
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
  self -> IO MenuItem
forall self. MenuClass self => self -> IO MenuItem
menuGetActive
  self -> Int -> IO ()
forall self. MenuClass self => self -> Int -> IO ()
menuSetActive

--------------------
-- Child Attributes

-- | The column number to attach the left side of the child to.
--
-- Allowed values: >= -1
--
-- Default value: -1
--
menuChildLeftAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int
menuChildLeftAttach :: forall self child.
(MenuClass self, WidgetClass child) =>
child -> Attr self Int
menuChildLeftAttach = String -> child -> Attr self Int
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Int
newAttrFromContainerChildIntProperty String
"left-attach"

-- | The column number to attach the right side of the child to.
--
-- Allowed values: >= -1
--
-- Default value: -1
--
menuChildRightAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int
menuChildRightAttach :: forall self child.
(MenuClass self, WidgetClass child) =>
child -> Attr self Int
menuChildRightAttach = String -> child -> Attr self Int
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Int
newAttrFromContainerChildIntProperty String
"right-attach"

-- | The row number to attach the top of the child to.
--
-- Allowed values: >= -1
--
-- Default value: -1
--
menuChildTopAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int
menuChildTopAttach :: forall self child.
(MenuClass self, WidgetClass child) =>
child -> Attr self Int
menuChildTopAttach = String -> child -> Attr self Int
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Int
newAttrFromContainerChildIntProperty String
"top-attach"

-- | The row number to attach the bottom of the child to.
--
-- Allowed values: >= -1
--
-- Default value: -1
--
menuChildBottomAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int
menuChildBottomAttach :: forall self child.
(MenuClass self, WidgetClass child) =>
child -> Attr self Int
menuChildBottomAttach = String -> child -> Attr self Int
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Int
newAttrFromContainerChildIntProperty String
"bottom-attach"

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

foreign import ccall safe "gtk_menu_reorder_child"
  gtk_menu_reorder_child :: ((Ptr Menu) -> ((Ptr Widget) -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_menu_popup"
  gtk_menu_popup :: ((Ptr Menu) -> ((Ptr Widget) -> ((Ptr Widget) -> ((FunPtr ((Ptr Menu) -> ((Ptr CInt) -> ((Ptr CInt) -> ((Ptr CInt) -> ((Ptr ()) -> (IO ()))))))) -> ((Ptr ()) -> (CUInt -> (CUInt -> (IO ()))))))))

foreign import ccall unsafe "gtk_get_current_event_time"
  gtk_get_current_event_time :: (IO CUInt)

foreign import ccall safe "gtk_menu_set_accel_group"
  gtk_menu_set_accel_group :: ((Ptr Menu) -> ((Ptr AccelGroup) -> (IO ())))

foreign import ccall unsafe "gtk_menu_get_accel_group"
  gtk_menu_get_accel_group :: ((Ptr Menu) -> (IO (Ptr AccelGroup)))

foreign import ccall safe "gtk_menu_set_accel_path"
  gtk_menu_set_accel_path :: ((Ptr Menu) -> ((Ptr CChar) -> (IO ())))

foreign import ccall unsafe "gtk_menu_set_title"
  gtk_menu_set_title :: ((Ptr Menu) -> ((Ptr CChar) -> (IO ())))

foreign import ccall unsafe "gtk_menu_get_title"
  gtk_menu_get_title :: ((Ptr Menu) -> (IO (Ptr CChar)))

foreign import ccall safe "gtk_menu_popdown"
  gtk_menu_popdown :: ((Ptr Menu) -> (IO ()))

foreign import ccall safe "gtk_menu_reposition"
  gtk_menu_reposition :: ((Ptr Menu) -> (IO ()))

foreign import ccall safe "gtk_menu_get_active"
  gtk_menu_get_active :: ((Ptr Menu) -> (IO (Ptr Widget)))

foreign import ccall safe "gtk_menu_set_active"
  gtk_menu_set_active :: ((Ptr Menu) -> (CUInt -> (IO ())))

foreign import ccall safe "gtk_menu_set_tearoff_state"
  gtk_menu_set_tearoff_state :: ((Ptr Menu) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_menu_get_tearoff_state"
  gtk_menu_get_tearoff_state :: ((Ptr Menu) -> (IO CInt))

foreign import ccall safe "gtk_menu_attach_to_widget"
  gtk_menu_attach_to_widget :: ((Ptr Menu) -> ((Ptr Widget) -> ((FunPtr ((Ptr Widget) -> ((Ptr Menu) -> (IO ())))) -> (IO ()))))

foreign import ccall safe "gtk_menu_detach"
  gtk_menu_detach :: ((Ptr Menu) -> (IO ()))

foreign import ccall unsafe "gtk_menu_get_attach_widget"
  gtk_menu_get_attach_widget :: ((Ptr Menu) -> (IO (Ptr Widget)))

foreign import ccall safe "gtk_menu_set_screen"
  gtk_menu_set_screen :: ((Ptr Menu) -> ((Ptr Screen) -> (IO ())))

foreign import ccall safe "gtk_menu_set_monitor"
  gtk_menu_set_monitor :: ((Ptr Menu) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_menu_attach"
  gtk_menu_attach :: ((Ptr Menu) -> ((Ptr Widget) -> (CUInt -> (CUInt -> (CUInt -> (CUInt -> (IO ())))))))

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