2 * Copyright (C) 2008 - 2016 The Geeqie Team
4 * Authors: Vladimir Nadvornik, Laurent Monin
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 void gq_gtk_container_add(GtkWidget *container, GtkWidget *widget)
27 if (GTK_IS_BUTTON(container))
29 gtk_button_set_child(GTK_BUTTON(container), widget);
31 else if (GTK_IS_BUTTON_BOX(container))
33 gtk_box_set_child(GTK_BUTTON_BOX(container), widget);
35 else if (GTK_IS_EXPANDER(container))
37 gtk_expander_set_child(GTK_EXPANDER(container), widget);
39 else if (GTK_IS_FRAME(container))
41 gtk_frame_set_child(GTK_FRAME(container), widget);
43 else if (GTK_IS_MENU_ITEM(container))
45 gtk_frame_set_child(container, widget); /* @FIXME GTK4 menu */
47 else if (GTK_IS_POPOVER(container))
49 gtk_popover_set_child(GTK_POPOVER(container), widget);
51 else if (GTK_IS_TOGGLE_BUTTON(container))
53 gtk_toggle_button_set_child(GTK_TOGGLE_BUTTON(container), widget);
55 else if (GTK_IS_TOOLBAR(container))
57 gtk_toolbar_set_child(GTK_TOOLBAR(container), widget);
59 else if (GTK_IS_VIEWPORT(container))
61 gtk_viewport_set_child(GTK_VIEWPORT(container), widget);
63 else if (GTK_IS_WINDOW(container))
65 gtk_window_set_child(GTK_WINDOW(container), widget);
73 void gq_gtk_container_add(GtkWidget *container, GtkWidget *widget)
75 gtk_container_add(reinterpret_cast<GtkContainer *>(container), widget);
78 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */