RE: Vala runtime error when inserting child button on Gtk.TextView
- From: Jason Shortt <jasonshortt gmail com>
- To: gtk-list gnome org
- Subject: RE: Vala runtime error when inserting child button on Gtk.TextView
- Date: Fri, 22 Sep 2017 16:51:15 -0500
Hey Guys,
I was able to find a solution to my problem. In Vala, after inserting the child button I re-set the TextIterator to the end position of the TextBuffer. Seems to have solved the issue. Here is the updated code:
//button to show person window:
LinkButton linkButton = new LinkButton();
linkButton.label = "edit";
linkButton.LinkedEntity = person;
linkButton.clicked.connect (this.show_person_window);
//attach the button
TextChildAnchor anchor = bufferResults.create_child_anchor(iter);
textviewResults.add_child_at_anchor(linkButton, anchor);
bufferResults.get_end_iter(out iter); // <---- This Fixes the runtime error.
linkButton.show_all();
Jason
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]