gtkmm: New API in gtkmm 3.10

gtkmm 3.13.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

New API in gtkmm 3.10

Member Gdk::Cursor::create (const Glib::RefPtr< Display >& display, const ::Cairo::RefPtr< ::Cairo::Surface >& surface, double x, double y)
  Parameters

    display | The Gdk::Display for which the cursor will be created.
    surface | The cairo image surface containing the cursor pixel data.
    x | The horizontal offset of the “hotspot” of the cursor.
    y | The vertical offset of the “hotspot” of the cursor.

  Returns
    A new Gdk::Cursor.
Member Gdk::Cursor::get_surface (double& x_hot, double& y_hot)
  Parameters

    x_hot | Location to store the hotspot x position, or `0`.
    y_hot | Location to store the hotspot y position, or `0`.

  Returns
    A #cairo_surface_t representing cursor, or `0`.
Member Gdk::Cursor::get_surface (double& x_hot, double& y_hot) const
  Parameters

    x_hot | Location to store the hotspot x position, or `0`.
    y_hot | Location to store the hotspot y position, or `0`.

  Returns
    A #cairo_surface_t representing cursor, or `0`.
Member Gdk::Device::get_position (double& x, double& y) const
Member Gdk::Device::get_position (Glib::RefPtr< Screen >& screen, double& x, double& y) const
Member Gdk::Screen::get_monitor_scale_factor (int monitor_num)
  Parameters

    monitor_num | Number of the monitor, between 0 and gdk_screen_get_n_monitors (screen).

  Returns
    The scale factor.
Member Gdk::Window::create_similar_image_surface (Cairo::Format format, int width, int height, int scale)
  Parameters

    format | The format for the new surface.
    width | Width of the new surface.
    height | Height of the new surface.
    scale | The scale of the new surface, or 0 to use same as window.

  Returns
    A pointer to the newly allocated surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.
Member Gdk::Window::get_device_position (const Glib::RefPtr< const Device >& device, double& x, double& y, ModifierType& mask) const
  Parameters

    device | Pointer Gdk::Device to query to.
    x | Return location for the X coordinate of device, or `0`.
    y | Return location for the Y coordinate of device, or `0`.
    mask | Return location for the modifier mask, or `0`.

  Returns
    The window underneath device (as with Gdk::Device::get_window_at_position()), or `0` if the window is not known to GDK.
Member Gdk::Window::get_scale_factor () const
  Returns
    The scale factor.
Member Gdk::Window::set_opaque_region (const ::Cairo::RefPtr< const ::Cairo::Region >& region)
  Parameters

    region | A region.

Member Gtk::Box::get_baseline_position () const
  Returns
    The baseline position.
Member Gtk::Box::set_baseline_position (BaselinePosition position)
  Parameters

    position | A Gtk::BaselinePosition.

Member Gtk::Builder::get_application ()
  Returns
    The application being used by the builder, or `0`.
Member Gtk::Builder::get_application () const
  Returns
    The application being used by the builder, or `0`.
Member Gtk::Builder::set_application (const Glib::RefPtr< Application >& application)
  Parameters

    application | A Gtk::Application.

Member Gtk::Button::set_image_from_icon_name (const Glib::ustring& icon_name, IconSize size=ICON_SIZE_BUTTON)
Member Gtk::Entry::get_tabs () const
  Returns
    The tabstops, or `0` if none was set.
Member Gtk::Entry::set_tabs (const Pango::TabArray& tabs)
  Parameters

    tabs | A Pango::TabArray.

Member Gtk::FileChooser::get_current_name () const
  Returns
    The raw text from the file chooser’s “Name” entry. Free this with Glib::free(). Note that this string is not a full pathname or URI; it is whatever the contents of the entry are. Note also that this string is in UTF-8 encoding, which is not necessarily the system’s encoding for filenames.
Member Gtk::Grid::get_baseline_row () const
  Returns
    The row index defining the global baseline.
