Re: Programmatically setting scroll position of ScrolledWindow



As far as I remember you need to set the adjustment first (during the
construction stage, for instance), then, each time you modify the
adjustment, the scrollbars should react accordingly.

-B.

jody wrote:
> [Sorry accidentally hit the 'Send' Button to early
> Hi
> I have a Gtk::ScrolledWindow which is associated with two Gtk::Adjustments:
> 
> class test :  public Gtk::Window {
> public:
>    Gtk::Adjustment m_adjh;
>    Gtk::Adjustment m_adjv;
>    Gtk::ScrolledWindow m_scrW;
> 
>   ....
> };
> 
> 
> test::test()
> :      m_adjh(50, 0, 100),
>       m_adjv(50, 0, 100),
>       m_scrW(m_adjh, m_adjv) {
> ....
> 
> }
> 
> Now i would like to set the 'scrollage' programmatically':
> 
> void test::setView(int iH, int iV) {
>        m_adjh.set_value(iH);
>        m_adjv.set_value(iV);
>        m_scrW.set_vadjustment(m_adjh, m_adjv);
> 
>        repaintEverything();
> }
> 
> But this does not seem to work.
> Can anybody tell me how to do this?
> Thank You
>    Jody
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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