2
-- GIMP Toolkit (GTK) Widget CheckButton
6
-- Created: 15 May 2001
8
-- Version $Revision: 1.6 $ from $Date: 2005/10/19 12:57:36 $
10
-- Copyright (C) 1999-2005 Axel Simon
12
-- This library is free software; you can redistribute it and/or
13
-- modify it under the terms of the GNU Lesser General Public
14
-- License as published by the Free Software Foundation; either
15
-- version 2.1 of the License, or (at your option) any later version.
17
-- This library is distributed in the hope that it will be useful,
18
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
-- Lesser General Public License for more details.
23
-- Maintainer : gtk2hs-users@lists.sourceforge.net
24
-- Stability : provisional
25
-- Portability : portable (depends on GHC)
27
-- Create widgets with a discrete toggle button
29
module Graphics.UI.Gtk.Buttons.CheckButton (
32
-- | A 'CheckButton' places a discrete 'ToggleButton' next to a widget,
33
-- (usually a 'Label'). See the section on 'ToggleButton' widgets for more
34
-- information about toggle\/check buttons.
36
-- The important signal (\'toggled\') is also inherited from 'ToggleButton'.
47
-- | +----'ToggleButton'
49
-- | +----'RadioButton'
60
checkButtonNewWithLabel,
61
checkButtonNewWithMnemonic,
66
import System.Glib.FFI
67
import System.Glib.UTFString
68
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
69
{#import Graphics.UI.Gtk.Types#}
70
{#import Graphics.UI.Gtk.Signals#}
72
{# context lib="gtk" prefix="gtk" #}
77
-- | Creates a new 'CheckButton'.
79
checkButtonNew :: IO CheckButton
81
makeNewObject mkCheckButton $
82
liftM (castPtr :: Ptr Widget -> Ptr CheckButton) $
83
{# call unsafe check_button_new #}
85
-- | Creates a new 'CheckButton' with a 'Label' to the right of it.
87
checkButtonNewWithLabel ::
88
String -- ^ @label@ - the text for the check button.
90
checkButtonNewWithLabel label =
91
makeNewObject mkCheckButton $
92
liftM (castPtr :: Ptr Widget -> Ptr CheckButton) $
93
withUTFString label $ \labelPtr ->
94
{# call unsafe check_button_new_with_label #}
97
-- | Creates a new 'CheckButton' containing a label. The label will be created
98
-- using 'labelNewWithMnemonic', so underscores in @label@ indicate the
99
-- mnemonic for the check button.
101
checkButtonNewWithMnemonic ::
102
String -- ^ @label@ - The text of the button, with an underscore
103
-- in front of the mnemonic character
105
checkButtonNewWithMnemonic label =
106
makeNewObject mkCheckButton $
107
liftM (castPtr :: Ptr Widget -> Ptr CheckButton) $
108
withUTFString label $ \labelPtr ->
109
{# call unsafe check_button_new_with_mnemonic #}