gtk_scrolled_window doesn't scroll when used with viewport



Hi!
I want to have a scroll window, which contains a vbox.
This vbox will later on be added with a list of check
buttons, dynamically. 

<snip>
GtkWidget *btn_list_vbox;

ui_create_dialog()
{
  ...create the dialog and few other widgets...

    /* scrolled window */
    scrolled_window = gtk_scrolled_window_new(NULL,
NULL);
   
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
                                   GTK_POLICY_AUTOMATIC,
                                   GTK_POLICY_AUTOMATIC);
    /*vbox that contains the list of check button*/
    btn_list_vbox = gtk_vbox_new(FALSE, 0);
    /* Add with viewport */
   
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
btn_list_vbox);

  ....Add the dialog_scrolled to the dialog...

}

ui_add_buttons()
{
    gint MAX = 0
    ..........calculate MAX and find data ......
    for ( i = 0 ; i < MAX ; i ++){
        /* Find "title" data */
        GtkWidget *checkbutton =
gtk_check_button_new_with_label(title);       
gtk_object_set_user_data(GTK_OBJECT(checkbutton),GINT_TO_POINTER(i));
        gtk_widget_show(checkbutton);
        gtk_box_pack_start(GTK_BOX(btn_list_vbox),
checkbutton, FALSE,
                               FALSE, 0);
    }
}
</snip>

My question is
What is wrong here so that
gtk_scrolled_window_add_with_viewport would NOT scroll
along, even though the focus is moving in the button
list using keyboards??


Thanks a lot for any reply



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