Skip to main content
Ctrl+K

GNOME Python API

  • GLib
  • Gio
  • GObject
  • Gtk
  • Gdk
  • Adw
    • DBus
    • DBusGLib
    • Flatpak
    • GModule
    • Gcr
    • GdkPixbuf
    • GdkPixdata
    • GdkWayland
    • GdkX11
    • Graphene
    • Gsk
    • Gst
    • GstBase
    • GstCheck
    • GstController
    • GstNet
    • GtkSource
    • HarfBuzz
    • ICal
    • JavaScriptCore
    • Pango
    • PangoCairo
    • PangoFT2
    • PangoFc
    • PangoOT
    • PangoXft
    • Shumate
    • Soup
    • Vte
    • WebKit
    • WebKitWebProcessExtension
    • Xdp
    • XdpGtk4
    • pycairo
  • GLib
  • Gio
  • GObject
  • Gtk
  • Gdk
  • Adw
  • DBus
  • DBusGLib
  • Flatpak
  • GModule
  • Gcr
  • GdkPixbuf
  • GdkPixdata
  • GdkWayland
  • GdkX11
  • Graphene
  • Gsk
  • Gst
  • GstBase
  • GstCheck
  • GstController
  • GstNet
  • GtkSource
  • HarfBuzz
  • ICal
  • JavaScriptCore
  • Pango
  • PangoCairo
  • PangoFT2
  • PangoFc
  • PangoOT
  • PangoXft
  • Shumate
  • Soup
  • Vte
  • WebKit
  • WebKitWebProcessExtension
  • Xdp
  • XdpGtk4
  • pycairo

Section Navigation

API

  • Classes
    • AboutDialog
    • AboutWindow
    • ActionRow
    • AlertDialog
    • Animation
    • AnimationTarget
    • Application
    • ApplicationWindow
    • Avatar
    • Banner
    • Bin
    • BottomSheet
    • Breakpoint
    • BreakpointBin
    • ButtonContent
    • ButtonRow
    • CallbackAnimationTarget
    • Carousel
    • CarouselIndicatorDots
    • CarouselIndicatorLines
    • Clamp
    • ClampLayout
    • ClampScrollable
    • ComboRow
    • Dialog
    • EntryRow
    • EnumListItem
    • EnumListModel
    • ExpanderRow
    • Flap
    • HeaderBar
    • Layout
    • LayoutSlot
    • Leaflet
    • LeafletPage
    • MessageDialog
    • MultiLayoutView
    • NavigationPage
    • NavigationSplitView
    • NavigationView
    • OverlaySplitView
    • PasswordEntryRow
    • PreferencesDialog
    • PreferencesGroup
    • PreferencesPage
    • PreferencesRow
    • PreferencesWindow
    • PropertyAnimationTarget
    • SpinRow
    • Spinner
    • SpinnerPaintable
    • SplitButton
    • SpringAnimation
    • Squeezer
    • SqueezerPage
    • StatusPage
    • StyleManager
    • SwipeTracker
    • SwitchRow
    • TabBar
    • TabButton
    • TabOverview
    • TabPage
    • TabView
    • TimedAnimation
    • Toast
    • ToastOverlay
    • ToolbarView
    • ViewStack
    • ViewStackPage
    • ViewStackPages
    • ViewSwitcher
    • ViewSwitcherBar
    • ViewSwitcherTitle
    • Window
    • WindowTitle
  • Interfaces
    • Swipeable
  • Structures
    • BreakpointCondition
    • SpringParams
  • Enums
    • AccentColor
    • AnimationState
    • BreakpointConditionLengthType
    • BreakpointConditionRatioType
    • CenteringPolicy
    • ColorScheme
    • DialogPresentationMode
    • Easing
    • FlapFoldPolicy
    • FlapTransitionType
    • FoldThresholdPolicy
    • LeafletTransitionType
    • LengthUnit
    • NavigationDirection
    • ResponseAppearance
    • SqueezerTransitionType
    • TabViewShortcuts
    • ToastPriority
    • ToolbarStyle
    • ViewSwitcherPolicy
  • Functions
  • Constants
  • Adw
  • Classes
  • Banner

Banner#

Added in version 1.3.

class Banner(**properties: Any)#

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Actionable, Buildable, ConstraintTarget

A bar with contextual information.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/banner.png

Banners are hidden by default, use revealed to show them.

Banners have a title, set with title. Titles can be marked up with Pango markup, use use_markup to enable it.

The title will be shown centered or left-aligned depending on available space.

Banners can optionally have a button with text on it, set through button_label. The button can be used with a GAction, or with the button_clicked signal.

CSS nodes#

AdwBanner has a main CSS node with the name banner.

Constructors#

class Banner
classmethod new(title: str) → Widget#

Creates a new AdwBanner.

Added in version 1.3.

Parameters:

title – the banner title

Methods#

class Banner
get_button_label() → str | None#

Gets the button label for self.

Added in version 1.3.

get_revealed() → bool#

Gets if a banner is revealed

Added in version 1.3.

get_title() → str#

Gets the title for self.

Added in version 1.3.

get_use_markup() → bool#

Gets whether to use Pango markup for the banner title.

Added in version 1.3.

set_button_label(label: str | None = None) → None#

Sets the button label for self.

If set to "" or NULL, the button won’t be shown.

The button can be used with a GAction, or with the button_clicked signal.

Added in version 1.3.

Parameters:

label – the label

set_revealed(revealed: bool) → None#

Sets whether a banner should be revealed

Added in version 1.3.

Parameters:

revealed – whether a banner should be revealed

set_title(title: str) → None#

Sets the title for this banner.

See also: use_markup.

Added in version 1.3.

Parameters:

title – the title

set_use_markup(use_markup: bool) → None#

Sets whether to use Pango markup for the banner title.

See also parse_markup.

Added in version 1.3.

Parameters:

use_markup – whether to use markup

Properties#

class Banner
props.button_label: str#

The type of the None singleton.

Added in version 1.3.

props.revealed: bool#

The type of the None singleton.

Added in version 1.3.

props.title: str#

The type of the None singleton.

Added in version 1.3.

props.use_markup: bool#

The type of the None singleton.

Added in version 1.3.

Signals#

class Banner.signals
button_clicked() → None#

The type of the None singleton.

Added in version 1.3.

On this page
  • CSS nodes
  • Constructors
    • Banner.new()
  • Methods
    • Banner.get_button_label()
    • Banner.get_revealed()
    • Banner.get_title()
    • Banner.get_use_markup()
    • Banner.set_button_label()
    • Banner.set_revealed()
    • Banner.set_title()
    • Banner.set_use_markup()
  • Properties
    • Banner.props.button_label
    • Banner.props.revealed
    • Banner.props.title
    • Banner.props.use_markup
  • Signals
    • Banner.signals.button_clicked()

This Page

  • Show Source

Created using Sphinx 8.2.3.

General Index

Built with the PyData Sphinx Theme 0.16.1.