Re: ScrolledWindow and Layout
- From: Bartek Kostrzewa <bartek runbox com>
- To: gtkmm-list gnome org
- Subject: Re: ScrolledWindow and Layout
- Date: Fri, 23 Sep 2005 23:12:43 +0100
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;
v_scroller->set_value(m_GearsScene.get_width() );
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]