Hoogle Search

Within LTS Haskell 24.42 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. type PopoverClosedCallback = IO ()

    gi-gtk4 GI.Gtk.Objects.Popover

    Emitted when the popover is closed.

  2. module GI.Gtk.Objects.PopoverMenu

    GtkPopoverMenu is a subclass of GtkPopover that implements menu behavior. GtkPopoverMenu treats its children like menus and allows switching between them. It can open submenus as traditional, nested submenus, or in a more touch-friendly sliding fashion. The property PopoverMenu:flags controls this appearance. GtkPopoverMenu is meant to be used primarily with menu models, using popoverMenuNewFromModel. If you need to put other widgets such as a GtkSpinButton or a GtkSwitch into a popover, you can use popoverMenuAddChild. For more dialog-like behavior, use a plain GtkPopover.

    Menu models

    The XML format understood by GtkBuilder for GMenuModel consists of a toplevel <menu> element, which contains one or more <item> elements. Each <item> element contains <attribute> and <link> elements with a mandatory name attribute. <link> elements have the same content model as <menu>. Instead of <link name="submenu"> or <link name="section">, you can use <submenu> or <section> elements.

    xml code

    <menu id='app-menu'>
    <section>
    <item>
    <attribute name='label' translatable='yes'>_New Window</attribute>
    <attribute name='action'>app.new</attribute>
    </item>
    <item>
    <attribute name='label' translatable='yes'>_About Sunny</attribute>
    <attribute name='action'>app.about</attribute>
    </item>
    <item>
    <attribute name='label' translatable='yes'>_Quit</attribute>
    <attribute name='action'>app.quit</attribute>
    </item>
    </section>
    </menu>
    
    Attribute values can be translated using gettext, like other GtkBuilder content. <attribute> elements can be marked for translation with a translatable="yes" attribute. It is also possible to specify message context and translator comments, using the context and comments attributes. To make use of this, the GtkBuilder must have been given the gettext domain to use. The following attributes are used when constructing menu items:
    • "label": a user-visible string to display
    • "use-markup": whether the text in the menu item includes Pango markup
    • "action": the prefixed name of the action to trigger
    • "target": the parameter to use when activating the action
    • "icon" and "verb-icon": names of icons that may be displayed
    • "submenu-action": name of an action that may be used to track whether a submenu is open
    • "hidden-when": a string used to determine when the item will be hidden. Possible values include "action-disabled", "action-missing", "macos-menubar". This is mainly useful for exported menus, see applicationSetMenubar.
    • "custom": a string used to match against the ID of a custom child added with popoverMenuAddChild, popoverMenuBarAddChild, or in the ui file with <child type="ID">.
    The following attributes are used when constructing sections:
    • "label": a user-visible string to use as section heading
    • "display-hint": a string used to determine special formatting for the section. Possible values include "horizontal-buttons", "circular-buttons" and "inline-buttons". They all indicate that section should be displayed as a horizontal row of buttons.
    • "text-direction": a string used to determine the GtkTextDirection to use when "display-hint" is set to "horizontal-buttons". Possible values include "rtl", "ltr", and "none".
    The following attributes are used when constructing submenus:
    • "label": a user-visible string to display
    • "icon": icon name to display
    Menu items will also show accelerators, which are usually associated with actions via applicationSetAccelsForAction, [methodwidgetClass.add_binding_action] or shortcutControllerAddShortcut.

    CSS Nodes

    GtkPopoverMenu is just a subclass of GtkPopover that adds custom content to it, therefore it has the same CSS nodes. It is one of the cases that add a .menu style class to the main popover node. Menu items have nodes with name button and class .model. If a section display-hint is set, the section gets a node box with class horizontal plus a class with the same text as the display hint. Note that said box may not be the direct ancestor of the item buttons. Thus, for example, to style items in an inline-buttons section, select .inline-buttons button.model. Other things that may be of interest to style in menus include label nodes.

    Accessibility

    GtkPopoverMenu uses the AccessibleRoleMenu role, and its items use the AccessibleRoleMenuItem, AccessibleRoleMenuItemCheckbox or AccessibleRoleMenuItemRadio roles, depending on the action they are connected to.

  3. newtype PopoverMenu

    gi-gtk4 GI.Gtk.Objects.PopoverMenu

    Memory-managed wrapper type.

  4. PopoverMenu :: ManagedPtr PopoverMenu -> PopoverMenu

    gi-gtk4 GI.Gtk.Objects.PopoverMenu

    No documentation available.

  5. module GI.Gtk.Objects.PopoverMenuBar

    GtkPopoverMenuBar presents a horizontal bar of items that pop up popover menus when clicked. The only way to create instances of GtkPopoverMenuBar is from a GMenuModel.

    CSS nodes

    menubar
    ├── item[.active]
    ┊   ╰── popover
    ╰── item
    ╰── popover
    
    GtkPopoverMenuBar has a single CSS node with name menubar, below which each item has its CSS node, and below that the corresponding popover. The item whose popover is currently open gets the .active style class.

    Accessibility

    GtkPopoverMenuBar uses the AccessibleRoleMenuBar role, the menu items use the AccessibleRoleMenuItem role and the menus use the AccessibleRoleMenu role.

  6. newtype PopoverMenuBar

    gi-gtk4 GI.Gtk.Objects.PopoverMenuBar

    Memory-managed wrapper type.

  7. PopoverMenuBar :: ManagedPtr PopoverMenuBar -> PopoverMenuBar

    gi-gtk4 GI.Gtk.Objects.PopoverMenuBar

    No documentation available.

  8. module GI.Gtk.Objects.PrintContext

    A GtkPrintContext encapsulates context information that is required when drawing pages for printing. This includes the cairo context and important parameters like page size and resolution. It also lets you easily create Layout and Context objects that match the font metrics of the cairo surface. GtkPrintContext objects get passed to the PrintOperation::beginPrint, PrintOperation::endPrint, PrintOperation::requestPageSetup and PrintOperation::drawPage signals on the PrintOperation object.

    Using GtkPrintContext in a drawPage callback

    c code

    static void
    draw_page (GtkPrintOperation *operation,
    GtkPrintContext   *context,
    int                page_nr)
    {
    cairo_t *cr;
    PangoLayout *layout;
    PangoFontDescription *desc;
    
    cr = gtk_print_context_get_cairo_context (context);
    
    // Draw a red rectangle, as wide as the paper (inside the margins)
    cairo_set_source_rgb (cr, 1.0, 0, 0);
    cairo_rectangle (cr, 0, 0, gtk_print_context_get_width (context), 50);
    
    cairo_fill (cr);
    
    // Draw some lines
    cairo_move_to (cr, 20, 10);
    cairo_line_to (cr, 40, 20);
    cairo_arc (cr, 60, 60, 20, 0, M_PI);
    cairo_line_to (cr, 80, 20);
    
    cairo_set_source_rgb (cr, 0, 0, 0);
    cairo_set_line_width (cr, 5);
    cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
    cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
    
    cairo_stroke (cr);
    
    // Draw some text
    layout = gtk_print_context_create_pango_layout (context);
    pango_layout_set_text (layout, "Hello World! Printing is easy", -1);
    desc = pango_font_description_from_string ("sans 28");
    pango_layout_set_font_description (layout, desc);
    pango_font_description_free (desc);
    
    cairo_move_to (cr, 30, 20);
    pango_cairo_layout_path (cr, layout);
    
    // Font Outline
    cairo_set_source_rgb (cr, 0.93, 1.0, 0.47);
    cairo_set_line_width (cr, 0.5);
    cairo_stroke_preserve (cr);
    
    // Font Fill
    cairo_set_source_rgb (cr, 0, 0.0, 1.0);
    cairo_fill (cr);
    
    g_object_unref (layout);
    }
    

  9. newtype PrintContext

    gi-gtk4 GI.Gtk.Objects.PrintContext

    Memory-managed wrapper type.

  10. PrintContext :: ManagedPtr PrintContext -> PrintContext

    gi-gtk4 GI.Gtk.Objects.PrintContext

    No documentation available.

Page 887 of many | Previous | Next