GtkWidget *window;
GtkWidget *label;
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "gtkutils");
gtk_widget_set_size_request(window, 380, 60);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
return button;
}
+/**
+ * merge some part of code into one function : it creates a frame and add
+ * these into gtk box widget passed in param.
+ * \param box gtk box where adding new created frame.
+ * \param pframe pointer with which to assign the frame. If NULL, no pointer
+ * is assigned but the frame is anyway created and added to @box.
+ * \param frame_label frame label of new created frame.
+ */
+GtkWidget *gtkut_get_options_frame(GtkWidget *box, GtkWidget **pframe,
+ const gchar *frame_label)
+{
+ GtkWidget *vbox;
+ GtkWidget *frame;
+
+ frame = gtk_frame_new(frame_label);
+ gtk_widget_show(frame);
+ gtk_box_pack_start(GTK_BOX(box), frame, FALSE, TRUE, 0);
+ gtk_frame_set_label_align(GTK_FRAME(frame), 0.01, 0.5);
+
+ vbox = gtk_vbox_new (FALSE, 4);
+ gtk_widget_show(vbox);
+ gtk_container_add(GTK_CONTAINER (frame), vbox);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
+
+ if (pframe != NULL)
+ *pframe = frame;
+
+ return vbox;
+}
+
#if HAVE_LIBCOMPFACE
-gint create_xpm_from_xface(gchar *xpm[], const gchar *xface)
+static gint create_xpm_from_xface(gchar *xpm[], const gchar *xface)
{
static gchar *bit_pattern[] = {
"....",
return gtk_tree_model_iter_nth_child(model, iter, NULL, count - 1);
}
+
+GtkWidget *gtkut_window_new (GtkWindowType type,
+ const gchar *class)
+{
+ GtkWidget *window = gtk_window_new(type);
+ gtk_window_set_wmclass(GTK_WINDOW(window), class, "Claws Mail");
+ return window;
+}