+
+ /* Place cursor according to provided input (mfield) */
+ switch (mfield) {
+ case NO_FIELD_PRESENT:
+ gtk_widget_grab_focus(compose->header_last->entry);
+ break;
+ case TO_FIELD_PRESENT:
+ buf = g_strdup("");
+ gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), buf);
+ gtk_widget_grab_focus(compose->subject_entry);
+ break;
+ case SUBJECT_FIELD_PRESENT:
+ textview = GTK_TEXT_VIEW(compose->text);
+ textbuf = gtk_text_view_get_buffer(textview);
+ mark = gtk_text_buffer_get_insert(textbuf);
+ gtk_text_buffer_get_iter_at_mark(textbuf, &iter, mark);
+ gtk_text_buffer_insert(textbuf, &iter, "", -1);
+ /*
+ * SUBJECT_FIELD_PRESENT and BODY_FIELD_PRESENT
+ * only defers where it comes to the variable body
+ * is not null. If no body is present compose->text
+ * will be null in which case you cannot place the
+ * cursor inside the component so. An empty component
+ * is therefore created before placing the cursor
+ */
+ case BODY_FIELD_PRESENT:
+ gtk_widget_grab_focus(compose->text);
+ break;
+ }