{"action":"created","issue":{"url":"https://api.github.com/repos/cppit/jucipp/issues/105","labels_url":"https://api.github.com/repos/cppit/jucipp/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/cppit/jucipp/issues/105/comments","events_url":"https://api.github.com/repos/cppit/jucipp/issues/105/events","html_url":"https://github.com/cppit/jucipp/issues/105","id":121346404,"number":105,"title":"Question: Reach TextViews from singletons?","user":{"login":"zalox","id":2240543,"avatar_url":"https://avatars.githubusercontent.com/u/2240543?v=3","gravatar_id":"","url":"https://api.github.com/users/zalox","html_url":"https://github.com/zalox","followers_url":"https://api.github.com/users/zalox/followers","following_url":"https://api.github.com/users/zalox/following{/other_user}","gists_url":"https://api.github.com/users/zalox/gists{/gist_id}","starred_url":"https://api.github.com/users/zalox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalox/subscriptions","organizations_url":"https://api.github.com/users/zalox/orgs","repos_url":"https://api.github.com/users/zalox/repos","events_url":"https://api.github.com/users/zalox/events{/privacy}","received_events_url":"https://api.github.com/users/zalox/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cppit/jucipp/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/cppit/jucipp/labels/plugin","name":"plugin","color":"eb6420"},{"url":"https://api.github.com/repos/cppit/jucipp/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-09T21:47:10Z","updated_at":"2015-12-09T23:27:54Z","closed_at":null,"body":"Currently I'm doing it like this:\r\n```c++\r\n// get offset of cursor in textview\r\n      [](){\r\n        auto g_application = g_application_get_default();\r\n        auto gio_application = Glib::wrap(g_application, true);\r\n        auto application = Glib::RefPtr<Application>::cast_static(gio_application);\r\n        if (application) {\r\n          auto view = application->window->notebook.get_current_view();\r\n          if (view != nullptr) {\r\n            return view->get_source_buffer()->get_insert()->get_iter().get_offset();\r\n          }\r\n        }\r\n        return -1;       \r\n      },\r\n```\r\nany better way? @eidheim "},"comment":{"url":"https://api.github.com/repos/cppit/jucipp/issues/comments/163435512","html_url":"https://github.com/cppit/jucipp/issues/105#issuecomment-163435512","issue_url":"https://api.github.com/repos/cppit/jucipp/issues/105","id":163435512,"user":{"login":"eidheim","id":5269318,"avatar_url":"https://avatars.githubusercontent.com/u/5269318?v=3","gravatar_id":"","url":"https://api.github.com/users/eidheim","html_url":"https://github.com/eidheim","followers_url":"https://api.github.com/users/eidheim/followers","following_url":"https://api.github.com/users/eidheim/following{/other_user}","gists_url":"https://api.github.com/users/eidheim/gists{/gist_id}","starred_url":"https://api.github.com/users/eidheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eidheim/subscriptions","organizations_url":"https://api.github.com/users/eidheim/orgs","repos_url":"https://api.github.com/users/eidheim/repos","events_url":"https://api.github.com/users/eidheim/events{/privacy}","received_events_url":"https://api.github.com/users/eidheim/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T23:27:54Z","updated_at":"2015-12-09T23:27:54Z","body":"Also, it will then be easier for me to go through your PR when that day comes:)"}}