How to modify textview default vertical scrollbar position



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]