{-# LINE 2 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
module Graphics.UI.Gtk.Buttons.RadioButton (
RadioButton,
RadioButtonClass,
castToRadioButton, gTypeRadioButton,
toRadioButton,
radioButtonNew,
radioButtonNewWithLabel,
radioButtonNewWithMnemonic,
radioButtonNewFromWidget,
radioButtonNewWithLabelFromWidget,
radioButtonNewWithMnemonicFromWidget,
radioButtonNewJoinGroup,
radioButtonNewJoinGroupWithLabel,
radioButtonNewJoinGroupWithMnemonic,
radioButtonSetGroup,
radioButtonGetGroup,
radioButtonGroup,
groupChanged,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
import System.Glib.Attributes
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 151 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 152 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
{-# LINE 154 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
radioButtonNew :: IO RadioButton
radioButtonNew :: IO RadioButton
radioButtonNew =
(ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (IO (Ptr RadioButton) -> IO RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr RadioButton)
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr RadioButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr RadioButton) (IO (Ptr Widget) -> IO (Ptr RadioButton))
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall a b. (a -> b) -> a -> b
$
Ptr () -> IO (Ptr Widget)
gtk_radio_button_new
{-# LINE 166 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
nullPtr
radioButtonNewWithLabel :: GlibString string => string -> IO RadioButton
radioButtonNewWithLabel :: forall string. GlibString string => string -> IO RadioButton
radioButtonNewWithLabel string
label =
(ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (IO (Ptr RadioButton) -> IO RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr RadioButton)
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr RadioButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr RadioButton) (IO (Ptr Widget) -> IO (Ptr RadioButton))
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
label ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
labelPtr ->
Ptr () -> CString -> IO (Ptr Widget)
gtk_radio_button_new_with_label
{-# LINE 176 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
nullPtr
CString
labelPtr
radioButtonNewWithMnemonic :: GlibString string
=> string
-> IO RadioButton
radioButtonNewWithMnemonic :: forall string. GlibString string => string -> IO RadioButton
radioButtonNewWithMnemonic string
label =
(ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (IO (Ptr RadioButton) -> IO RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr RadioButton)
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr RadioButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr RadioButton) (IO (Ptr Widget) -> IO (Ptr RadioButton))
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
label ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
labelPtr ->
Ptr () -> CString -> IO (Ptr Widget)
gtk_radio_button_new_with_mnemonic
{-# LINE 193 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
nullPtr
CString
labelPtr
radioButtonNewFromWidget ::
RadioButton
-> IO RadioButton
radioButtonNewFromWidget :: RadioButton -> IO RadioButton
radioButtonNewFromWidget RadioButton
group =
(ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (IO (Ptr RadioButton) -> IO RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr RadioButton)
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr RadioButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr RadioButton) (IO (Ptr Widget) -> IO (Ptr RadioButton))
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall a b. (a -> b) -> a -> b
$
(\(RadioButton ForeignPtr RadioButton
arg1) -> ForeignPtr RadioButton
-> (Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RadioButton
arg1 ((Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr RadioButton
argPtr1 ->Ptr RadioButton -> IO (Ptr Widget)
gtk_radio_button_new_from_widget Ptr RadioButton
argPtr1)
{-# LINE 208 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
group
radioButtonNewWithLabelFromWidget :: GlibString string
=> RadioButton
-> string
-> IO RadioButton
radioButtonNewWithLabelFromWidget :: forall string.
GlibString string =>
RadioButton -> string -> IO RadioButton
radioButtonNewWithLabelFromWidget RadioButton
group string
label =
(ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (IO (Ptr RadioButton) -> IO RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr RadioButton)
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr RadioButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr RadioButton) (IO (Ptr Widget) -> IO (Ptr RadioButton))
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
label ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
labelPtr ->
(\(RadioButton ForeignPtr RadioButton
arg1) CString
arg2 -> ForeignPtr RadioButton
-> (Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RadioButton
arg1 ((Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr RadioButton
argPtr1 ->Ptr RadioButton -> CString -> IO (Ptr Widget)
gtk_radio_button_new_with_label_from_widget Ptr RadioButton
argPtr1 CString
arg2)
{-# LINE 224 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
group
CString
labelPtr
radioButtonNewWithMnemonicFromWidget :: GlibString string
=> RadioButton
-> string
-> IO RadioButton
radioButtonNewWithMnemonicFromWidget :: forall string.
GlibString string =>
RadioButton -> string -> IO RadioButton
radioButtonNewWithMnemonicFromWidget RadioButton
group string
label =
(ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (IO (Ptr RadioButton) -> IO RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr RadioButton)
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr RadioButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr RadioButton) (IO (Ptr Widget) -> IO (Ptr RadioButton))
-> IO (Ptr Widget) -> IO (Ptr RadioButton)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
label ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
labelPtr ->
(\(RadioButton ForeignPtr RadioButton
arg1) CString
arg2 -> ForeignPtr RadioButton
-> (Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RadioButton
arg1 ((Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr RadioButton -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr RadioButton
argPtr1 ->Ptr RadioButton -> CString -> IO (Ptr Widget)
gtk_radio_button_new_with_mnemonic_from_widget Ptr RadioButton
argPtr1 CString
arg2)
{-# LINE 243 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
group
CString
labelPtr
radioButtonNewJoinGroup ::
RadioButton
-> IO RadioButton
radioButtonNewJoinGroup :: RadioButton -> IO RadioButton
radioButtonNewJoinGroup = RadioButton -> IO RadioButton
radioButtonNewFromWidget
{-# DEPRECATED radioButtonNewJoinGroup "use radioButtonNewFromWidget instead" #-}
radioButtonNewJoinGroupWithLabel :: GlibString string
=> RadioButton
-> string
-> IO RadioButton
radioButtonNewJoinGroupWithLabel :: forall string.
GlibString string =>
RadioButton -> string -> IO RadioButton
radioButtonNewJoinGroupWithLabel = RadioButton -> string -> IO RadioButton
forall string.
GlibString string =>
RadioButton -> string -> IO RadioButton
radioButtonNewWithLabelFromWidget
{-# DEPRECATED radioButtonNewJoinGroupWithLabel "use radioButtonNewWithLabelFromWidget instead" #-}
radioButtonNewJoinGroupWithMnemonic :: GlibString string
=> RadioButton
-> string
-> IO RadioButton
radioButtonNewJoinGroupWithMnemonic :: forall string.
GlibString string =>
RadioButton -> string -> IO RadioButton
radioButtonNewJoinGroupWithMnemonic = RadioButton -> string -> IO RadioButton
forall string.
GlibString string =>
RadioButton -> string -> IO RadioButton
radioButtonNewWithMnemonicFromWidget
{-# DEPRECATED radioButtonNewJoinGroupWithMnemonic "use radioButtonNewWithMnemonicFromWidget instead" #-}
radioButtonSetGroup :: RadioButton
-> RadioButton
-> IO ()
radioButtonSetGroup :: RadioButton -> RadioButton -> IO ()
radioButtonSetGroup RadioButton
self RadioButton
group =
(\(RadioButton ForeignPtr RadioButton
arg1) -> ForeignPtr RadioButton
-> (Ptr RadioButton -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RadioButton
arg1 ((Ptr RadioButton -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr RadioButton -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr RadioButton
argPtr1 ->Ptr RadioButton -> IO (Ptr ())
gtk_radio_button_get_group Ptr RadioButton
argPtr1) RadioButton
group IO (Ptr ()) -> (Ptr () -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr ()
groupGSList ->
(\(RadioButton ForeignPtr RadioButton
arg1) Ptr ()
arg2 -> ForeignPtr RadioButton -> (Ptr RadioButton -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RadioButton
arg1 ((Ptr RadioButton -> IO ()) -> IO ())
-> (Ptr RadioButton -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RadioButton
argPtr1 ->Ptr RadioButton -> Ptr () -> IO ()
gtk_radio_button_set_group Ptr RadioButton
argPtr1 Ptr ()
arg2)
{-# LINE 289 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
self
Ptr ()
groupGSList
radioButtonGetGroup :: RadioButton
-> IO [RadioButton]
radioButtonGetGroup :: RadioButton -> IO [RadioButton]
radioButtonGetGroup RadioButton
self =
(\(RadioButton ForeignPtr RadioButton
arg1) -> ForeignPtr RadioButton
-> (Ptr RadioButton -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RadioButton
arg1 ((Ptr RadioButton -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr RadioButton -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr RadioButton
argPtr1 ->Ptr RadioButton -> IO (Ptr ())
gtk_radio_button_get_group Ptr RadioButton
argPtr1)
{-# LINE 299 "./Graphics/UI/Gtk/Buttons/RadioButton.chs" #-}
self
IO (Ptr ())
-> (Ptr () -> IO [Ptr RadioButton]) -> IO [Ptr RadioButton]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr () -> IO [Ptr RadioButton]
forall a. Ptr () -> IO [Ptr a]
readGSList
IO [Ptr RadioButton]
-> ([Ptr RadioButton] -> IO [RadioButton]) -> IO [RadioButton]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (Ptr RadioButton -> IO RadioButton)
-> [Ptr RadioButton] -> IO [RadioButton]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (\Ptr RadioButton
elemPtr -> (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
-> IO (Ptr RadioButton) -> IO RadioButton
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RadioButton -> RadioButton, FinalizerPtr RadioButton)
forall {a}. (ForeignPtr RadioButton -> RadioButton, FinalizerPtr a)
mkRadioButton (Ptr RadioButton -> IO (Ptr RadioButton)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RadioButton
elemPtr))
radioButtonGroup :: ReadWriteAttr RadioButton [RadioButton] RadioButton
radioButtonGroup :: ReadWriteAttr RadioButton [RadioButton] RadioButton
radioButtonGroup = (RadioButton -> IO [RadioButton])
-> (RadioButton -> RadioButton -> IO ())
-> ReadWriteAttr RadioButton [RadioButton] RadioButton
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
RadioButton -> IO [RadioButton]
radioButtonGetGroup
RadioButton -> RadioButton -> IO ()
radioButtonSetGroup
groupChanged :: RadioButtonClass self => Signal self (IO ())
groupChanged :: forall self. RadioButtonClass self => Signal self (IO ())
groupChanged = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
SignalName -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE SignalName
"group-changed")
foreign import ccall unsafe "gtk_radio_button_new"
gtk_radio_button_new :: ((Ptr ()) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_radio_button_new_with_label"
gtk_radio_button_new_with_label :: ((Ptr ()) -> ((Ptr CChar) -> (IO (Ptr Widget))))
foreign import ccall unsafe "gtk_radio_button_new_with_mnemonic"
gtk_radio_button_new_with_mnemonic :: ((Ptr ()) -> ((Ptr CChar) -> (IO (Ptr Widget))))
foreign import ccall safe "gtk_radio_button_new_from_widget"
gtk_radio_button_new_from_widget :: ((Ptr RadioButton) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_radio_button_new_with_label_from_widget"
gtk_radio_button_new_with_label_from_widget :: ((Ptr RadioButton) -> ((Ptr CChar) -> (IO (Ptr Widget))))
foreign import ccall safe "gtk_radio_button_new_with_mnemonic_from_widget"
gtk_radio_button_new_with_mnemonic_from_widget :: ((Ptr RadioButton) -> ((Ptr CChar) -> (IO (Ptr Widget))))
foreign import ccall unsafe "gtk_radio_button_get_group"
gtk_radio_button_get_group :: ((Ptr RadioButton) -> (IO (Ptr ())))
foreign import ccall safe "gtk_radio_button_set_group"
gtk_radio_button_set_group :: ((Ptr RadioButton) -> ((Ptr ()) -> (IO ())))