Is it possible to use a gtk_layout within a gtk_layout?




Is it possible to add a gtk_layout to a gtk_layout?

I’ve tried and it appears that the second layout receives signals (map, show, etc) but nothing is rendered.

FWIW the gtk_layout seems like the best container for what I’m trying to do. No scrolling is required and
widgets can be placed ad-hoc. I’d like to use the second gtk_layout to provide a simple mechanism to
show / hide a collection of widgets (without having to show / hide them individually).

Using gtk 3.14.13 on CentOS7

The sample code below (for me) doesn’t display the ‘Button’.

Any insight appreciated ...

   -Greg.

---

#include    <gtk/gtk.h>
int main( int argc, char *argv[])
{
    GtkWidget *window;
    GtkWidget *layout1;
    GtkWidget *layout2;
    GtkWidget *button;

    gtk_init( &argc, &argv );

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW(window), 1024, 1024);

    layout1 = gtk_layout_new(NULL, NULL);
    gtk_container_add(GTK_CONTAINER (window), layout1);

    layout2 = gtk_layout_new(NULL, NULL);
    gtk_container_add(GTK_CONTAINER ( layout1 ), layout2);

    button = gtk_button_new_with_label("Button");
    gtk_layout_put(GTK_LAYOUT( layout2 ), button, 150, 50);

    g_signal_connect_swapped(G_OBJECT(window), "destroy",
    G_CALLBACK(gtk_main_quit), NULL);

    gtk_widget_show_all( window );

    gtk_main();

    return 0;
}

--

________________________________

This message and its contents including attachments are intended solely for the original recipient. If you 
are not the intended recipient or have received this message in error, please notify me immediately and 
delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please 
consider the environment before printing this email.


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