From: Duncan C. <dun...@us...> - 2005-04-07 00:14:12
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2146/gtk/Graphics/UI/Gtk/Buttons Modified Files: Button.chs.pp Log Message: Add bindings for a bunch of extra methods and properties. Also, various doc changes. Index: Button.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Button.chs.pp 2 Apr 2005 19:08:00 -0000 1.6 +++ Button.chs.pp 7 Apr 2005 00:14:00 -0000 1.7 @@ -84,6 +84,10 @@ buttonSetAlignment, buttonGetAlignment, #endif +#if GTK_CHECK_VERSION(2,6,0) + buttonGetImage, + buttonSetImage, +#endif -- * Properties buttonUseUnderline, @@ -379,6 +383,30 @@ return (realToFrac xalign, realToFrac yalign) #endif +-- | Gets the widget that is currenty set as the image of the button. This may +-- have been explicitly set by 'buttonSetImage' or constructed by +-- 'buttonNewFromStock'. +-- +buttonGetImage :: ButtonClass self => self + -> IO (Maybe Widget) -- ^ a 'Widget' or @Nothing@ in case there is no image +buttonGetImage self = + maybeNull (makeNewObject mkWidget) $ + {# call gtk_button_get_image #} + (toButton self) + +-- | Set the image of the button to the given widget. Note that it depends on +-- the \"gtk-button-images\" setting whether the image will be displayed or not. +-- +-- * Available since Gtk+ version 2.6 +-- +buttonSetImage :: (ButtonClass self, WidgetClass image) => self + -> image -- ^ a widget to set as the image for the button + -> IO () +buttonSetImage self image = + {# call gtk_button_set_image #} + (toButton self) + (toWidget image) + -------------------- -- Properties |