Scrollbars and gtk_plug_new



Hi,

I'm working on a Firefox plugin which uses gtk+ from XEmbed protocol.
It works fine, but I've some problems about the scrollbars.

With the same code, in a classic standalone application,
scrollbars are visible, but since I embed the gtk+ code in
the plugin, there's no scrollbar, but mouse scrolling works
fine.

Any idea why my scrollbars are not visible ?

---%<---------

GtkWidget *pWindow;
GtkWidget* pBox;
GtkWidget *pScrollbar;
int i;

//standalone app
//pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);

//plugin
pWindow = gtk_plug_new((GdkNativeWindow)(aWindow->window));
gtk_window_set_default_size(GTK_WINDOW(pWindow), 320, 200);
pScrollbar = gtk_scrolled_window_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(pWindow),pScrollbar);
pBox=gtk_vbox_new(FALSE,5);

gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pScrollbar),
pBox);

gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(pScrollbar),
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
for(i = 1 ; i <= 10 ; ++i) {
        GtkWidget *pLabel;
        char sTexte[10];
        sprintf(sTexte, "Label %d", i);
        pLabel = gtk_label_new(sTexte);
        gtk_box_pack_start(GTK_BOX(pBox), pLabel, FALSE, FALSE, 5);
}

gtk_widget_show_all(pWindow);

---%<---------


--
Paul Rouget

http://www.xulfr.org - Technologies Mozilla
http://blog.sexylizard.org



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