GtkStack, builder and hidden objects

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GtkStack, builder and hidden objects

Gtk+ - General mailing list
Hi all.

I'm using glade to lay out my UIs. I've just noticed after porting some things that used GtkNotebook to GtkStack that objects that I've set as *not* visible ( in glade, select the object, go to the 'common' page, go to 'widget flags' and de-select 'Visible' ) are in fact visible. It seems like GtkStack is calling 'show all' on the widget tree.

Is this intended behaviour? I would expect my 'Visible' flag to be honoured, though I can see how this would be extra work.

For now, I've hooked up some code to re-hide my hidden widgets when the GtkStack's 'set-focus-child' event fires.

Dan

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: GtkStack, builder and hidden objects

Gtk+ - General mailing list
Hi;

Are you calling gtk_widget_show_all() on the Stack or Notebook, at any point?

If you call show_all() on a container, all children will be marked as visible; you need to use gtk_widget_set_no_show_all() if you don't want this behaviour.

Ciao,
 Emmanuele.

On Tue, 19 Feb 2019 at 12:14, Daniel Kasak via gtk-list <[hidden email]> wrote:
Hi all.

I'm using glade to lay out my UIs. I've just noticed after porting some things that used GtkNotebook to GtkStack that objects that I've set as *not* visible ( in glade, select the object, go to the 'common' page, go to 'widget flags' and de-select 'Visible' ) are in fact visible. It seems like GtkStack is calling 'show all' on the widget tree.

Is this intended behaviour? I would expect my 'Visible' flag to be honoured, though I can see how this would be extra work.

For now, I've hooked up some code to re-hide my hidden widgets when the GtkStack's 'set-focus-child' event fires.

Dan
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


--

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|

Re: GtkStack, builder and hidden objects

Gtk+ - General mailing list
Hi Emmanuele. Thanks for the response.

No, I checked for that ... the only thing like it is when I construct the stack *switcher*:

    $self->{main_stack} = $self->{builder}->get_object( "main_stack" );
    $self->{main_stack_switcher} = Gtk3::StackSwitcher->new();
    $self->{main_stack_switcher}->set_stack( $self->{main_stack} );
    $self->{builder}->get_object( 'HeaderBar' )->pack_end( $self->{main_stack_switcher} );
    $self->{main_stack_switcher}->show;

 ... which I do in code because there are other things that are packed into the header bar by code.

Dan

On Tue, Feb 19, 2019 at 11:22 PM Emmanuele Bassi <[hidden email]> wrote:
Hi;

Are you calling gtk_widget_show_all() on the Stack or Notebook, at any point?

If you call show_all() on a container, all children will be marked as visible; you need to use gtk_widget_set_no_show_all() if you don't want this behaviour.

Ciao,
 Emmanuele.

On Tue, 19 Feb 2019 at 12:14, Daniel Kasak via gtk-list <[hidden email]> wrote:
Hi all.

I'm using glade to lay out my UIs. I've just noticed after porting some things that used GtkNotebook to GtkStack that objects that I've set as *not* visible ( in glade, select the object, go to the 'common' page, go to 'widget flags' and de-select 'Visible' ) are in fact visible. It seems like GtkStack is calling 'show all' on the widget tree.

Is this intended behaviour? I would expect my 'Visible' flag to be honoured, though I can see how this would be extra work.

For now, I've hooked up some code to re-hide my hidden widgets when the GtkStack's 'set-focus-child' event fires.

Dan
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


--

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list