Member Gtk::Grid::get_row_baseline_position (int row) const
  Parameters

    row | A row index.

  Returns
    The baseline position of row.
Member Gtk::Grid::remove_column (int position)
  Parameters

    position | The position of the column to remove.

Member Gtk::Grid::remove_row (int position)
  Parameters

    position | The position of the row to remove.

Member Gtk::Grid::set_baseline_row (int row)
  Parameters

    row | The row index.

  Returns
    The row index defining the global baseline.
Member Gtk::Grid::set_row_baseline_position (int row, BaselinePosition pos)
  Parameters

    row | A row index.
    pos | A Gtk::BaselinePosition.

Class Gtk::HeaderBar
Member Gtk::HeaderBar::get_custom_title ()
  Returns
    The custom title widget of the header, or `0` if none has been set explicitly.
Member Gtk::HeaderBar::get_custom_title () const
  Returns
    The custom title widget of the header, or `0` if none has been set explicitly.
Member Gtk::HeaderBar::get_show_close_button () const
  Returns
    `true` if the decorations are shown.
Member Gtk::HeaderBar::get_subtitle () const
  Returns
    The subtitle of the header, or `0` if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed.
Member Gtk::HeaderBar::get_title () const
  Returns
    The title of the header, or `0` if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed.
Member Gtk::HeaderBar::pack_end (Gtk::Widget& child)
  Parameters

    child | The Gtk::Widget to be added to bar.

Member Gtk::HeaderBar::pack_start (Gtk::Widget& child)
  Parameters

    child | The Gtk::Widget to be added to bar.

Member Gtk::HeaderBar::set_custom_title (Gtk::Widget& title_widget)
  Parameters

    title_widget | A custom widget to use for a title.

Member Gtk::HeaderBar::set_show_close_button (bool setting=true)
  Parameters

    setting | `true` to show standard widow decorations.

Member Gtk::HeaderBar::set_subtitle (const Glib::ustring& subtitle)
  Parameters

    subtitle | A subtitle, or `0`.

Member Gtk::HeaderBar::set_title (const Glib::ustring& title)
  Parameters

    title | A title, or `0`.

Member Gtk::IconInfo::get_base_scale () const
  Returns
    The base scale.
Member Gtk::IconInfo::load_surface (const Glib::RefPtr< Gdk::Window >& for_window)
  Parameters

    for_window | Gdk::Window to optimize drawing for, or `0`.

  Returns
    The rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use cairo_surface_destroy() to release your reference to the icon.
Member Gtk::IconTheme::choose_icon (const std::vector< Glib::ustring >& icon_names, int size, int scale, IconLookupFlags flags)
  Parameters

    icon_names | `0`-terminated array of icon names to lookup.
    size | Desired icon size.
    scale | Desired scale.
    flags | Flags modifying the behavior of the icon lookup.

  Returns
    A Gtk::IconInfo object containing information about the icon, or `0` if the icon wasn’t found.
Member Gtk::IconTheme::load_icon (const Glib::ustring& icon_name, int size, int scale, IconLookupFlags flags=(IconLookupFlags) 0) const
  Parameters

    icon_name | The name of the icon to lookup.
    size | The desired icon size. The resulting icon may not be exactly this size; see Gtk::IconInfo::load_icon().
    scale | Desired scale.
    flags | Flags modifying the behavior of the icon lookup.

  Returns
    The rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use Glib::object_unref() to release your reference to the icon. `0` if the icon isn’t found.
Member Gtk::IconTheme::load_surface (const Glib::ustring& icon_name, int size, int scale, const Glib::RefPtr< Gdk::Window >& for_window, IconLookupFlags flags=(IconLookupFlags) 0)
  Parameters

    icon_name | The name of the icon to lookup.
    size | The desired icon size. The resulting icon may not be exactly this size; see Gtk::IconInfo::load_icon().
    scale | Desired scale.
    for_window | Gdk::Window to optimize drawing for, or `0`.
    flags | Flags modifying the behavior of the icon lookup.

  Returns
    The rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use cairo_surface_destroy() to release your reference to the icon. `0` if the icon isn’t found.
