module Graphics.UI.Gtk.MenuComboToolbar.MenuToolButton (
MenuToolButton,
MenuToolButtonClass,
castToMenuToolButton, gTypeMenuToolButton,
toMenuToolButton,
menuToolButtonNew,
menuToolButtonNewFromStock,
menuToolButtonSetMenu,
menuToolButtonGetMenu,
menuToolButtonSetArrowTooltipText,
menuToolButtonSetArrowTooltipMarkup,
menuToolButtonMenu,
onShowMenu,
afterShowMenu,
) 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.Signals
import Graphics.UI.Gtk.General.StockItems
menuToolButtonNew :: (WidgetClass iconWidget, GlibString string) =>
Maybe iconWidget
-> Maybe string
-> IO MenuToolButton
menuToolButtonNew iconWidget label =
makeNewObject mkMenuToolButton $
liftM (castPtr :: Ptr ToolItem -> Ptr MenuToolButton) $
maybeWith withUTFString label $ \labelPtr ->
(\(Widget arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_menu_tool_button_new argPtr1 arg2)
(maybe (Widget nullForeignPtr) toWidget iconWidget)
labelPtr
menuToolButtonNewFromStock ::
StockId
-> IO MenuToolButton
menuToolButtonNewFromStock stockId =
makeNewObject mkMenuToolButton $
liftM (castPtr :: Ptr ToolItem -> Ptr MenuToolButton) $
withUTFString stockId $ \stockIdPtr ->
gtk_menu_tool_button_new_from_stock
stockIdPtr
menuToolButtonSetMenu :: (MenuToolButtonClass self, MenuClass menu) => self
-> Maybe menu
-> IO ()
menuToolButtonSetMenu self menu =
(\(MenuToolButton arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_menu_tool_button_set_menu argPtr1 argPtr2)
(toMenuToolButton self)
(maybe (Widget nullForeignPtr) toWidget menu)
menuToolButtonGetMenu :: MenuToolButtonClass self => self -> IO (Maybe Menu)
menuToolButtonGetMenu self =
maybeNull (makeNewObject mkMenu) $
liftM (castPtr :: Ptr Widget -> Ptr Menu) $
(\(MenuToolButton arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_menu_tool_button_get_menu argPtr1)
(toMenuToolButton self)
menuToolButtonSetArrowTooltipText :: (MenuToolButtonClass self, GlibString string) => self
-> string
-> IO ()
menuToolButtonSetArrowTooltipText self text =
withUTFString text $ \textPtr ->
(\(MenuToolButton arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_menu_tool_button_set_arrow_tooltip_text argPtr1 arg2)
(toMenuToolButton self)
textPtr
menuToolButtonSetArrowTooltipMarkup :: (MenuToolButtonClass self, GlibString markup) => self
-> markup
-> IO ()
menuToolButtonSetArrowTooltipMarkup self markup =
withUTFString markup $ \markupPtr ->
(\(MenuToolButton arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_menu_tool_button_set_arrow_tooltip_markup argPtr1 arg2)
(toMenuToolButton self)
markupPtr
menuToolButtonMenu :: (MenuToolButtonClass self, MenuClass menu) => ReadWriteAttr self (Maybe Menu) (Maybe menu)
menuToolButtonMenu = newAttr
menuToolButtonGetMenu
menuToolButtonSetMenu
onShowMenu, afterShowMenu :: MenuToolButtonClass self => self
-> IO ()
-> IO (ConnectId self)
onShowMenu = connect_NONE__NONE "show-menu" False
afterShowMenu = connect_NONE__NONE "show-menu" True
foreign import ccall safe "gtk_menu_tool_button_new"
gtk_menu_tool_button_new :: ((Ptr Widget) -> ((Ptr CChar) -> (IO (Ptr ToolItem))))
foreign import ccall safe "gtk_menu_tool_button_new_from_stock"
gtk_menu_tool_button_new_from_stock :: ((Ptr CChar) -> (IO (Ptr ToolItem)))
foreign import ccall safe "gtk_menu_tool_button_set_menu"
gtk_menu_tool_button_set_menu :: ((Ptr MenuToolButton) -> ((Ptr Widget) -> (IO ())))
foreign import ccall safe "gtk_menu_tool_button_get_menu"
gtk_menu_tool_button_get_menu :: ((Ptr MenuToolButton) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_menu_tool_button_set_arrow_tooltip_text"
gtk_menu_tool_button_set_arrow_tooltip_text :: ((Ptr MenuToolButton) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "gtk_menu_tool_button_set_arrow_tooltip_markup"
gtk_menu_tool_button_set_arrow_tooltip_markup :: ((Ptr MenuToolButton) -> ((Ptr CChar) -> (IO ())))