Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv1334/src/Port
Modified Files:
Menu.hs StatusBar.hs
Log Message:
Extended StatusBar API. Added support for tooltips for menu items
Index: Menu.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Menu.hs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Menu.hs 17 Aug 2003 16:45:07 -0000 1.11
--- Menu.hs 15 Nov 2003 10:31:49 -0000 1.12
***************
*** 40,43 ****
--- 40,44 ----
, getMenuItemPos
, setMenuLabel, getMenuLabel
+ , setMenuTip, getMenuTip
) where
***************
*** 201,202 ****
--- 202,215 ----
= resultCString (osGetMenuLabel hmenu)
foreign import ccall osGetMenuLabel :: MenuHandle -> IO CString
+
+ -- | Change the tooltip of a menu item (or checkable menu item).
+ setMenuTip :: MenuHandle -> String -> IO ()
+ setMenuTip hmenu tip
+ = withCString tip (osSetMenuTip hmenu)
+ foreign import ccall osSetMenuTip :: MenuHandle -> CString -> IO ()
+
+ -- | Returns the tooltip of a menu item (or checkable menu item).
+ getMenuTip :: MenuHandle -> IO String
+ getMenuTip hmenu
+ = resultCString (osGetMenuTip hmenu)
+ foreign import ccall osGetMenuTip :: MenuHandle -> IO CString
Index: StatusBar.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/StatusBar.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StatusBar.hs 14 Nov 2003 22:35:20 -0000 1.1
--- StatusBar.hs 15 Nov 2003 10:31:49 -0000 1.2
***************
*** 16,22 ****
-----------------------------------------------------------------------------------------
module Graphics.UI.Port.StatusBar
! ( setStatusBarVisible, getStatusBarVisible
) where
foreign import ccall "osSetStatusBarVisible" setStatusBarVisible :: Bool -> IO ()
foreign import ccall "osGetStatusBarVisible" getStatusBarVisible :: IO Bool
--- 16,41 ----
-----------------------------------------------------------------------------------------
module Graphics.UI.Port.StatusBar
! ( setStatusBarVisible, getStatusBarVisible
! , setStatusBarTitle, getStatusBarTitle
! , pushStatusBarContext, popStatusBarContext
) where
+ import Foreign
+ import Foreign.C
+ import Graphics.UI.Port.Types
+
foreign import ccall "osSetStatusBarVisible" setStatusBarVisible :: Bool -> IO ()
foreign import ccall "osGetStatusBarVisible" getStatusBarVisible :: IO Bool
+
+ -- | Change the title of the status bar.
+ setStatusBarTitle :: String -> IO ()
+ setStatusBarTitle title = withCString title osSetStatusBarTitle
+ foreign import ccall osSetStatusBarTitle :: CString -> IO ()
+
+ -- | Returns the title of the status bar.
+ getStatusBarTitle :: IO String
+ getStatusBarTitle = resultCString osGetStatusBarTitle
+ foreign import ccall osGetStatusBarTitle :: IO CString
+
+ foreign import ccall "osPushStatusBarContext" pushStatusBarContext :: IO ()
+ foreign import ccall "osPopStatusBarContext" popStatusBarContext :: IO ()
|