Update of /cvsroot/gtk2hs/gtk2hs/gtk/ornaments
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10993/gtk/ornaments
Modified Files:
Frame.chs
Log Message:
added missing functions, or functions that were new in gtk-2.4
removed a function that is no longer needed from general/Structs.hsc
Index: Frame.chs
===================================================================
RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/ornaments/Frame.chs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Frame.chs 23 May 2004 16:10:57 -0000 1.4
+++ Frame.chs 30 Jul 2004 16:38:53 -0000 1.5
@@ -31,11 +31,14 @@
castToFrame,
frameNew,
frameSetLabel,
+ frameGetLabel,
frameSetLabelWidget,
+ frameGetLabelWidget,
frameSetLabelAlign,
+ frameGetLabelAlign,
ShadowType(..),
frameSetShadowType,
- frameGetLabel
+ frameGetShadowType
) where
import Monad (liftM)
@@ -70,6 +73,15 @@
frameSetLabelWidget f w =
{#call frame_set_label_widget#} (toFrame f) (toWidget w)
+-- | Get the label widget for the frame.
+--
+frameGetLabelWidget :: FrameClass f => f -> IO (Maybe Widget)
+frameGetLabelWidget f = do
+ widgetPtr <- {#call frame_get_label_widget#} (toFrame f)
+ if widgetPtr == nullPtr
+ then return Nothing
+ else liftM Just $ makeNewObject mkWidget (return widgetPtr)
+
-- | Specify where the label should be placed.
--
-- * A value of 0.0 means left justified (the default), a value of 1.0 means
@@ -79,12 +91,27 @@
frameSetLabelAlign f align =
{#call frame_set_label_align#} (toFrame f) (realToFrac align) 0.0
+-- | Get the label's horazontal alignment.
+--
+frameGetLabelAlign :: FrameClass f => f -> IO Float
+frameGetLabelAlign f =
+ alloca $ \alignPtr -> do
+ {#call unsafe frame_get_label_align#} (toFrame f) alignPtr nullPtr
+ align <- peek alignPtr
+ return (realToFrac align)
+
-- | Set the shadow type of the frame.
--
frameSetShadowType :: FrameClass f => f -> ShadowType -> IO ()
frameSetShadowType f shadow =
{#call frame_set_shadow_type#} (toFrame f) ((fromIntegral.fromEnum) shadow)
+-- | Set the shadow type of the frame.
+--
+frameGetShadowType :: FrameClass f => f -> IO ShadowType
+frameGetShadowType f = liftM (toEnum.fromIntegral) $
+ {#call unsafe frame_get_shadow_type#} (toFrame f)
+
-- | Retrieve the label of the frame.
--
-- * An exception is thrown if a non-Label widget was set.
|