Member Gtk::IconTheme::lookup_icon (const Glib::ustring& icon_name, int size, int scale, IconLookupFlags flags) const
  Parameters

    icon_name | The name of the icon to lookup.
    size | Desired icon size.
    scale | The desired scale.
    flags | Flags modifying the behavior of the icon lookup.

  Returns
    A Gtk::IconInfo object containing information about the icon, or `0` if the icon wasn’t found.
Member Gtk::IconTheme::lookup_icon (const Glib::RefPtr< const Gio::Icon >& icon, int size, int scale, IconLookupFlags flags) const
  Parameters

    icon | The Icon to look up.
    size | Desired icon size.
    scale | The desired scale.
    flags | Flags modifying the behavior of the icon lookup.

  Returns
    A Gtk::IconInfo containing information about the icon, or `0` if the icon wasn’t found. Unref with Glib::object_unref().
Member Gtk::Image::set (const ::Cairo::RefPtr< ::Cairo::Surface >& surface)
  Parameters

    surface | A cairo_surface_t.

Member Gtk::InfoBar::get_show_close_button () const
  Returns
    `true` if the widget displays standard close button.
Member Gtk::InfoBar::set_show_close_button (bool setting=true)
  Parameters

    setting | `true` to include a close button.

Member Gtk::Label::get_lines () const
  Returns
    The number of lines.
Member Gtk::Label::set_lines (int lines)
  Parameters

    lines | The desired number of lines, or -1.

Class Gtk::ListBox
Member Gtk::ListBox::append (Widget& child)
  Parameters

    child | The Gtk::Widget to add.

Member Gtk::ListBox::drag_highlight_row (ListBoxRow& row)
  Parameters

    row | A Gtk::ListBoxRow.

Member Gtk::ListBox::drag_unhighlight_row ()
Member Gtk::ListBox::get_activate_on_single_click () const
  Returns
    `true` if rows are activated on single click, `false` otherwise.
Member Gtk::ListBox::get_adjustment ()
  Returns
    The adjustment.
Member Gtk::ListBox::get_adjustment () const
  Returns
    The adjustment.
Member Gtk::ListBox::get_row_at_index (int index)
  Parameters

    index | The index of the row.

  Returns
    The child Gtk::Widget.
Member Gtk::ListBox::get_row_at_index (int index) const
  Parameters

    index | The index of the row.

  Returns
    The child Gtk::Widget.
Member Gtk::ListBox::get_row_at_y (int y)
  Parameters

    y | Position.

  Returns
    The row.
Member Gtk::ListBox::get_row_at_y (int y) const
  Parameters

    y | Position.

  Returns
    The row.
Member Gtk::ListBox::get_selected_row ()
  Returns
    The selected Gtk::Widget.
Member Gtk::ListBox::get_selected_row () const
  Returns
    The selected Gtk::Widget.
Member Gtk::ListBox::get_selection_mode () const
  Returns
    A Gtk::SelectionMode.
Member Gtk::ListBox::insert (Widget& child, int position)
  Parameters

    child | The Gtk::Widget to add.
    position | The position to insert child in.

Member Gtk::ListBox::invalidate_filter ()
Member Gtk::ListBox::invalidate_headers ()
Member Gtk::ListBox::invalidate_sort ()
Member Gtk::ListBox::prepend (Widget& child)
  Parameters

    child | The Gtk::Widget to add.

Member Gtk::ListBox::select_row (ListBoxRow& row)
  Parameters

    row | The row to select or `0`.

Member Gtk::ListBox::set_activate_on_single_click (bool single=true)
  Parameters

    single | A boolean.

Member Gtk::ListBox::set_adjustment (const Glib::RefPtr< Adjustment >& adjustment)
  Parameters

    adjustment | The adjustment, or `0`.

