Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,431
    • Issues 1,431
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 247
    • Merge requests 247
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gtkgtk
  • Issues
  • #1663

Closed
Open
Created Feb 09, 2019 by Giuseppe@giuspen

(was ok in Gtk2) text view anchored in text view cannot get cursor inside

Steps to reproduce

  1. Create a text view
  2. Anchor a smaller text view inside
  3. Try to mouse click inside the inner text view, no way while if you build with gtk2 it works
// g++ codebox.cc -o codebox `pkg-config gtkmm-3.0 --cflags --libs`
// g++ codebox.cc -o codebox `pkg-config gtkmm-2.4 --cflags --libs`

#include <iostream>
#include <gtkmm.h>


int main(int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);
    Gtk::Window  window;
    window.set_default_size(450, 450);
    Gtk::TextView textViewBase;
    Glib::RefPtr<Gtk::TextBuffer> rBufferBase = textViewBase.get_buffer();

    Gtk::TextView textViewNested;
    Gtk::ScrolledWindow scrolledWindowNested;
    scrolledWindowNested.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    scrolledWindowNested.add(textViewNested);
    scrolledWindowNested.set_size_request(300, 300);

    Gtk::Entry entryNested;

    rBufferBase->insert(rBufferBase->end(), "Anchored TextView below:\n==>");
    Glib::RefPtr<Gtk::TextChildAnchor> rAnchorTextView = rBufferBase->create_child_anchor(rBufferBase->end());
    rBufferBase->insert(rBufferBase->end(), "<==\nAnchored TextView above^\n\nAnchored Entry below:\n==>");
    Glib::RefPtr<Gtk::TextChildAnchor> rAnchorEntry = rBufferBase->create_child_anchor(rBufferBase->end());
    rBufferBase->insert(rBufferBase->end(), "<==\nAnchored Entry above^\n");

    textViewBase.add_child_at_anchor(scrolledWindowNested, rAnchorTextView);
    scrolledWindowNested.show_all();
    textViewBase.add_child_at_anchor(entryNested, rAnchorEntry);
    entryNested.show_all();

    window.add(textViewBase);
    window.show_all();
    Gtk::Main::run(window);
    return EXIT_SUCCESS;
}
Assignee
Assign to
Time tracking