module Graphics.UI.Gtk.MenuComboToolbar.ImageMenuItem (
ImageMenuItem,
ImageMenuItemClass,
castToImageMenuItem, gTypeImageMenuItem,
toImageMenuItem,
imageMenuItemNew,
imageMenuItemNewFromStock,
imageMenuItemNewWithLabel,
imageMenuItemNewWithMnemonic,
imageMenuItemSetImage,
imageMenuItemGetImage,
imageMenuItemImage,
) 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
import Graphics.UI.Gtk.General.StockItems
imageMenuItemNew :: IO ImageMenuItem
imageMenuItemNew =
makeNewObject mkImageMenuItem $
liftM (castPtr :: Ptr Widget -> Ptr ImageMenuItem) $
gtk_image_menu_item_new
imageMenuItemNewFromStock ::
StockId
-> IO ImageMenuItem
imageMenuItemNewFromStock stockId =
makeNewObject mkImageMenuItem $
liftM (castPtr :: Ptr Widget -> Ptr ImageMenuItem) $
withUTFString stockId $ \stockIdPtr ->
(\arg1 (AccelGroup arg2) -> withForeignPtr arg2 $ \argPtr2 ->gtk_image_menu_item_new_from_stock arg1 argPtr2)
stockIdPtr
(AccelGroup nullForeignPtr)
imageMenuItemNewWithLabel :: GlibString string
=> string
-> IO ImageMenuItem
imageMenuItemNewWithLabel label =
makeNewObject mkImageMenuItem $
liftM (castPtr :: Ptr Widget -> Ptr ImageMenuItem) $
withUTFString label $ \labelPtr ->
gtk_image_menu_item_new_with_label
labelPtr
imageMenuItemNewWithMnemonic :: GlibString string
=> string
-> IO ImageMenuItem
imageMenuItemNewWithMnemonic label =
makeNewObject mkImageMenuItem $
liftM (castPtr :: Ptr Widget -> Ptr ImageMenuItem) $
withUTFString label $ \labelPtr ->
gtk_image_menu_item_new_with_mnemonic
labelPtr
imageMenuItemSetImage :: (ImageMenuItemClass self, WidgetClass image) => self
-> image
-> IO ()
imageMenuItemSetImage self image =
(\(ImageMenuItem arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_image_menu_item_set_image argPtr1 argPtr2)
(toImageMenuItem self)
(toWidget image)
imageMenuItemGetImage :: ImageMenuItemClass self => self
-> IO (Maybe Widget)
imageMenuItemGetImage self =
maybeNull (makeNewObject mkWidget) $
(\(ImageMenuItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_image_menu_item_get_image argPtr1)
(toImageMenuItem self)
imageMenuItemImage :: (ImageMenuItemClass self, WidgetClass image) => ReadWriteAttr self (Maybe Widget) image
imageMenuItemImage = newAttr
imageMenuItemGetImage
imageMenuItemSetImage
foreign import ccall unsafe "gtk_image_menu_item_new"
gtk_image_menu_item_new :: (IO (Ptr Widget))
foreign import ccall unsafe "gtk_image_menu_item_new_from_stock"
gtk_image_menu_item_new_from_stock :: ((Ptr CChar) -> ((Ptr AccelGroup) -> (IO (Ptr Widget))))
foreign import ccall unsafe "gtk_image_menu_item_new_with_label"
gtk_image_menu_item_new_with_label :: ((Ptr CChar) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_image_menu_item_new_with_mnemonic"
gtk_image_menu_item_new_with_mnemonic :: ((Ptr CChar) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_image_menu_item_set_image"
gtk_image_menu_item_set_image :: ((Ptr ImageMenuItem) -> ((Ptr Widget) -> (IO ())))
foreign import ccall unsafe "gtk_image_menu_item_get_image"
gtk_image_menu_item_get_image :: ((Ptr ImageMenuItem) -> (IO (Ptr Widget)))