Member Gtk::ListBox::set_filter_func (const SlotFilter& slot)
Member Gtk::ListBox::set_header_func (const SlotUpdateHeader& slot)
Member Gtk::ListBox::set_placeholder (Widget& placeholder)
  Parameters

    placeholder | A Gtk::Widget or `0`.

Member Gtk::ListBox::set_selection_mode (SelectionMode mode)
  Parameters

    mode | The Gtk::SelectionMode.

Member Gtk::ListBox::set_sort_func (const SlotSort& slot)
Member Gtk::ListBox::signal_row_activated ()
  Parameters

    row | The activated row.

Member Gtk::ListBox::signal_row_selected ()
  Parameters

    row | The selected row.

Member Gtk::ListBox::SlotFilter
Member Gtk::ListBox::SlotSort
Member Gtk::ListBox::SlotUpdateHeader
Member Gtk::ListBox::unselect_row ()
Member Gtk::ListBox::unset_filter_func ()
Member Gtk::ListBox::unset_header_func ()
Member Gtk::ListBox::unset_placeholder ()
Member Gtk::ListBox::unset_sort_func ()
Class Gtk::ListBoxRow
Member Gtk::ListBoxRow::changed ()
Member Gtk::ListBoxRow::get_header ()
  Returns
    The current header, or `0` if none.
Member Gtk::ListBoxRow::get_header () const
  Returns
    The current header, or `0` if none.
Member Gtk::ListBoxRow::get_index () const
  Returns
    The index of the row, or -1 if the row is not in a listbox.
Member Gtk::ListBoxRow::set_header (Widget& header)
  Parameters

    header | The header.

Member Gtk::ListBoxRow::unset_header ()
Member Gtk::Menu::Menu (const Glib::RefPtr< Gio::MenuModel >& model)
Member Gtk::MenuBar::MenuBar (const Glib::RefPtr< Gio::MenuModel >& model)
Class Gtk::PlacesSidebar
Member Gtk::PlacesSidebar::add_shortcut (const Glib::RefPtr< Gio::File >& location)
  Parameters

    location | Location to add as an application-specific shortcut.

Member Gtk::PlacesSidebar::get_location () const
  Returns
    A GFile with the selected location, or #`0` if nothing is visually selected.
Member Gtk::PlacesSidebar::get_nth_bookmark (int n) const
  Parameters

    n | Index of the bookmark to query.

  Returns
    The bookmark specified by the index n, or #`0` if no such index exist. Note that the indices start at 0, even though the file chooser starts them with the keyboard shortcut “Alt-1”.
Member Gtk::PlacesSidebar::get_open_flags () const
  Returns
    The Gtk::PlacesOpenFlags of sidebar.
Member Gtk::PlacesSidebar::get_show_connect_to_server () const
  Returns
    `true` if the sidebar will display a “Connect to Server” item.
Member Gtk::PlacesSidebar::get_show_desktop () const
  Returns
    `true` if the sidebar will display a builtin shortcut to the desktop folder.
Member Gtk::PlacesSidebar::list_shortcuts () const
  Returns
    A SList of File of the locations that have been added as application-specific shortcuts with add_shortcut(). To free this list, you can use
Member Gtk::PlacesSidebar::remove_shortcut (const Glib::RefPtr< Gio::File >& location)
  Parameters

    location | Location to remove.

Member Gtk::PlacesSidebar::set_location (const Glib::RefPtr< const Gio::File >& location)
  Parameters

    location | Location to select, or #`0` for no current path.

Member Gtk::PlacesSidebar::set_open_flags (PlacesOpenFlags flags=PLACES_OPEN_NORMAL)
  Parameters

    flags | Bitmask of modes in which the calling application can open locations.

Member Gtk::PlacesSidebar::set_show_connect_to_server (bool show_connect_to_server=true)
  Parameters

    show_connect_to_server | Whether to show an item for the Connect to Server command.

