How to modify textview default vertical scrollbar position
- From: "Mario Segura" <masegurita gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: How to modify textview default vertical scrollbar position
- Date: Sat, 29 Apr 2006 19:01:32 -0400
Hi,
I use a textview widget and I insert text using its buffer. The method I use is "insert_at_cursor".
I will like to modify the position of the vertical scrollbar, because
if i write several lines (more than the ones the window can display)
the vertical scrollbar appear but is fixed in the upper position while
the text is inserted at the button of the buffer, so it isn't displayed.
The contengency solution I did was to set the value of the vertical
scrollbar (to the bottom) everytime i write a new line, but i think
isn't the right way to do it.
Any idea how to fix the vertical scrollbar in the bottom instead of the top position?
Thanks,
---Code
string line = "ANYTHING \n";
consolabuffer->insert_at_cursor(line);
//Vertical scrollbar adjustment. Contengency solution ***********
Gtk::Adjustment *ajustev;
ajustev = consolaventana.get_vadjustment();
ajustev->set_value(ajustev->get_upper());
---End
--Variables
Gtk::TextView consolaview;
Glib::RefPtr<Gtk::TextBuffer> consolabuffer;
--End of variables
--
Mario Segura S.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]