Re: [Vala] Newbie help requested for scrolling a TextView



Hi Al,


Tx for replying. As part of my teething struggles, I discovered

what I think was essentially wrong. I was filling up the view

with text += <new line read by Disk Input Stream>. And I think Vala

removes the trailing newline, so essentially my buffer always had

just one line!


Let me see if I can get my code to work now.


There is another woe that afflicts me. I am adding both widgets

(TextView - embedded in ScrolledWindow - and a vertical scale at RHS) to

a grid. At runtime, both textview and scale occupy 50% of the grid's

real-estate. Can I tell the grid to give 75% coverage to the view

and 25% to the scale, or is there some way I can size the widgets

myself from within my code?


Thanks again.

Manish Jain



On 01/25/18 16:11, Al Thomas wrote:
> On Thursday, 25 January 2018, 01:00:05 GMT, Manish Jain <jude obscure yandex com> wrote:

> 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.

Have you tried moving the TextIter with something like:
https://valadoc.org/gtk+-3.0/Gtk.TextIter.set_line.html

It sounds like you want a TextIter instance for your vscale widget that you can then move
about the document and then scroll to it.

It may be your almost there, just missing the last piece of the puzzle!

Regards,

Al



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