Member Gtk::PlacesSidebar::set_show_desktop (bool show_desktop=true)
  Parameters

    show_desktop | Whether to show an item for the Desktop folder.

Member Gtk::PlacesSidebar::signal_drag_action_ask ()
  Parameters

    actions | Possible drag actions that need to be asked for.

  Returns
    The final drag action that the sidebar should pass to the drag side of the drag-and-drop operation.
Member Gtk::PlacesSidebar::signal_drag_action_requested ()
  Parameters

    context | Gdk::DragContext with information about the drag operation.
    dest_file | File with the tentative location that is being hovered for a drop.
    source_file_list | List of File that are being dragged.

  Returns
    The drag action to use, for example, Gdk::ACTION_COPY or Gdk::ACTION_MOVE, or 0 if no action is allowed here (i.e. drops are not allowed in the specified dest_file).
Member Gtk::PlacesSidebar::signal_drag_perform_drop ()
  Parameters

    dest_file | Destination File.
    source_file_list | List of File that got dropped.
    action | Drop action to perform.

Member Gtk::PlacesSidebar::signal_open_location ()
  Parameters

    location | File to which the caller should switch.
    open_flags | A single value from Gtk::PlacesOpenFlags specifying how the location should be opened.

Member Gtk::PlacesSidebar::signal_populate_popup ()
  Parameters

    menu | A Gtk::Menu.
    selected_item | File with the item to which the menu should refer, or #`0` in the case of a selected_volume.
    selected_volume | Volume if the selected item is a volume, or #`0` if it is a file.

Member Gtk::PlacesSidebar::signal_show_connect_to_server ()
Member Gtk::PlacesSidebar::signal_show_error_message ()
  Parameters

    primary | Primary message with a summary of the error to show.
    secondary | Secondary message with details of the error to show.

Member Gtk::RadioToolButton::reset_group ()
Class Gtk::Revealer
Member Gtk::Revealer::get_child_revealed () const
  Returns
    `true` if the child is fully revealed.
Member Gtk::Revealer::get_reveal_child () const
  Returns
    `true` if the child is revealed.
Member Gtk::Revealer::get_transition_duration () const
  Returns
    The transition duration.
Member Gtk::Revealer::get_transition_type () const
  Returns
    The current transition type of revealer.
Member Gtk::Revealer::set_reveal_child (bool reveal_child=true)
  Parameters

    reveal_child | `true` to reveal the child.

Member Gtk::Revealer::set_transition_duration (guint duration)
  Parameters

    duration | The new duration, in milliseconds.

Member Gtk::Revealer::set_transition_type (RevealerTransitionType transition)
  Parameters

    transition | The new transition type.

Class Gtk::SearchBar
Member Gtk::SearchBar::connect_entry (Gtk::Entry& entry)
  Parameters

    entry | A Gtk::Entry.

Member Gtk::SearchBar::get_search_mode () const
  Returns
    Whether search mode is toggled on.
Member Gtk::SearchBar::get_show_close_button () const
  Returns
    Whether the close button is shown.
Member Gtk::SearchBar::handle_event (GdkEventKey* event)
  Parameters

    event | A Gdk::Event containing key press events.

  Returns
    Gdk::EVENT_STOP if the key press event resulted in text being entered in the search entry (and revealing the search bar if necessary), Gdk::EVENT_PROPAGATE otherwise.
Member Gtk::SearchBar::set_search_mode (bool search_mode=true)
  Parameters

    search_mode | The new state of the search mode.

Member Gtk::SearchBar::set_show_close_button (bool visible=true)
  Parameters

    visible | Whether the close button will be shown or not.

Class Gtk::Stack
Member Gtk::Stack::add (Widget& child, const Glib::ustring& name)
  Parameters

    child | The widget to add.
    name | The name for child.

Member Gtk::Stack::add (Widget& child, const Glib::ustring& name, const Glib::ustring& title)
  Parameters

    child | The widget to add.
    name | The name for child.
    title | A human-readable title for child.

