Re: visibility problems



On Fri, 2003-09-19 at 15:43, Matthias Clasen wrote:
> I met a minor annoyance with the action-based menus. The constructed
> menus do regularly contain invisible items (unused tearoff menu items,
> proxies of actions whose visible property is set to FALSE, or smart
> separators which have gone invisible). Therefore code like the following
> 
>  gtk_ui_manager_add_ui_from_file (ui, "ui.xml", NULL);
>  gtk_box_pack_start (GTK_BOX (vbox),
> 		      gtk_ui_manager_get_widget (merge, "/menubar"),
> 		      FALSE, FALSE, 0);
> 
>  gtk_container_add (GTK_CONTAINER (window), vbox);
>  gtk_widget_show_all (window);
> 
> doesn't quite work as intended: It makes all the invisible menu items
> visible. 
> 
> I see two options to improve the situation:
> 
> a) Make all constructed menuitems compound children of their menus. This
> should make gtk_widget_show_all() keep out of the constructed hierarchy,
> but also prevents the use of gtk_container_foreach() on the constructed
> menus.
> 
> b) Document this trap and live with it.

I don't like leaving this trap. Reusing the compound-child mechanism
seems a little peculiar to me. Might it be best to simply add new
API:
 
 gtk_menu_item_set_no_show_all()

and implement a custom show_all for gtkmenushell to handle that?

(We could make that gtk_widget_set_no_show_all(), but then custom 
show_all implementations wouldn't get it right, so it wouldn't really
work universally.)

Regards,
  					Owen





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