{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) 'GI.Gtk.Objects.SizeGroup.SizeGroup' provides a mechanism for grouping a number of widgets together so they all request the same amount of space. This is typically useful when you want a column of widgets to have the same size, but you can’t use a 'GI.Gtk.Objects.Grid.Grid' widget. In detail, the size requested for each widget in a 'GI.Gtk.Objects.SizeGroup.SizeGroup' is the maximum of the sizes that would have been requested for each widget in the size group if they were not in the size group. The mode of the size group (see 'GI.Gtk.Objects.SizeGroup.sizeGroupSetMode') determines whether this applies to the horizontal size, the vertical size, or both sizes. Note that size groups only affect the amount of space requested, not the size that the widgets finally receive. If you want the widgets in a 'GI.Gtk.Objects.SizeGroup.SizeGroup' to actually be the same size, you need to pack them in such a way that they get the size they request and not more. For example, if you are packing your widgets into a table, you would not include the 'GI.Gtk.Flags.AttachOptionsFill' flag. 'GI.Gtk.Objects.SizeGroup.SizeGroup' objects are referenced by each widget in the size group, so once you have added all widgets to a 'GI.Gtk.Objects.SizeGroup.SizeGroup', you can drop the initial reference to the size group with 'GI.GObject.Objects.Object.objectUnref'. If the widgets in the size group are subsequently destroyed, then they will be removed from the size group and drop their references on the size group; when all widgets have been removed, the size group will be freed. Widgets can be part of multiple size groups; GTK+ will compute the horizontal size of a widget from the horizontal requisition of all widgets that can be reached from the widget by a chain of size groups of type 'GI.Gtk.Enums.SizeGroupModeHorizontal' or 'GI.Gtk.Enums.SizeGroupModeBoth', and the vertical size from the vertical requisition of all widgets that can be reached from the widget by a chain of size groups of type 'GI.Gtk.Enums.SizeGroupModeVertical' or 'GI.Gtk.Enums.SizeGroupModeBoth'. Note that only non-contextual sizes of every widget are ever consulted by size groups (since size groups have no knowledge of what size a widget will be allocated in one dimension, it cannot derive how much height a widget will receive for a given width). When grouping widgets that trade height for width in mode 'GI.Gtk.Enums.SizeGroupModeVertical' or 'GI.Gtk.Enums.SizeGroupModeBoth': the height for the minimum width will be the requested height for all widgets in the group. The same is of course true when horizontally grouping width for height widgets. Widgets that trade height-for-width should set a reasonably large minimum width by way of 'GI.Gtk.Objects.Label.Label':@/width-chars/@ for instance. Widgets with static sizes as well as widgets that grow (such as ellipsizing text) need no such considerations. = GtkSizeGroup as GtkBuildable Size groups can be specified in a UI definition by placing an \<object> element with @class=\"GtkSizeGroup\"@ somewhere in the UI definition. The widgets that belong to the size group are specified by a \<widgets> element that may contain multiple \<widget> elements, one for each member of the size group. The ”name” attribute gives the id of the widget. An example of a UI definition fragment with GtkSizeGroup: > ><object class="GtkSizeGroup"> > <property name="mode">GTK_SIZE_GROUP_HORIZONTAL</property> > <widgets> > <widget name="radio1"/> > <widget name="radio2"/> > </widgets> ></object> -} module GI.Gtk.Objects.SizeGroup ( -- * Exported types SizeGroup(..) , IsSizeGroup , toSizeGroup , noSizeGroup , -- * Methods -- ** addWidget #method:addWidget# SizeGroupAddWidgetMethodInfo , sizeGroupAddWidget , -- ** getIgnoreHidden #method:getIgnoreHidden# SizeGroupGetIgnoreHiddenMethodInfo , sizeGroupGetIgnoreHidden , -- ** getMode #method:getMode# SizeGroupGetModeMethodInfo , sizeGroupGetMode , -- ** getWidgets #method:getWidgets# SizeGroupGetWidgetsMethodInfo , sizeGroupGetWidgets , -- ** new #method:new# sizeGroupNew , -- ** removeWidget #method:removeWidget# SizeGroupRemoveWidgetMethodInfo , sizeGroupRemoveWidget , -- ** setIgnoreHidden #method:setIgnoreHidden# SizeGroupSetIgnoreHiddenMethodInfo , sizeGroupSetIgnoreHidden , -- ** setMode #method:setMode# SizeGroupSetModeMethodInfo , sizeGroupSetMode , -- * Properties -- ** ignoreHidden #attr:ignoreHidden# SizeGroupIgnoreHiddenPropertyInfo , constructSizeGroupIgnoreHidden , getSizeGroupIgnoreHidden , setSizeGroupIgnoreHidden , sizeGroupIgnoreHidden , -- ** mode #attr:mode# SizeGroupModePropertyInfo , constructSizeGroupMode , getSizeGroupMode , setSizeGroupMode , sizeGroupMode , ) where import Data.GI.Base.ShortPrelude import qualified Data.GI.Base.ShortPrelude as SP import qualified Data.GI.Base.Overloading as O import qualified Prelude as P import qualified Data.GI.Base.Attributes as GI.Attributes import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import qualified Foreign.Ptr as FP import qualified GI.GObject.Objects.Object as GObject.Object import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget newtype SizeGroup = SizeGroup (ManagedPtr SizeGroup) foreign import ccall "gtk_size_group_get_type" c_gtk_size_group_get_type :: IO GType instance GObject SizeGroup where gobjectType _ = c_gtk_size_group_get_type class GObject o => IsSizeGroup o #if MIN_VERSION_base(4,9,0) instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError SizeGroup a) => IsSizeGroup a #endif instance IsSizeGroup SizeGroup instance GObject.Object.IsObject SizeGroup instance Gtk.Buildable.IsBuildable SizeGroup toSizeGroup :: IsSizeGroup o => o -> IO SizeGroup toSizeGroup = unsafeCastTo SizeGroup noSizeGroup :: Maybe SizeGroup noSizeGroup = Nothing type family ResolveSizeGroupMethod (t :: Symbol) (o :: *) :: * where ResolveSizeGroupMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo ResolveSizeGroupMethod "addWidget" o = SizeGroupAddWidgetMethodInfo ResolveSizeGroupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo ResolveSizeGroupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo ResolveSizeGroupMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo ResolveSizeGroupMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo ResolveSizeGroupMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo ResolveSizeGroupMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo ResolveSizeGroupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo ResolveSizeGroupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo ResolveSizeGroupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo ResolveSizeGroupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo ResolveSizeGroupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo ResolveSizeGroupMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo ResolveSizeGroupMethod "ref" o = GObject.Object.ObjectRefMethodInfo ResolveSizeGroupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo ResolveSizeGroupMethod "removeWidget" o = SizeGroupRemoveWidgetMethodInfo ResolveSizeGroupMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo ResolveSizeGroupMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo ResolveSizeGroupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo ResolveSizeGroupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo ResolveSizeGroupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo ResolveSizeGroupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo ResolveSizeGroupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo ResolveSizeGroupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo ResolveSizeGroupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo ResolveSizeGroupMethod "getIgnoreHidden" o = SizeGroupGetIgnoreHiddenMethodInfo ResolveSizeGroupMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo ResolveSizeGroupMethod "getMode" o = SizeGroupGetModeMethodInfo ResolveSizeGroupMethod "getName" o = Gtk.Buildable.BuildableGetNameMethodInfo ResolveSizeGroupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo ResolveSizeGroupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo ResolveSizeGroupMethod "getWidgets" o = SizeGroupGetWidgetsMethodInfo ResolveSizeGroupMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo ResolveSizeGroupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo ResolveSizeGroupMethod "setIgnoreHidden" o = SizeGroupSetIgnoreHiddenMethodInfo ResolveSizeGroupMethod "setMode" o = SizeGroupSetModeMethodInfo ResolveSizeGroupMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo ResolveSizeGroupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo ResolveSizeGroupMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveSizeGroupMethod t SizeGroup, O.MethodInfo info SizeGroup p) => O.IsLabelProxy t (SizeGroup -> p) where fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolveSizeGroupMethod t SizeGroup, O.MethodInfo info SizeGroup p) => O.IsLabel t (SizeGroup -> p) where fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif -- VVV Prop "ignore-hidden" -- Type: TBasicType TBoolean -- Flags: [PropertyReadable,PropertyWritable] -- Nullable: (Just False,Just False) getSizeGroupIgnoreHidden :: (MonadIO m, IsSizeGroup o) => o -> m Bool getSizeGroupIgnoreHidden obj = liftIO $ getObjectPropertyBool obj "ignore-hidden" setSizeGroupIgnoreHidden :: (MonadIO m, IsSizeGroup o) => o -> Bool -> m () setSizeGroupIgnoreHidden obj val = liftIO $ setObjectPropertyBool obj "ignore-hidden" val constructSizeGroupIgnoreHidden :: (IsSizeGroup o) => Bool -> IO (GValueConstruct o) constructSizeGroupIgnoreHidden val = constructObjectPropertyBool "ignore-hidden" val data SizeGroupIgnoreHiddenPropertyInfo instance AttrInfo SizeGroupIgnoreHiddenPropertyInfo where type AttrAllowedOps SizeGroupIgnoreHiddenPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SizeGroupIgnoreHiddenPropertyInfo = (~) Bool type AttrBaseTypeConstraint SizeGroupIgnoreHiddenPropertyInfo = IsSizeGroup type AttrGetType SizeGroupIgnoreHiddenPropertyInfo = Bool type AttrLabel SizeGroupIgnoreHiddenPropertyInfo = "ignore-hidden" type AttrOrigin SizeGroupIgnoreHiddenPropertyInfo = SizeGroup attrGet _ = getSizeGroupIgnoreHidden attrSet _ = setSizeGroupIgnoreHidden attrConstruct _ = constructSizeGroupIgnoreHidden attrClear _ = undefined -- VVV Prop "mode" -- Type: TInterface (Name {namespace = "Gtk", name = "SizeGroupMode"}) -- Flags: [PropertyReadable,PropertyWritable] -- Nullable: (Just False,Just False) getSizeGroupMode :: (MonadIO m, IsSizeGroup o) => o -> m Gtk.Enums.SizeGroupMode getSizeGroupMode obj = liftIO $ getObjectPropertyEnum obj "mode" setSizeGroupMode :: (MonadIO m, IsSizeGroup o) => o -> Gtk.Enums.SizeGroupMode -> m () setSizeGroupMode obj val = liftIO $ setObjectPropertyEnum obj "mode" val constructSizeGroupMode :: (IsSizeGroup o) => Gtk.Enums.SizeGroupMode -> IO (GValueConstruct o) constructSizeGroupMode val = constructObjectPropertyEnum "mode" val data SizeGroupModePropertyInfo instance AttrInfo SizeGroupModePropertyInfo where type AttrAllowedOps SizeGroupModePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint SizeGroupModePropertyInfo = (~) Gtk.Enums.SizeGroupMode type AttrBaseTypeConstraint SizeGroupModePropertyInfo = IsSizeGroup type AttrGetType SizeGroupModePropertyInfo = Gtk.Enums.SizeGroupMode type AttrLabel SizeGroupModePropertyInfo = "mode" type AttrOrigin SizeGroupModePropertyInfo = SizeGroup attrGet _ = getSizeGroupMode attrSet _ = setSizeGroupMode attrConstruct _ = constructSizeGroupMode attrClear _ = undefined instance O.HasAttributeList SizeGroup type instance O.AttributeList SizeGroup = SizeGroupAttributeList type SizeGroupAttributeList = ('[ '("ignoreHidden", SizeGroupIgnoreHiddenPropertyInfo), '("mode", SizeGroupModePropertyInfo)] :: [(Symbol, *)]) sizeGroupIgnoreHidden :: AttrLabelProxy "ignoreHidden" sizeGroupIgnoreHidden = AttrLabelProxy sizeGroupMode :: AttrLabelProxy "mode" sizeGroupMode = AttrLabelProxy type instance O.SignalList SizeGroup = SizeGroupSignalList type SizeGroupSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) -- method SizeGroup::new -- method type : Constructor -- Args : [Arg {argCName = "mode", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroupMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the mode for the new size group.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gtk", name = "SizeGroup"})) -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_new" gtk_size_group_new :: CUInt -> -- mode : TInterface (Name {namespace = "Gtk", name = "SizeGroupMode"}) IO (Ptr SizeGroup) {- | Create a new 'GI.Gtk.Objects.SizeGroup.SizeGroup'. -} sizeGroupNew :: (B.CallStack.HasCallStack, MonadIO m) => Gtk.Enums.SizeGroupMode {- ^ /@mode@/: the mode for the new size group. -} -> m SizeGroup {- ^ __Returns:__ a newly created 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} sizeGroupNew mode = liftIO $ do let mode' = (fromIntegral . fromEnum) mode result <- gtk_size_group_new mode' checkUnexpectedReturnNULL "sizeGroupNew" result result' <- (wrapObject SizeGroup) result return result' -- method SizeGroup::add_widget -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkWidget to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_add_widget" gtk_size_group_add_widget :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) IO () {- | Adds a widget to a 'GI.Gtk.Objects.SizeGroup.SizeGroup'. In the future, the requisition of the widget will be determined as the maximum of its requisition and the requisition of the other widgets in the size group. Whether this applies horizontally, vertically, or in both directions depends on the mode of the size group. See 'GI.Gtk.Objects.SizeGroup.sizeGroupSetMode'. When the widget is destroyed or no longer referenced elsewhere, it will be removed from the size group. -} sizeGroupAddWidget :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> b {- ^ /@widget@/: the 'GI.Gtk.Objects.Widget.Widget' to add -} -> m () sizeGroupAddWidget sizeGroup widget = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup widget' <- unsafeManagedPtrCastPtr widget gtk_size_group_add_widget sizeGroup' widget' touchManagedPtr sizeGroup touchManagedPtr widget return () data SizeGroupAddWidgetMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) => O.MethodInfo SizeGroupAddWidgetMethodInfo a signature where overloadedMethod _ = sizeGroupAddWidget -- method SizeGroup::get_ignore_hidden -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_get_ignore_hidden" gtk_size_group_get_ignore_hidden :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) IO CInt {-# DEPRECATED sizeGroupGetIgnoreHidden ["(Since version 3.22)","Measuring the size of hidden widgets has not worked"," reliably for a long time. In most cases, they will report a size"," of 0 nowadays, and thus, their size will not affect the other"," size group members. In effect, size groups will always operate"," as if this property was 'True'. Use a 'GI.Gtk.Objects.Stack.Stack' instead to hide"," widgets while still having their size taken into account."] #-} {- | Returns if invisible widgets are ignored when calculating the size. @since 2.8 -} sizeGroupGetIgnoreHidden :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> m Bool {- ^ __Returns:__ 'True' if invisible widgets are ignored. -} sizeGroupGetIgnoreHidden sizeGroup = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup result <- gtk_size_group_get_ignore_hidden sizeGroup' let result' = (/= 0) result touchManagedPtr sizeGroup return result' data SizeGroupGetIgnoreHiddenMethodInfo instance (signature ~ (m Bool), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupGetIgnoreHiddenMethodInfo a signature where overloadedMethod _ = sizeGroupGetIgnoreHidden -- method SizeGroup::get_mode -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gtk", name = "SizeGroupMode"})) -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_get_mode" gtk_size_group_get_mode :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) IO CUInt {- | Gets the current mode of the size group. See 'GI.Gtk.Objects.SizeGroup.sizeGroupSetMode'. -} sizeGroupGetMode :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> m Gtk.Enums.SizeGroupMode {- ^ __Returns:__ the current mode of the size group. -} sizeGroupGetMode sizeGroup = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup result <- gtk_size_group_get_mode sizeGroup' let result' = (toEnum . fromIntegral) result touchManagedPtr sizeGroup return result' data SizeGroupGetModeMethodInfo instance (signature ~ (m Gtk.Enums.SizeGroupMode), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupGetModeMethodInfo a signature where overloadedMethod _ = sizeGroupGetMode -- method SizeGroup::get_widgets -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGSList (TInterface (Name {namespace = "Gtk", name = "Widget"}))) -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_get_widgets" gtk_size_group_get_widgets :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) IO (Ptr (GSList (Ptr Gtk.Widget.Widget))) {- | Returns the list of widgets associated with /@sizeGroup@/. @since 2.10 -} sizeGroupGetWidgets :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> m [Gtk.Widget.Widget] {- ^ __Returns:__ a 'GI.GLib.Structs.SList.SList' of widgets. The list is owned by GTK+ and should not be modified. -} sizeGroupGetWidgets sizeGroup = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup result <- gtk_size_group_get_widgets sizeGroup' result' <- unpackGSList result result'' <- mapM (newObject Gtk.Widget.Widget) result' touchManagedPtr sizeGroup return result'' data SizeGroupGetWidgetsMethodInfo instance (signature ~ (m [Gtk.Widget.Widget]), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupGetWidgetsMethodInfo a signature where overloadedMethod _ = sizeGroupGetWidgets -- method SizeGroup::remove_widget -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkWidget to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_remove_widget" gtk_size_group_remove_widget :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) Ptr Gtk.Widget.Widget -> -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"}) IO () {- | Removes a widget from a 'GI.Gtk.Objects.SizeGroup.SizeGroup'. -} sizeGroupRemoveWidget :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> b {- ^ /@widget@/: the 'GI.Gtk.Objects.Widget.Widget' to remove -} -> m () sizeGroupRemoveWidget sizeGroup widget = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup widget' <- unsafeManagedPtrCastPtr widget gtk_size_group_remove_widget sizeGroup' widget' touchManagedPtr sizeGroup touchManagedPtr widget return () data SizeGroupRemoveWidgetMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsSizeGroup a, Gtk.Widget.IsWidget b) => O.MethodInfo SizeGroupRemoveWidgetMethodInfo a signature where overloadedMethod _ = sizeGroupRemoveWidget -- method SizeGroup::set_ignore_hidden -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ignore_hidden", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether unmapped widgets should be ignored\n when calculating the size", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_set_ignore_hidden" gtk_size_group_set_ignore_hidden :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) CInt -> -- ignore_hidden : TBasicType TBoolean IO () {-# DEPRECATED sizeGroupSetIgnoreHidden ["(Since version 3.22)","Measuring the size of hidden widgets has not worked"," reliably for a long time. In most cases, they will report a size"," of 0 nowadays, and thus, their size will not affect the other"," size group members. In effect, size groups will always operate"," as if this property was 'True'. Use a 'GI.Gtk.Objects.Stack.Stack' instead to hide"," widgets while still having their size taken into account."] #-} {- | Sets whether unmapped widgets should be ignored when calculating the size. @since 2.8 -} sizeGroupSetIgnoreHidden :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> Bool {- ^ /@ignoreHidden@/: whether unmapped widgets should be ignored when calculating the size -} -> m () sizeGroupSetIgnoreHidden sizeGroup ignoreHidden = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup let ignoreHidden' = (fromIntegral . fromEnum) ignoreHidden gtk_size_group_set_ignore_hidden sizeGroup' ignoreHidden' touchManagedPtr sizeGroup return () data SizeGroupSetIgnoreHiddenMethodInfo instance (signature ~ (Bool -> m ()), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupSetIgnoreHiddenMethodInfo a signature where overloadedMethod _ = sizeGroupSetIgnoreHidden -- method SizeGroup::set_mode -- method type : OrdinaryMethod -- Args : [Arg {argCName = "size_group", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSizeGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mode", argType = TInterface (Name {namespace = "Gtk", name = "SizeGroupMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the mode to set for the size group.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_size_group_set_mode" gtk_size_group_set_mode :: Ptr SizeGroup -> -- size_group : TInterface (Name {namespace = "Gtk", name = "SizeGroup"}) CUInt -> -- mode : TInterface (Name {namespace = "Gtk", name = "SizeGroupMode"}) IO () {- | Sets the 'GI.Gtk.Enums.SizeGroupMode' of the size group. The mode of the size group determines whether the widgets in the size group should all have the same horizontal requisition ('GI.Gtk.Enums.SizeGroupModeHorizontal') all have the same vertical requisition ('GI.Gtk.Enums.SizeGroupModeVertical'), or should all have the same requisition in both directions ('GI.Gtk.Enums.SizeGroupModeBoth'). -} sizeGroupSetMode :: (B.CallStack.HasCallStack, MonadIO m, IsSizeGroup a) => a {- ^ /@sizeGroup@/: a 'GI.Gtk.Objects.SizeGroup.SizeGroup' -} -> Gtk.Enums.SizeGroupMode {- ^ /@mode@/: the mode to set for the size group. -} -> m () sizeGroupSetMode sizeGroup mode = liftIO $ do sizeGroup' <- unsafeManagedPtrCastPtr sizeGroup let mode' = (fromIntegral . fromEnum) mode gtk_size_group_set_mode sizeGroup' mode' touchManagedPtr sizeGroup return () data SizeGroupSetModeMethodInfo instance (signature ~ (Gtk.Enums.SizeGroupMode -> m ()), MonadIO m, IsSizeGroup a) => O.MethodInfo SizeGroupSetModeMethodInfo a signature where overloadedMethod _ = sizeGroupSetMode