Re: Adding a horizontal scrollbar to a TreeView



Hello.

You need to create a  Gtk::ScrolledWindow and then pack the treeview inside:


Gtk::ScrolledWindow m_scroll;
...
// Here you set the policy you want for the horizontal and vertical scrollbars
m_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_scroll.add(m_siteTreeView);
...
// Add the scrollwindow with it's tree to the container
pack_start(m_scroll);



Regards:
Juan Ángel Moreno Fernández


Andreas Volz escribió:
Hello,

I try to add a horizontal scrollbar to a TreeView. It should only
display if the space is not sufficient. I tried it with:

  Gtk::TreeView m_siteTreeView;
...
  Gtk::Adjustment hadjustment (0, 0, 100);
  m_siteTreeView.set_hadjustment (hadjustment);
//Add Tree model to container
  pack_start (m_siteTreeView);
...

But it doesn't work. I see no scroll bar. Any ideas how to do it?

regards
Anreas
_______________________________________________
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]