Member Gtk::Stack::get_homogeneous () const
  Returns
    Whether stack is homogeneous.
Member Gtk::Stack::get_transition_duration () const
  Returns
    The transition duration.
Member Gtk::Stack::get_transition_type () const
  Returns
    The current transition type of stack.
Member Gtk::Stack::get_transition_type ()
Member Gtk::Stack::get_visible_child () const
  Returns
    The visible child of the Gtk::Stack.
Member Gtk::Stack::get_visible_child ()
  Returns
    The visible child of the Gtk::Stack.
Member Gtk::Stack::get_visible_child_name () const
  Returns
    The name of the visible child of the Gtk::Stack.
Member Gtk::Stack::set_homogeneous (bool homogeneous=true)
  Parameters

    homogeneous | `true` to make stack homogeneous.

Member Gtk::Stack::set_transition_duration (guint duration)
  Parameters

    duration | The new duration, in milliseconds.

Member Gtk::Stack::set_transition_type (StackTransitionType transition)
  Parameters

    transition | The new transition type.

Member Gtk::Stack::set_visible_child (Widget& child)
  Parameters

    child | A child of stack.

Member Gtk::Stack::set_visible_child (const Glib::ustring& name)
  Parameters

    name | The name of the child to make visible.

Member Gtk::Stack::set_visible_child (const Glib::ustring& name, StackTransitionType transition)
  Parameters

    name | The name of the child to make visible.
    transition | The transition type to use.

Class Gtk::StackSwitcher
Member Gtk::StackSwitcher::get_stack () const
  Returns
    The stack, or `0` if none has been set explicitly.
Member Gtk::StackSwitcher::get_stack ()
  Returns
    The stack, or `0` if none has been set explicitly.
Member Gtk::StackSwitcher::set_stack (Stack& stack)
  Parameters

    stack | A Gtk::Stack.

Member Gtk::StyleContext::set_scale (int scale)
  Parameters

    scale | Scale.

Member Gtk::Widget::drag_begin (const Glib::RefPtr< TargetList >& targets, Gdk::DragAction actions, int button, GdkEvent* event, int x, int y)
  Parameters

    widget | The source widget.
    targets | The targets (data formats) in which the source can provide the data.
    actions | A bitmask of the allowed drag actions for this drag.
    button | The button the user clicked to start the drag.
    event | The event that triggered the start of the drag.
    x | The initial x coordinate to start dragging from, in the coordinate space of widget. If -1 is passed, the coordinates are retrieved from event or the current pointer position.
    y | The initial y coordinate to start dragging from, in the coordinate space of widget. If -1 is passed, the coordinates are retrieved from event or the current pointer position.

  Returns
    The context for this drag.
Member Gtk::Widget::get_allocated_baseline () const
  Returns
    The baseline of the widget, or -1 if none.
Member Gtk::Widget::get_preferred_height_for_width (int width, int& minimum_height, int& natural_height, int& minimum_baseline, int& natural_baseline) const
  Parameters

    width | The width which is available for allocation, or -1 if none.
    minimum_height | Location for storing the minimum height, or `0`.
    natural_height | Location for storing the natural height, or `0`.
    minimum_baseline | Location for storing the baseline for the minimum height, or `0`.
    natural_baseline | Location for storing the baseline for the natural height, or `0`.

Member Gtk::Widget::get_scale_factor () const
  Returns
    The scale factor for widget.
Member Gtk::Widget::get_valign_with_baseline () const
  Returns
    The vertical alignment of widget.
Member Gtk::Widget::remove_action_group (const Glib::ustring& name)
Member Gtk::Widget::size_allocate (const Allocation& allocation, int baseline)
  Parameters

    allocation | Position and size to be allocated to widget.
    baseline | The baseline of the child, or -1.

Member Gtk::Window::close ()
Member Gtk::Window::set_titlebar (Widget& titlebar)
  Parameters

    titlebar | The widget to use as titlebar.