* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
-#ifdef G_OS_WIN32
-#include <direct.h> /* for _getcwd() */
-#endif
-
#include "prop-editor.h"
static gchar *backend = "gtk+";
static void
win_style_set_cb (GtkWidget *win)
{
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (win)->vbox), 12);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (win)->vbox), 24);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (win)->action_area), 0);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (win)->action_area), 6);
+ GtkWidget *content_area, *action_area;
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (win));
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (win));
+
+ gtk_container_set_border_width (GTK_CONTAINER (content_area), 12);
+ gtk_box_set_spacing (GTK_BOX (content_area), 24);
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 0);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
}
static gboolean
gtk_window_set_transient_for (GTK_WINDOW (tests),
GTK_WINDOW (gtk_widget_get_toplevel (user_data)));
- box = gtk_vbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (tests), box);
gtk_widget_show (box);
GtkWidget *hbox, *label, *chooser, *button;
GtkSizeGroup *label_group;
GOptionContext *context;
- gchar cwd[2048];
+ gchar *cwd;
context = g_option_context_new ("- test GtkFileChooserButton widget");
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (rtl)
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
- getcwd (cwd, sizeof (cwd));
+ cwd = g_get_current_dir();
gtk_src_dir = g_path_get_dirname (cwd);
+ g_free (cwd);
- win = gtk_dialog_new_with_buttons ("TestFileChooserButton", NULL, GTK_DIALOG_NO_SEPARATOR,
+ win = gtk_dialog_new_with_buttons ("TestFileChooserButton", NULL, 0,
GTK_STOCK_QUIT, GTK_RESPONSE_CLOSE, NULL);
g_signal_connect (win, "style-set", G_CALLBACK (win_style_set_cb), NULL);
g_signal_connect (win, "response", G_CALLBACK (gtk_main_quit), NULL);
- vbox = gtk_vbox_new (FALSE, 18);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (win)->vbox), vbox);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (win))), vbox);
frame = gtk_frame_new ("<b>GtkFileChooserButton</b>");
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
label_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- group_box = gtk_vbox_new (FALSE, 6);
+ group_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (alignment), group_box);
/* OPEN */
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (group_box), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic ("_Open:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- chooser = gtk_file_chooser_button_new_with_backend ("Select A File - testfilechooserbutton",
- GTK_FILE_CHOOSER_ACTION_OPEN,
- backend);
+ chooser = gtk_file_chooser_button_new ("Select A File - testfilechooserbutton",
+ GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (chooser), gtk_src_dir, NULL);
gtk_file_chooser_remove_shortcut_folder (GTK_FILE_CHOOSER (chooser), gtk_src_dir, NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), chooser);
g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL);
g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL);
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
- gtk_container_add (GTK_CONTAINER (hbox), chooser);
+ gtk_box_pack_start (GTK_BOX (hbox), chooser, TRUE, TRUE, 0);
button = gtk_button_new_from_stock (GTK_STOCK_PROPERTIES);
g_signal_connect (button, "clicked", G_CALLBACK (properties_button_clicked_cb), chooser);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
/* SELECT_FOLDER */
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (group_box), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic ("Select _Folder:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- chooser = gtk_file_chooser_button_new_with_backend ("Select A Folder - testfilechooserbutton",
- GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
- backend);
+ chooser = gtk_file_chooser_button_new ("Select A Folder - testfilechooserbutton",
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (chooser), gtk_src_dir, NULL);
gtk_file_chooser_remove_shortcut_folder (GTK_FILE_CHOOSER (chooser), gtk_src_dir, NULL);
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (chooser), gtk_src_dir, NULL);
g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL);
g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL);
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
- gtk_container_add (GTK_CONTAINER (hbox), chooser);
+ gtk_box_pack_start (GTK_BOX (hbox), chooser, TRUE, TRUE, 0);
button = gtk_button_new_from_stock (GTK_STOCK_PROPERTIES);
g_signal_connect (button, "clicked", G_CALLBACK (properties_button_clicked_cb), chooser);