Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- widgetPathAppendForWidget
- widgetPathAppendType
- widgetPathAppendWithSiblings
- widgetPathCopy
- widgetPathFree
- widgetPathGetObjectType
- widgetPathHasParent
- widgetPathIsType
- widgetPathIterAddClass
- widgetPathIterAddRegion
- widgetPathIterClearClasses
- widgetPathIterClearRegions
- widgetPathIterGetName
- widgetPathIterGetObjectType
- widgetPathIterGetSiblingIndex
- widgetPathIterGetSiblings
- widgetPathIterGetState
- widgetPathIterHasClass
- widgetPathIterHasName
- widgetPathIterHasQclass
- widgetPathIterHasQname
- widgetPathIterHasQregion
- widgetPathIterHasRegion
- widgetPathIterListClasses
- widgetPathIterListRegions
- widgetPathIterRemoveClass
- widgetPathIterRemoveRegion
- widgetPathIterSetName
- widgetPathIterSetObjectType
- widgetPathIterSetState
- widgetPathLength
- widgetPathNew
- widgetPathPrependType
- widgetPathRef
- widgetPathToString
- widgetPathUnref
GtkWidgetPath is a boxed type that represents a widget hierarchy from the topmost widget, typically a toplevel, to any child. This widget path abstraction is used in #GtkStyleContext on behalf of the real widget in order to query style information.
If you are using GTK+ widgets, you probably will not need to use this API directly, as there is gtk_widget_get_path(), and the style context returned by gtk_widget_get_style_context() will be automatically updated on widget hierarchy changes.
The widget path generation is generally simple:
## Defining a button within a window
|[language="C" -- { GtkWidgetPath *path;
path = gtk_widget_path_new (); gtk_widget_path_append_type (path, GTK_TYPE_WINDOW); gtk_widget_path_append_type (path, GTK_TYPE_BUTTON); } ]|
Although more complex information, such as widget names, or different classes (property that may be used by other widget types) and intermediate regions may be included:
## Defining the first tab widget in a notebook
|[language="C" -- { GtkWidgetPath *path; guint pos;
path = gtk_widget_path_new ();
pos = gtk_widget_path_append_type (path, GTK_TYPE_NOTEBOOK); gtk_widget_path_iter_add_region (path, pos, "tab", GTK_REGION_EVEN | GTK_REGION_FIRST);
pos = gtk_widget_path_append_type (path, GTK_TYPE_LABEL); gtk_widget_path_iter_set_name (path, pos, "first tab label"); } ]|
All this information will be used to match the style information that applies to the described widget.
- newtype WidgetPath = WidgetPath (ForeignPtr WidgetPath)
- noWidgetPath :: Maybe WidgetPath
- widgetPathAppendForWidget :: (MonadIO m, WidgetK a) => WidgetPath -> a -> m Int32
- widgetPathAppendType :: MonadIO m => WidgetPath -> GType -> m Int32
- widgetPathAppendWithSiblings :: MonadIO m => WidgetPath -> WidgetPath -> Word32 -> m Int32
- widgetPathCopy :: MonadIO m => WidgetPath -> m WidgetPath
- widgetPathFree :: MonadIO m => WidgetPath -> m ()
- widgetPathGetObjectType :: MonadIO m => WidgetPath -> m GType
- widgetPathHasParent :: MonadIO m => WidgetPath -> GType -> m Bool
- widgetPathIsType :: MonadIO m => WidgetPath -> GType -> m Bool
- widgetPathIterAddClass :: MonadIO m => WidgetPath -> Int32 -> Text -> m ()
- widgetPathIterAddRegion :: MonadIO m => WidgetPath -> Int32 -> Text -> [RegionFlags] -> m ()
- widgetPathIterClearClasses :: MonadIO m => WidgetPath -> Int32 -> m ()
- widgetPathIterClearRegions :: MonadIO m => WidgetPath -> Int32 -> m ()
- widgetPathIterGetName :: MonadIO m => WidgetPath -> Int32 -> m Text
- widgetPathIterGetObjectType :: MonadIO m => WidgetPath -> Int32 -> m GType
- widgetPathIterGetSiblingIndex :: MonadIO m => WidgetPath -> Int32 -> m Word32
- widgetPathIterGetSiblings :: MonadIO m => WidgetPath -> Int32 -> m WidgetPath
- widgetPathIterGetState :: MonadIO m => WidgetPath -> Int32 -> m [StateFlags]
- widgetPathIterHasClass :: MonadIO m => WidgetPath -> Int32 -> Text -> m Bool
- widgetPathIterHasName :: MonadIO m => WidgetPath -> Int32 -> Text -> m Bool
- widgetPathIterHasQclass :: MonadIO m => WidgetPath -> Int32 -> Word32 -> m Bool
- widgetPathIterHasQname :: MonadIO m => WidgetPath -> Int32 -> Word32 -> m Bool
- widgetPathIterHasQregion :: MonadIO m => WidgetPath -> Int32 -> Word32 -> m (Bool, [RegionFlags])
- widgetPathIterHasRegion :: MonadIO m => WidgetPath -> Int32 -> Text -> m (Bool, [RegionFlags])
- widgetPathIterListClasses :: MonadIO m => WidgetPath -> Int32 -> m [Text]
- widgetPathIterListRegions :: MonadIO m => WidgetPath -> Int32 -> m [Text]
- widgetPathIterRemoveClass :: MonadIO m => WidgetPath -> Int32 -> Text -> m ()
- widgetPathIterRemoveRegion :: MonadIO m => WidgetPath -> Int32 -> Text -> m ()
- widgetPathIterSetName :: MonadIO m => WidgetPath -> Int32 -> Text -> m ()
- widgetPathIterSetObjectType :: MonadIO m => WidgetPath -> Int32 -> GType -> m ()
- widgetPathIterSetState :: MonadIO m => WidgetPath -> Int32 -> [StateFlags] -> m ()
- widgetPathLength :: MonadIO m => WidgetPath -> m Int32
- widgetPathNew :: MonadIO m => m WidgetPath
- widgetPathPrependType :: MonadIO m => WidgetPath -> GType -> m ()
- widgetPathRef :: MonadIO m => WidgetPath -> m WidgetPath
- widgetPathToString :: MonadIO m => WidgetPath -> m Text
- widgetPathUnref :: MonadIO m => WidgetPath -> m ()
Exported types
Methods
widgetPathAppendForWidget
widgetPathAppendForWidget :: (MonadIO m, WidgetK a) => WidgetPath -> a -> m Int32 Source
widgetPathAppendType
widgetPathAppendType :: MonadIO m => WidgetPath -> GType -> m Int32 Source
widgetPathAppendWithSiblings
widgetPathAppendWithSiblings :: MonadIO m => WidgetPath -> WidgetPath -> Word32 -> m Int32 Source
widgetPathCopy
widgetPathCopy :: MonadIO m => WidgetPath -> m WidgetPath Source
widgetPathFree
widgetPathFree :: MonadIO m => WidgetPath -> m () Source
widgetPathGetObjectType
widgetPathGetObjectType :: MonadIO m => WidgetPath -> m GType Source
widgetPathHasParent
widgetPathHasParent :: MonadIO m => WidgetPath -> GType -> m Bool Source
widgetPathIsType
widgetPathIsType :: MonadIO m => WidgetPath -> GType -> m Bool Source
widgetPathIterAddClass
widgetPathIterAddClass :: MonadIO m => WidgetPath -> Int32 -> Text -> m () Source
widgetPathIterAddRegion
widgetPathIterAddRegion :: MonadIO m => WidgetPath -> Int32 -> Text -> [RegionFlags] -> m () Source
Deprecated: (Since version 3.14)The use of regions is deprecated.
widgetPathIterClearClasses
widgetPathIterClearClasses :: MonadIO m => WidgetPath -> Int32 -> m () Source
widgetPathIterClearRegions
widgetPathIterClearRegions :: MonadIO m => WidgetPath -> Int32 -> m () Source
Deprecated: (Since version 3.14)The use of regions is deprecated.
widgetPathIterGetName
widgetPathIterGetName :: MonadIO m => WidgetPath -> Int32 -> m Text Source
widgetPathIterGetObjectType
widgetPathIterGetObjectType :: MonadIO m => WidgetPath -> Int32 -> m GType Source
widgetPathIterGetSiblingIndex
widgetPathIterGetSiblingIndex :: MonadIO m => WidgetPath -> Int32 -> m Word32 Source
widgetPathIterGetSiblings
widgetPathIterGetSiblings :: MonadIO m => WidgetPath -> Int32 -> m WidgetPath Source
widgetPathIterGetState
widgetPathIterGetState :: MonadIO m => WidgetPath -> Int32 -> m [StateFlags] Source
widgetPathIterHasClass
widgetPathIterHasClass :: MonadIO m => WidgetPath -> Int32 -> Text -> m Bool Source
widgetPathIterHasName
widgetPathIterHasName :: MonadIO m => WidgetPath -> Int32 -> Text -> m Bool Source
widgetPathIterHasQclass
widgetPathIterHasQclass :: MonadIO m => WidgetPath -> Int32 -> Word32 -> m Bool Source
widgetPathIterHasQname
widgetPathIterHasQname :: MonadIO m => WidgetPath -> Int32 -> Word32 -> m Bool Source
widgetPathIterHasQregion
widgetPathIterHasQregion :: MonadIO m => WidgetPath -> Int32 -> Word32 -> m (Bool, [RegionFlags]) Source
Deprecated: (Since version 3.14)The use of regions is deprecated.
widgetPathIterHasRegion
widgetPathIterHasRegion :: MonadIO m => WidgetPath -> Int32 -> Text -> m (Bool, [RegionFlags]) Source
Deprecated: (Since version 3.14)The use of regions is deprecated.
widgetPathIterListClasses
widgetPathIterListClasses :: MonadIO m => WidgetPath -> Int32 -> m [Text] Source
widgetPathIterListRegions
widgetPathIterListRegions :: MonadIO m => WidgetPath -> Int32 -> m [Text] Source
Deprecated: (Since version 3.14)The use of regions is deprecated.
widgetPathIterRemoveClass
widgetPathIterRemoveClass :: MonadIO m => WidgetPath -> Int32 -> Text -> m () Source
widgetPathIterRemoveRegion
widgetPathIterRemoveRegion :: MonadIO m => WidgetPath -> Int32 -> Text -> m () Source
Deprecated: (Since version 3.14)The use of regions is deprecated.
widgetPathIterSetName
widgetPathIterSetName :: MonadIO m => WidgetPath -> Int32 -> Text -> m () Source
widgetPathIterSetObjectType
widgetPathIterSetObjectType :: MonadIO m => WidgetPath -> Int32 -> GType -> m () Source
widgetPathIterSetState
widgetPathIterSetState :: MonadIO m => WidgetPath -> Int32 -> [StateFlags] -> m () Source
widgetPathLength
widgetPathLength :: MonadIO m => WidgetPath -> m Int32 Source
widgetPathNew
widgetPathNew :: MonadIO m => m WidgetPath Source
widgetPathPrependType
widgetPathPrependType :: MonadIO m => WidgetPath -> GType -> m () Source
widgetPathRef
widgetPathRef :: MonadIO m => WidgetPath -> m WidgetPath Source
widgetPathToString
widgetPathToString :: MonadIO m => WidgetPath -> m Text Source
widgetPathUnref
widgetPathUnref :: MonadIO m => WidgetPath -> m () Source