Re: ScrolledWindow and Layout



Bartek Kostrzewa wrote:
> Rose Cumming wrote:
> 
>>I'd like to have a vertical scroll bar that can scroll a Gtk::Layout
>>that can potentially be larger than the screen.
>>
>>should I call:
>>
>>m_ScrolledWindow.set_vadjustment(*m_Layout.get_vadjustment());
>>
>>or
>>
>>m_Layout.set_vadjustment(*m_Scrolled.get_vadjustment());
>>
>>I tried both, they did not seem to work.
>>
>>Can anyone tell me what's wrong in the attached code?
>>
>>_________________________________________________________________
> 
> 
> 
> You don't need any of the two, the scrolledwindow has vadjustment and
> hadjustments automatically
> 
> get_adjustment is used as follows
> 
> Gtk::Adjustment * v_scroller;
> v_scroller = m_ScrollerWindow.get_vadjustment;

oops, should be m_ScrolledWindow.get_vadjustment() ... I've typed too
much code today already :)

> 
> v_scroller->set_value(m_GearsScene.get_width() );

this should of course be m_GearsScene.get_height() ...  :))

> 
> for instance... the functions exist in order to allow interaction... or
> maybe setting multiple widgets with the same adjustment e.g. a
> spinbutton and a scrollbar or so..
> 
> when gearsscene becomes too big the scrolledwindow should make the
> scrollbar appear automatically (since you've set it to the automatic policy)
> 
> -Bartek
> _______________________________________________
> 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]