oops - gnome-terminal patch v2 :)



New to GTK - sorry..

here is the same patch, but it actually works right for all buttons, now.

This adds a rightclick->set titlebar option to gnome-terminal.  Handy for
having dozens of terminals open...





--- gnome-core-1.0.4/gnome-terminal/gnome-terminal.c.orig	Mon Mar 22 11:56:17 1999
+++ gnome-core-1.0.4/gnome-terminal/gnome-terminal.c	Fri Jul 16 16:18:52 1999
@@ -135,6 +135,7 @@
 void hide_menu_cmd        (GtkWidget *widget, ZvtTerm *term);
 void paste_cmd            (GtkWidget *widget, ZvtTerm *term);
 void preferences_cmd      (GtkWidget *widget, ZvtTerm *term);
+void set_titlebar_cmd     (GtkWidget *widget, ZvtTerm *term);
 
 GtkWidget *new_terminal_cmd (char **cmd, struct terminal_config *cfg_in, gchar *geometry);
 GtkWidget *new_terminal     (GtkWidget *widget, ZvtTerm *term);
@@ -1326,6 +1327,8 @@
 	GNOMEUIINFO_ITEM_NONE (N_("_Reset Terminal"), NULL, reset_terminal_soft_cmd),
 	GNOMEUIINFO_ITEM_NONE (N_("Reset and _Clear"), NULL, reset_terminal_hard_cmd),
 #endif
+	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_ITEM_NONE (N_("Set titlebar"), NULL, set_titlebar_cmd),
 	GNOMEUIINFO_END
 };
 
@@ -1337,6 +1340,8 @@
 	GNOMEUIINFO_ITEM_NONE (N_("_Reset Terminal"), NULL, reset_terminal_soft_cmd),
 	GNOMEUIINFO_ITEM_NONE (N_("Reset and _Clear"), NULL, reset_terminal_hard_cmd),
 #endif
+	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_ITEM_NONE (N_("Set titlebar"), NULL, set_titlebar_cmd),
 	GNOMEUIINFO_END
 };
 
@@ -1421,6 +1426,56 @@
 	default:
 		break;
 	}
+}
+
+void
+set_titlebar_cmd (GtkWidget *w, ZvtTerm *t)
+{
+	GtkWidget *dlg;
+	GtkWidget *gnome_e;
+	GtkWidget *gtk_e;
+	GtkWidget *label;
+
+	dlg = gnome_dialog_new("Set titlebar",
+                        GNOME_STOCK_BUTTON_OK,
+                        GNOME_STOCK_BUTTON_APPLY,
+                        GNOME_STOCK_BUTTON_CLOSE,
+                        NULL);
+	gnome_dialog_set_default(GNOME_DIALOG(dlg), 0);
+
+	gnome_e = gnome_entry_new("gnome_terminal_set_titlebar");
+	gtk_e = gnome_entry_gtk_entry(GNOME_ENTRY(gnome_e));
+
+	label = gtk_label_new ("New title:");
+	gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox),
+		label, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox),
+		gnome_e, TRUE, TRUE, 0);
+	gtk_widget_show (label); 
+	gtk_widget_show (gnome_e); 
+
+	for(;;) {
+		char *new_title;
+		int i = gnome_dialog_run(GNOME_DIALOG(dlg));
+		if(i == 0) { 
+			/* OK */
+			new_title = gtk_entry_get_text(GTK_ENTRY(gtk_e));
+			title_changed(t, VTTITLE_WINDOW, new_title);
+			gnome_dialog_close(GNOME_DIALOG(dlg));
+			break;
+		} else if(i == 1) {
+			/* apply */
+			new_title = gtk_entry_get_text(GTK_ENTRY(gtk_e));
+			title_changed(t, VTTITLE_WINDOW, new_title);
+		} else if (i == 2) {
+			/* close */
+			gnome_dialog_close(GNOME_DIALOG(dlg));
+			break;
+		} else if(i < 0) {
+			/* wm kill */
+			break;
+		}
+ 	}
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]