Re: Scrolled Window, Table , TextView and Label



Am Mittwoch, den 24.01.2007, 10:46 +0300 schrieb Andrew E. Makeev:
> В Срд, 24/01/2007 в 03:24 +0100, Tomasz Cich - OP пишет:
> > Hi!
> > I got one problem with putting Table with TextView and Label to
> > ScrolledWindow.
> > Everything is fine when i put treeview inside ScolledWindow, but if i
> > put it to Table together with Label, then is a problem with scrolling.
> >  
> > It is something like:
> > ---------------------------------------- 
> > |L  |                               |S|
> > |A |     TextView             |C|
> > |B |                               |R|
> > |E |                               |O|
> > |L |                               |L|
> > |   |                               |L|
> > ---------------------------------------
> >            SCROLL
> > --------------------------------------
> >  
> > Label represents line counting.
> >  
> > I dont know which signal, or something like that, should i use to make
> > TextView autoscroll.
> > When i move my cursor in TextView, scroll doesn't move.

Don't use Gtk::ScrolledWindow but put Gtk::HScrollbar and
Gtk::VScrollbar manually into your table.  Then call
Gtk::Widget::set_scroll_adjustments() on the text view.

http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Widget.html#2f4ed325833a193177e870ac55e6922f

However, then your labels won't scroll.  I heard that gedit uses
Gtk::TextView::set_border_window_size() to make some room for showing
line numbers, and then draws the line numbers there.  This doesn't seem
to be trivial to achieve, though.

--Daniel





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