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.
26 void gq_gtk_container_add(GtkWidget *container, GtkWidget *widget)
28 if (GTK_IS_BUTTON(container))
30 gtk_button_set_child(GTK_BUTTON(container), widget);
32 else if (GTK_IS_BUTTON_BOX(container))
34 gtk_box_set_child(GTK_BUTTON_BOX(container), widget);
36 else if (GTK_IS_EXPANDER(container))
38 gtk_expander_set_child(GTK_EXPANDER(container), widget);
40 else if (GTK_IS_FRAME(container))
42 gtk_frame_set_child(GTK_FRAME(container), widget);
44 else if (GTK_IS_MENU_ITEM(container))
46 gtk_frame_set_child(container, widget); /* @FIXME GTK4 menu */
48 else if (GTK_IS_POPOVER(container))
50 gtk_popover_set_child(GTK_POPOVER(container), widget);
52 else if (GTK_IS_TOGGLE_BUTTON(container))
54 gtk_toggle_button_set_child(GTK_TOGGLE_BUTTON(container), widget);
56 else if (GTK_IS_TOOLBAR(container))
58 gtk_toolbar_set_child(GTK_TOOLBAR(container), widget);
60 else if (GTK_IS_VIEWPORT(container))
62 gtk_viewport_set_child(GTK_VIEWPORT(container), widget);
64 else if (GTK_IS_WINDOW(container))
66 gtk_window_set_child(GTK_WINDOW(container), widget);
74 void gq_gtk_container_add(GtkWidget *container, GtkWidget *widget)
76 gtk_container_add(reinterpret_cast<GtkContainer *>(container), widget);
79 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */