GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Sep 01, 2014 9:07 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Scroll Bars of Gtk::ScrolledWindow are not showing
PostPosted: Sun Dec 16, 2012 2:52 pm 
Offline
GTK+ Geek

Joined: Sun Apr 03, 2011 11:12 am
Posts: 63
Hello everyone, So, here's the Widget Hierarchy of my application

Gtk::Window
---Gtk::TextView
--------Gtk::Fixed
----------Gtk::ScrolledWindow
-------------Gtk::TableView

Scroll bars of Gtk::ScrolledWindow are not showing up.

here's the code
Code:
#include<gtkmm.h>

class FuncModelColumns : public Gtk::TreeModel::ColumnRecord
{
    public:
    FuncModelColumns(){add(m_col);}
    Gtk::TreeModelColumn<Glib::ustring> m_col;
    };

int main(int argc,char *argv[])
{   
    Gtk::Main kit(argc,argv);
    Gtk::Window main_win;
    Gtk::Fixed fixed;
    Gtk::ScrolledWindow scrollwin;
    Gtk::TreeView tree_view;
    Glib::RefPtr<Gtk::ListStore> list_store;
    FuncModelColumns func_model_columns;
    Gtk::TextView txt;
   
    main_win.add(txt);
    scrollwin.set_policy(Gtk::POLICY_ALWAYS,Gtk::POLICY_ALWAYS);   
    list_store = Gtk::ListStore::create(func_model_columns);
    tree_view.set_model(list_store);
    tree_view.append_column("Functions", func_model_columns.m_col);
    scrollwin.add(tree_view);
    scrollwin.set_size_request(181,151);
    fixed.put(scrollwin,100,100);
    txt.add(fixed);
    for(int i =0;i<10;i++)
    {           
           Gtk::TreeModel::Row row = *(list_store->append());
            row[func_model_columns.m_col] = "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL";
            }
        main_win.set_size_request(600,400);
        main_win.show_all_children();
    Gtk::Main::run(main_win);
   
    return 0;
    }


Can anyone of you please tell me a way to show scrollbars


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group