[Vala] Newbie help requested for scrolling a TextView




Hi,

I am C programmer trying to  pick up Vala fundamentals.

I am stuck in a small project to programmatically scroll a Gtk.TextView widget embedded in a Gtk.ScrolledWindow.

The scrollable view widget displays a text file read at run time.

I would like to the view's current contents to be controlled with a vertical scale: when v_scale slider is 0, the view shows the beginning of the file, and when v_scale slider is close to 100, the view shows the last few characters/lines in the file.

Despite a lot of effort to write an event handler, I still cannot get the scale to tell the view to scroll. I have tried scrolling with the scroll_to_iter() method, but the iterator always lands me at the top of the file, whereas I want the view to move south.

Can somebody please tip me how to control the view's position with the vertical scale in Vala ?

--
Thanks & Regards,
Manish Jain


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]