From: Duncan C. <dun...@us...> - 2005-04-02 19:38:38
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28534/gtk/Graphics/UI/Gtk/Display Modified Files: AccelLabel.chs Image.chs.pp Label.chs ProgressBar.chs Statusbar.chs Log Message: Various minor changes merged from the generated module. Index: Image.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Image.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Image.chs.pp 15 Mar 2005 19:59:09 -0000 1.5 +++ Image.chs.pp 2 Apr 2005 19:38:29 -0000 1.6 @@ -141,7 +141,8 @@ -- imageNewFromFile :: FilePath -> IO Image imageNewFromFile filename = - makeNewObject mkImage $ liftM castPtr $ + makeNewObject mkImage $ + liftM (castPtr :: Ptr Widget -> Ptr Image) $ withUTFString filename $ \filenamePtr -> #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) {# call unsafe gtk_image_new_from_file_utf8 #} @@ -158,7 +159,8 @@ -- imageNewFromPixbuf :: Pixbuf -> IO Image imageNewFromPixbuf pixbuf = - makeNewObject mkImage $ liftM castPtr $ + makeNewObject mkImage $ + liftM (castPtr :: Ptr Widget -> Ptr Image) $ {# call unsafe image_new_from_pixbuf #} pixbuf @@ -170,7 +172,8 @@ -> IconSize -- ^ @size@ - a stock icon size -> IO Image imageNewFromStock stockId size = - makeNewObject mkImage $ liftM castPtr $ + makeNewObject mkImage $ + liftM (castPtr :: Ptr Widget -> Ptr Image) $ withUTFString stockId $ \stockIdPtr -> {# call unsafe image_new_from_stock #} stockIdPtr Index: ProgressBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/ProgressBar.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ProgressBar.chs 15 Mar 2005 19:59:10 -0000 1.6 +++ ProgressBar.chs 2 Apr 2005 19:38:29 -0000 1.7 @@ -107,7 +107,8 @@ -- progressBarNew :: IO ProgressBar progressBarNew = - makeNewObject mkProgressBar $ liftM castPtr $ + makeNewObject mkProgressBar $ + liftM (castPtr :: Ptr Widget -> Ptr ProgressBar) $ {# call unsafe progress_bar_new #} -------------------- @@ -186,9 +187,7 @@ -- | Causes the progress bar to switch to a different orientation -- (left-to-right, right-to-left, top-to-bottom, or bottom-to-top). -- -progressBarSetOrientation :: ProgressBarClass self => self - -> ProgressBarOrientation - -> IO () +progressBarSetOrientation :: ProgressBarClass self => self -> ProgressBarOrientation -> IO () progressBarSetOrientation self orientation = {# call progress_bar_set_orientation #} (toProgressBar self) @@ -196,8 +195,7 @@ -- | Retrieves the current progress bar orientation. -- -progressBarGetOrientation :: ProgressBarClass self => self - -> IO ProgressBarOrientation +progressBarGetOrientation :: ProgressBarClass self => self -> IO ProgressBarOrientation progressBarGetOrientation self = liftM (toEnum . fromIntegral) $ {# call unsafe progress_bar_get_orientation #} @@ -210,7 +208,7 @@ -- -- Default value: 'ProgressLeftToRight' -- -progressBarOrientation :: Attr ProgressBar ProgressBarOrientation +progressBarOrientation :: ProgressBarClass self => Attr self ProgressBarOrientation progressBarOrientation = Attr progressBarGetOrientation progressBarSetOrientation @@ -221,7 +219,7 @@ -- -- Default value: 0 -- -progressBarFraction :: Attr ProgressBar Double +progressBarFraction :: ProgressBarClass self => Attr self Double progressBarFraction = Attr progressBarGetFraction progressBarSetFraction @@ -232,7 +230,7 @@ -- -- Default value: 0.1 -- -progressBarPulseStep :: Attr ProgressBar Double +progressBarPulseStep :: ProgressBarClass self => Attr self Double progressBarPulseStep = Attr progressBarGetPulseStep progressBarSetPulseStep Index: Statusbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Statusbar.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Statusbar.chs 15 Mar 2005 19:59:10 -0000 1.4 +++ Statusbar.chs 2 Apr 2005 19:38:29 -0000 1.5 @@ -83,6 +83,9 @@ statusbarSetHasResizeGrip, statusbarGetHasResizeGrip, +-- * Properties + statusbarHasResizeGrip, + -- * Signals onTextPopped, afterTextPopped, @@ -94,6 +97,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -107,7 +111,8 @@ -- statusbarNew :: IO Statusbar statusbarNew = - makeNewObject mkStatusbar $ liftM castPtr $ + makeNewObject mkStatusbar $ + liftM (castPtr :: Ptr Widget -> Ptr Statusbar) $ {# call unsafe statusbar_new #} -------------------- @@ -189,6 +194,18 @@ (toStatusbar self) -------------------- +-- Properties + +-- | Whether the statusbar has a grip for resizing the toplevel window. +-- +-- Default value: @True@ +-- +statusbarHasResizeGrip :: StatusbarClass self => Attr self Bool +statusbarHasResizeGrip = Attr + statusbarGetHasResizeGrip + statusbarSetHasResizeGrip + +-------------------- -- Signals -- | Called if a message is removed. @@ -196,8 +213,8 @@ onTextPopped, afterTextPopped :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self) -onTextPopped = connect_WORD_STRING__NONE "text-popped" False -afterTextPopped = connect_WORD_STRING__NONE "text-popped" True +onTextPopped self user = connect_WORD_STRING__NONE "text-popped" False self (user . fromIntegral) +afterTextPopped self user = connect_WORD_STRING__NONE "text-popped" True self (user . fromIntegral) -- | Called if a message is pushed on top of the -- stack. @@ -205,5 +222,5 @@ onTextPushed, afterTextPushed :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self) -onTextPushed = connect_WORD_STRING__NONE "text-pushed" False -afterTextPushed = connect_WORD_STRING__NONE "text-pushed" True +onTextPushed self user = connect_WORD_STRING__NONE "text-pushed" False self (user . fromIntegral) +afterTextPushed self user = connect_WORD_STRING__NONE "text-pushed" True self (user . fromIntegral) Index: AccelLabel.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/AccelLabel.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- AccelLabel.chs 15 Mar 2005 19:59:09 -0000 1.4 +++ AccelLabel.chs 2 Apr 2005 19:38:29 -0000 1.5 @@ -92,9 +92,12 @@ -- | Creates a new 'AccelLabel'. -- -accelLabelNew :: String -> IO AccelLabel +accelLabelNew :: + String -- ^ @string@ - the label string. + -> IO AccelLabel accelLabelNew string = - makeNewObject mkAccelLabel $ liftM castPtr $ + makeNewObject mkAccelLabel $ + liftM (castPtr :: Ptr Widget -> Ptr AccelLabel) $ withUTFString string $ \stringPtr -> {# call unsafe accel_label_new #} stringPtr Index: Label.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Label.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Label.chs 15 Mar 2005 19:59:09 -0000 1.6 +++ Label.chs 2 Apr 2005 19:38:29 -0000 1.7 @@ -180,14 +180,15 @@ -- labelNew :: Maybe String -> IO Label labelNew str = - makeNewObject mkLabel $ liftM castPtr $ + makeNewObject mkLabel $ + liftM (castPtr :: Ptr Widget -> Ptr Label) $ maybeWith withUTFString str $ \strPtr -> {# call label_new #} strPtr --- | Creates a new 'Label', containing the given text. +-- | Creates a new 'Label', containing the text in @str@. -- --- If characters in @text@ are preceded by an underscore, they are +-- If characters in @str@ are preceded by an underscore, they are -- underlined. If you need a literal underscore character in a label, use -- \'__\' (two underscores). The first underlined character represents a -- keyboard accelerator called a mnemonic. The mnemonic key can be used to @@ -200,11 +201,12 @@ -- automatically become the mnemonic widget and be activated by the mnemonic. -- labelNewWithMnemonic :: - String -- ^ @text@ - The text of the label, with an underscore in front + String -- ^ @str@ - The text of the label, with an underscore in front -- of the mnemonic character -> IO Label labelNewWithMnemonic str = - makeNewObject mkLabel $ liftM castPtr $ + makeNewObject mkLabel $ + liftM (castPtr :: Ptr Widget -> Ptr Label) $ withUTFString str $ \strPtr -> {# call label_new_with_mnemonic #} strPtr @@ -343,7 +345,7 @@ -- receive the events, and pack the label inside it, since labels are a -- \'NoWindow\' widget. -- -labelGetLayoutOffsets :: LabelClass self => self -> IO (Int,Int) +labelGetLayoutOffsets :: LabelClass self => self -> IO (Int, Int) labelGetLayoutOffsets self = alloca $ \xPtr -> alloca $ \yPtr -> do @@ -353,7 +355,7 @@ yPtr x <- peek xPtr y <- peek yPtr - return (fromIntegral x,fromIntegral y) + return (fromIntegral x, fromIntegral y) -- | KeyVal is a synonym for a hot key number. -- @@ -536,7 +538,7 @@ -- -- Default value: @False@ -- -labelUseMarkup :: Attr Label Bool +labelUseMarkup :: LabelClass self => Attr self Bool labelUseMarkup = Attr labelGetUseMarkup labelSetUseMarkup @@ -546,7 +548,7 @@ -- -- Default value: @False@ -- -labelUseUnderline :: Attr Label Bool +labelUseUnderline :: LabelClass self => Attr self Bool labelUseUnderline = Attr labelGetUseUnderline labelSetUseUnderline @@ -557,7 +559,7 @@ -- -- Default value: 'JustifyLeft' -- -labelJustify :: Attr Label Justification +labelJustify :: LabelClass self => Attr self Justification labelJustify = Attr labelGetJustify labelSetJustify @@ -566,14 +568,14 @@ -- -- Default value: @False@ -- -labelSelectable :: Attr Label Bool +labelSelectable :: LabelClass self => Attr self Bool labelSelectable = Attr labelGetSelectable labelSetSelectable -- | \'lineWrap\' property. See 'labelGetLineWrap' and 'labelSetLineWrap' -- -labelLineWrap :: Attr Label Bool +labelLineWrap :: LabelClass self => Attr self Bool labelLineWrap = Attr labelGetLineWrap labelSetLineWrap |