{-# LINE 2 "./Graphics/UI/Gtk/Layout/StackSwitcher.chs" #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) Widgets StackSwitcher -- -- Author : Moritz Schulte -- -- Created: 27 April 2016 -- -- Copyright (C) 2016 Moritz Schulte -- -- 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. -- -- | -- Maintainer : gtk2hs-users@lists.sourceforge.net -- Stability : provisional -- Portability : portable (depends on GHC) -- -- A widget which controls the alignment and size of its child -- module Graphics.UI.Gtk.Layout.StackSwitcher ( -- * Detail -- -- [...] -- -- * Class Hierarchy -- | -- @ -- | 'GObject' -- | +----'Object' -- | +----'Widget' -- | +----'Container' -- | +----'Box' -- | +----'StackSwitcher' -- @ -- * Types StackSwitcher , castToStackSwitcher , gTypeStackSwitcher , toStackSwitcher -- * Constructors , stackSwitcherNew -- * Methods , stackSwitcherSetStack , stackSwitcherGetStack -- * Attributes , stackSwitcherIconSize , stackSwitcherStack ) where import Control.Monad (liftM) import System.Glib.FFI import System.Glib.Attributes import System.Glib.Properties import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import Graphics.UI.Gtk.Types {-# LINE 73 "./Graphics/UI/Gtk/Layout/StackSwitcher.chs" #-} {-# LINE 75 "./Graphics/UI/Gtk/Layout/StackSwitcher.chs" #-} -------------------- -- Constructors -- | Creates a new 'StackSwitcher'. -- stackSwitcherNew :: IO StackSwitcher stackSwitcherNew = makeNewObject mkStackSwitcher $ liftM (castPtr :: Ptr Widget -> Ptr StackSwitcher) $ gtk_stack_switcher_new {-# LINE 86 "./Graphics/UI/Gtk/Layout/StackSwitcher.chs" #-} -------------------- -- Methods -- | Sets the stack to control. stackSwitcherSetStack :: (StackSwitcherClass self, StackClass stack) => self -> stack -> IO () stackSwitcherSetStack self stack = (\(StackSwitcher arg1) (Stack arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_stack_switcher_set_stack argPtr1 argPtr2) {-# LINE 96 "./Graphics/UI/Gtk/Layout/StackSwitcher.chs" #-} (toStackSwitcher self) (toStack stack) -- | Retrieves the stack. stackSwitcherGetStack :: StackSwitcherClass self => self -> IO (Maybe Stack) stackSwitcherGetStack self = maybeNull (makeNewObject mkStack) $ (\(StackSwitcher arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_stack_switcher_get_stack argPtr1) {-# LINE 105 "./Graphics/UI/Gtk/Layout/StackSwitcher.chs" #-} (toStackSwitcher self) -------------------- -- Attributes -- | Use the "icon-size" property to change the size of the image -- displayed when a GtkStackSwitcher is displaying icons. -- -- Default value: @1@ -- stackSwitcherIconSize :: StackSwitcherClass self => Attr self Int stackSwitcherIconSize = newAttrFromIntProperty "icon-size" -- | The 'Stack' controlled by this 'StackSwitcher'. -- stackSwitcherStack :: (StackSwitcherClass self, StackClass stack) => ReadWriteAttr self (Maybe Stack) (Maybe stack) stackSwitcherStack = newAttrFromMaybeObjectProperty "stack" gTypeContainer foreign import ccall unsafe "gtk_stack_switcher_new" gtk_stack_switcher_new :: (IO (Ptr Widget)) foreign import ccall safe "gtk_stack_switcher_set_stack" gtk_stack_switcher_set_stack :: ((Ptr StackSwitcher) -> ((Ptr Stack) -> (IO ()))) foreign import ccall safe "gtk_stack_switcher_get_stack" gtk_stack_switcher_get_stack :: ((Ptr StackSwitcher) -> (IO (Ptr Stack)))