From: Duncan C. <dun...@us...> - 2004-08-01 16:08:25
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18039/gtk/misc Modified Files: Viewport.chs Tooltips.chs api.ignore Log Message: Add missing functions. Update api.ignore files with more deprecated functions. Also fix a couple typo bugs and tidy up some documentation. Index: Viewport.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Viewport.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Viewport.chs 23 May 2004 16:07:53 -0000 1.6 +++ Viewport.chs 1 Aug 2004 16:08:13 -0000 1.7 @@ -42,7 +42,8 @@ viewportSetHAdjustment, viewportSetVAdjustment, ShadowType(..), - viewportSetShadowType + viewportSetShadowType, + viewportGetShadowType ) where import Monad (liftM) @@ -84,20 +85,24 @@ viewportSetHAdjustment v adj = {#call viewport_set_hadjustment#} (toViewport v) adj --- | Set the vertical 'Adjustment' of --- the 'Viewport'. +-- | Set the vertical 'Adjustment' of the 'Viewport'. -- viewportSetVAdjustment :: ViewportClass v => v -> Adjustment -> IO () -viewportSetVAdjustment v adj = {#call viewport_set_hadjustment#} +viewportSetVAdjustment v adj = {#call viewport_set_vadjustment#} (toViewport v) adj --- | Specify if and how an outer frame should be --- drawn around the child. +-- | Specify if and how an outer frame should be drawn around the child. -- viewportSetShadowType :: ViewportClass v => v -> ShadowType -> IO () viewportSetShadowType v st = {#call viewport_set_shadow_type#} (toViewport v) ((fromIntegral.fromEnum) st) +-- | Get the current shadow type of the 'Viewport'. +-- +viewportGetShadowType :: ViewportClass v => v -> IO ShadowType +viewportGetShadowType v = liftM (toEnum.fromIntegral) $ + {#call unsafe viewport_get_shadow_type#} (toViewport v) + -- signals Index: Tooltips.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Tooltips.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Tooltips.chs 23 May 2004 16:07:53 -0000 1.6 +++ Tooltips.chs 1 Aug 2004 16:08:13 -0000 1.7 @@ -51,7 +51,8 @@ tooltipsEnable, tooltipsDisable, tooltipsSetDelay, - tooltipsSetTip + tooltipsSetTip, + tooltipsDataGet ) where import Monad (liftM) @@ -109,3 +110,20 @@ withUTFString tipText $ \txtPtr -> {#call unsafe tooltips_set_tip#} (toTooltips t) (toWidget w) txtPtr priPtr +{#pointer * TooltipsData#} + +-- | Retrieves any 'Tooltips' previously associated with the given widget. +-- +tooltipsDataGet :: WidgetClass w => w -> IO (Maybe (Tooltips, String, String)) +tooltipsDataGet w = do + tipDataPtr <- {#call unsafe tooltips_data_get#} (toWidget w) + if tipDataPtr == nullPtr + then return Nothing + else do --next line is a hack, tooltips struct member is at offset 0 + tooltips <- makeNewObject mkTooltips (return $ castPtr tipDataPtr) + tipText <- {#get TooltipsData->tip_text#} tipDataPtr + >>= peekUTFString + tipPrivate <- {#get TooltipsData->tip_private#} tipDataPtr + >>= peekUTFString + return $ Just $ (tooltips, tipText, tipPrivate) + Index: api.ignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/api.ignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- api.ignore 30 Jul 2004 16:46:54 -0000 1.1 +++ api.ignore 1 Aug 2004 16:08:13 -0000 1.2 @@ -8,3 +8,10 @@ #as of 2.4 deprecated exclude gtk_calendar_display_options + +#deprecated +always exclude gtk_drawing_area_size + +#internal +exclude gtk_tooltips_force_window +exclude gtk_tooltips_get_info_from_tip_window |