Пример #1
0
void
conversation_window_update_preferences(ConversationWindow *win)
{
	ConversationWindowPriv *priv_win = (ConversationWindowPriv *) win;

	g_return_if_fail(win != NULL);
	g_return_if_fail(priv_win->xtext != NULL);

	gtk_xtext_set_palette(GTK_XTEXT(priv_win->xtext), colors);
	gtk_xtext_set_max_indent(GTK_XTEXT(priv_win->xtext), prefs.max_auto_indent);
	gtk_xtext_set_thin_separator(GTK_XTEXT(priv_win->xtext), prefs.thin_separator);
	gtk_xtext_set_max_lines(GTK_XTEXT(priv_win->xtext), prefs.max_lines);
	gtk_xtext_set_wordwrap(GTK_XTEXT(priv_win->xtext), prefs.wordwrap);
	gtk_xtext_set_show_marker(GTK_XTEXT(priv_win->xtext), prefs.show_marker);
	gtk_xtext_set_show_separator(GTK_XTEXT(priv_win->xtext), prefs.show_separator);
	gtk_xtext_set_indent(GTK_XTEXT(priv_win->xtext), prefs.indent_nicks);

	if (!gtk_xtext_set_font(GTK_XTEXT(priv_win->xtext), prefs.font_normal))
	{
		fe_message ("No font is available", FE_MSG_WAIT | FE_MSG_ERROR);
		exit(1);
	}

	gtk_xtext_refresh(GTK_XTEXT(priv_win->xtext));
}
Пример #2
0
void
open_rawlog (struct server *serv)
{
	GtkWidget *hbox, *vscrollbar, *vbox;
	char tbuf[256];

	if (serv->gui->rawlog_window)
	{
		mg_bring_tofront (serv->gui->rawlog_window);
		return;
	}

	snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Raw Log (%s)"), serv->servername);
	serv->gui->rawlog_window =
		mg_create_generic_tab ("RawLog", tbuf, FALSE, TRUE, close_rawlog, serv,
							 640, 320, &vbox, serv);
	gtkutil_destroy_on_esc (serv->gui->rawlog_window);

	hbox = gtk_hbox_new (FALSE, 2);
	gtk_container_add (GTK_CONTAINER (vbox), hbox);
	gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
	gtk_widget_show (hbox);

	serv->gui->rawlog_textlist = gtk_xtext_new (colors, 0);
	gtk_xtext_set_tint (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.hex_text_tint_red, prefs.hex_text_tint_green, prefs.hex_text_tint_blue);
	gtk_xtext_set_background (GTK_XTEXT (serv->gui->rawlog_textlist),
									  channelwin_pix, prefs.hex_text_transparent);

	gtk_container_add (GTK_CONTAINER (hbox), serv->gui->rawlog_textlist);
	gtk_xtext_set_font (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.hex_text_font);
	GTK_XTEXT (serv->gui->rawlog_textlist)->ignore_hidden = 1;
	gtk_widget_show (serv->gui->rawlog_textlist);

	vscrollbar = gtk_vscrollbar_new (GTK_XTEXT (serv->gui->rawlog_textlist)->adj);
	gtk_box_pack_start (GTK_BOX (hbox), vscrollbar, FALSE, FALSE, 0);
	show_and_unfocus (vscrollbar);

	hbox = gtk_hbutton_box_new ();
	gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_SPREAD);
	gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0);
	gtk_widget_show (hbox);

	gtkutil_button (hbox, GTK_STOCK_CLEAR, NULL, rawlog_clearbutton,
						 serv, _("Clear Raw Log"));

	gtkutil_button (hbox, GTK_STOCK_SAVE_AS, NULL, rawlog_savebutton,
						 serv, _("Save As..."));

	/* Copy selection to clipboard when Ctrl+Shift+C is pressed AND text auto-copy is disabled */
	g_signal_connect (G_OBJECT (serv->gui->rawlog_window), "key_press_event", G_CALLBACK (rawlog_key_cb), serv->gui->rawlog_textlist);

	gtk_widget_show (serv->gui->rawlog_window);
}
Пример #3
0
void
open_rawlog (struct server *serv)
{
	GtkWidget *hbox, *vscrollbar, *vbox;
	char tbuf[256];

	if (serv->gui->rawlog_window)
	{
		mg_bring_tofront (serv->gui->rawlog_window);
		return;
	}

	snprintf (tbuf, sizeof tbuf, _("XChat: Rawlog (%s)"), serv->servername);
	serv->gui->rawlog_window =
		mg_create_generic_tab ("RawLog", tbuf, FALSE, TRUE, close_rawlog, serv,
							 640, 320, &vbox, serv);

	hbox = gtk_hbox_new (FALSE, 2);
	gtk_container_add (GTK_CONTAINER (vbox), hbox);
	gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
	gtk_widget_show (hbox);

	serv->gui->rawlog_textlist = gtk_xtext_new (colors, 0);
	gtk_xtext_set_tint (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.tint_red, prefs.tint_green, prefs.tint_blue);
	gtk_xtext_set_background (GTK_XTEXT (serv->gui->rawlog_textlist),
									  channelwin_pix, prefs.transparent);

	gtk_container_add (GTK_CONTAINER (hbox), serv->gui->rawlog_textlist);
	gtk_xtext_set_font (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.font_normal);
	GTK_XTEXT (serv->gui->rawlog_textlist)->ignore_hidden = 1;
	gtk_widget_show (serv->gui->rawlog_textlist);

	vscrollbar = gtk_vscrollbar_new (GTK_XTEXT (serv->gui->rawlog_textlist)->adj);
	gtk_box_pack_start (GTK_BOX (hbox), vscrollbar, FALSE, FALSE, 0);
	show_and_unfocus (vscrollbar);

	hbox = gtk_hbutton_box_new ();
	gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_SPREAD);
	gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0);
	gtk_widget_show (hbox);

	gtkutil_button (hbox, GTK_STOCK_CLEAR, NULL, rawlog_clearbutton,
						 serv, _("Clear rawlog"));

	gtkutil_button (hbox, GTK_STOCK_SAVE_AS, NULL, rawlog_savebutton,
						 serv, _("Save As..."));

	gtk_widget_show (serv->gui->rawlog_window);
}
Пример #4
0
void
key_dialog_show ()
{
	GtkWidget *vbox, *box;
	GtkWidget *view, *xtext;
	GtkListStore *store;

	if (key_dialog)
	{
		mg_bring_tofront (key_dialog);
		return;
	}

	key_dialog = mg_create_generic_tab ("editkeys", _(DISPLAY_NAME": Keyboard Shortcuts"),
									TRUE, FALSE, key_dialog_close, NULL, 600, 360, &vbox, 0);

	view = key_dialog_treeview_new (vbox);
	xtext = gtk_xtext_new (colors, 0);
	gtk_box_pack_start (GTK_BOX (vbox), xtext, FALSE, TRUE, 2);
	gtk_xtext_set_font (GTK_XTEXT (xtext), prefs.hex_text_font);

	g_object_set_data (G_OBJECT (key_dialog), "view", view);
	g_object_set_data (G_OBJECT (key_dialog), "xtext", xtext);

	box = gtk_hbutton_box_new ();
	gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD);
	gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 2);
	gtk_container_set_border_width (GTK_CONTAINER (box), 5);

	gtkutil_button (box, GTK_STOCK_NEW, NULL, key_dialog_add,
					NULL, _("Add"));
	gtkutil_button (box, GTK_STOCK_DELETE, NULL, key_dialog_delete,
					NULL, _("Delete"));
	gtkutil_button (box, GTK_STOCK_CANCEL, NULL, key_dialog_close,
					NULL, _("Cancel"));
	gtkutil_button (box, GTK_STOCK_SAVE, NULL, key_dialog_save,
					NULL, _("Save"));

	store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view)));
	key_dialog_load (store);

	gtk_widget_show_all (key_dialog);
}
Пример #5
0
void
open_rawlog (struct server *serv)
{
    GtkWidget *bbox, *scrolledwindow, *vbox;
    char tbuf[256];

    if (serv->gui->rawlog_window)
    {
        mg_bring_tofront (serv->gui->rawlog_window);
        return;
    }

    g_snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Raw Log (%s)"), serv->servername);
    serv->gui->rawlog_window =
        mg_create_generic_tab ("RawLog", tbuf, FALSE, TRUE, close_rawlog, serv,
                               640, 320, &vbox, serv);
    gtkutil_destroy_on_esc (serv->gui->rawlog_window);

    scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_SHADOW_IN);
    gtk_container_add (GTK_CONTAINER (vbox), scrolledwindow);

    serv->gui->rawlog_textlist = gtk_xtext_new (colors, 0);
    gtk_container_add (GTK_CONTAINER (scrolledwindow), serv->gui->rawlog_textlist);
    gtk_xtext_set_font (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.hex_text_font);
    GTK_XTEXT (serv->gui->rawlog_textlist)->ignore_hidden = 1;

    bbox = gtk_hbutton_box_new ();
    gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
    gtk_box_pack_end (GTK_BOX (vbox), bbox, 0, 0, 4);

    gtkutil_button (bbox, GTK_STOCK_CLEAR, NULL, rawlog_clearbutton,
                    serv, _("Clear Raw Log"));

    gtkutil_button (bbox, GTK_STOCK_SAVE_AS, NULL, rawlog_savebutton,
                    serv, _("Save As..."));

    /* Copy selection to clipboard when Ctrl+Shift+C is pressed AND text auto-copy is disabled */
    g_signal_connect (G_OBJECT (serv->gui->rawlog_window), "key_press_event", G_CALLBACK (rawlog_key_cb), serv->gui->rawlog_textlist);

    gtk_widget_show_all (serv->gui->rawlog_window);
}
Пример #6
0
void
pevent_dialog_show ()
{
	GtkWidget *vbox, *hbox, *tbox, *wid, *bh, *th;
	GtkListStore *store, *hstore;
	GtkTreeSelection *sel;

	if (pevent_dialog)
	{
		mg_bring_tofront (pevent_dialog);
		return;
	}

	pevent_dialog =
			  mg_create_generic_tab ("edit events", _("Edit Events"),
											 TRUE, FALSE, pevent_dialog_close, NULL,
											 600, 455, &vbox, 0);

	wid = gtk_vpaned_new ();
	th = gtk_vbox_new (0, 2);
	bh = gtk_vbox_new (0, 2);
	gtk_widget_show (th);
	gtk_widget_show (bh);
	gtk_paned_pack1 (GTK_PANED (wid), th, 1, 1);
	gtk_paned_pack2 (GTK_PANED (wid), bh, 0, 1);
	gtk_box_pack_start (GTK_BOX (vbox), wid, 1, 1, 0);
	gtk_widget_show (wid);

	store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING,
	                            G_TYPE_STRING, G_TYPE_INT);
	pevent_dialog_list = gtkutil_treeview_new (th, GTK_TREE_MODEL (store), NULL,
															 COL_EVENT_NAME, _("Event"),
															 COL_EVENT_TEXT, _("Text"), -1);
	sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (pevent_dialog_list));
	g_signal_connect (G_OBJECT (sel), "changed",
							G_CALLBACK (pevent_dialog_select), store);

	pevent_dialog_twid = gtk_xtext_new (colors, 0);
	gtk_xtext_set_tint (GTK_XTEXT (pevent_dialog_twid), prefs.tint_red, prefs.tint_green, prefs.tint_blue);
	gtk_xtext_set_background (GTK_XTEXT (pevent_dialog_twid),
									  channelwin_pix, prefs.transparent);

	pevent_dialog_entry = gtk_entry_new_with_max_length (255);
	g_signal_connect (G_OBJECT (pevent_dialog_entry), "activate",
							G_CALLBACK (pevent_dialog_update), pevent_dialog_twid);
	gtk_box_pack_start (GTK_BOX (bh), pevent_dialog_entry, 0, 0, 0);
	gtk_widget_show (pevent_dialog_entry);

	tbox = gtk_hbox_new (0, 0);
	gtk_container_add (GTK_CONTAINER (bh), tbox);
	gtk_widget_show (tbox);

	gtk_widget_set_usize (pevent_dialog_twid, 150, 20);
	gtk_container_add (GTK_CONTAINER (tbox), pevent_dialog_twid);
	gtk_xtext_set_font (GTK_XTEXT (pevent_dialog_twid), prefs.font_normal);

	wid = gtk_vscrollbar_new (GTK_XTEXT (pevent_dialog_twid)->adj);
	gtk_box_pack_start (GTK_BOX (tbox), wid, FALSE, FALSE, 0);
	show_and_unfocus (wid);

	gtk_widget_show (pevent_dialog_twid);

	hstore = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING);
	pevent_dialog_hlist = gtkutil_treeview_new (bh, GTK_TREE_MODEL (hstore),
															  NULL,
															  0, _("$ Number"),
															  1, _("Description"), -1);
	gtk_widget_show (pevent_dialog_hlist);

	pevent_dialog_fill (pevent_dialog_list);
	gtk_widget_show (pevent_dialog_list);

	hbox = gtk_hbutton_box_new ();
	gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 2);
	/*wid = gtk_button_new_with_label (_("Save"));
	gtk_box_pack_end (GTK_BOX (hbox), wid, 0, 0, 0);
	gtk_signal_connect (GTK_OBJECT (wid), "clicked",
							  GTK_SIGNAL_FUNC (pevent_save_cb), NULL);
	gtk_widget_show (wid);*/
	gtkutil_button (hbox, GTK_STOCK_SAVE_AS, NULL, pevent_save_cb,
						 (void *) 1, _("Save As..."));
	gtkutil_button (hbox, GTK_STOCK_OPEN, NULL, pevent_load_cb,
						 (void *) 0, _("Load From..."));
	wid = gtk_button_new_with_label (_("Test All"));
	gtk_box_pack_end (GTK_BOX (hbox), wid, 0, 0, 0);
	g_signal_connect (G_OBJECT (wid), "clicked",
							G_CALLBACK (pevent_test_cb), pevent_dialog_twid);
	gtk_widget_show (wid);

	wid = gtk_button_new_from_stock (GTK_STOCK_OK);
	gtk_box_pack_start (GTK_BOX (hbox), wid, 0, 0, 0);
	g_signal_connect (G_OBJECT (wid), "clicked",
							G_CALLBACK (pevent_ok_cb), NULL);
	gtk_widget_show (wid);

	gtk_widget_show (hbox);

	gtk_widget_show (pevent_dialog);
}
Пример #7
0
Файл: fkeys.c Проект: n2i/xvnkb
void
key_dialog_show ()
{
	GtkWidget *vbox, *hbox, *list, *vbox2, *wid, *wid2, *wid3, *hbox2;
	struct key_binding *kb;
	gchar *titles[] = { NULL, NULL, NULL, "1", "2" };
	char temp[32];
	int i;

	titles[0] = _("Mod");
	titles[1] = _("Key");
	titles[2] = _("Action");

	if (key_dialog)
	{
		mg_bring_tofront (key_dialog);
		return;
	}

	key_dialog =
			  mg_create_generic_tab ("editkeys", _("ZChat: Keyboard Shortcuts"),
							TRUE, FALSE, key_dialog_close, NULL, 560, 330, &vbox, 0);

	hbox = gtk_hbox_new (0, 2);
	gtk_box_pack_start (GTK_BOX (vbox), hbox, 1, 1, 0);

	list = gtkutil_clist_new (5, titles, hbox, 0, key_dialog_sel_row, 0, NULL,
									  0, GTK_SELECTION_SINGLE);
	gtk_widget_set_usize (list, 400, 0);
	key_dialog_kb_clist = list;

	gtk_widget_show (hbox);

	kb = keys_root;

	gtk_clist_set_column_width (GTK_CLIST (list), 1, 50);
	gtk_clist_set_column_width (GTK_CLIST (list), 2, 120);
	gtk_clist_set_column_width (GTK_CLIST (list), 3, 50);
	gtk_clist_set_column_width (GTK_CLIST (list), 4, 50);

	while (kb)
	{
		titles[0] = key_make_mod_str (kb->mod, temp);
		titles[1] = kb->keyname;
		if (kb->action < 0 || kb->action > KEY_MAX_ACTIONS)
			titles[2] = _("<none>");
		else
			titles[2] = key_actions[kb->action].name;
		if (kb->data1)
			titles[3] = kb->data1;
		else
			titles[3] = _("<none>");

		if (kb->data2)
			titles[4] = kb->data2;
		else
			titles[4] = _("<none>");

		gtk_clist_set_row_data (GTK_CLIST (list),
										gtk_clist_append (GTK_CLIST (list), titles),
										kb);

		kb = kb->next;
	}

	vbox2 = gtk_vbox_new (0, 2);
	gtk_box_pack_end (GTK_BOX (hbox), vbox2, 1, 1, 0);
	wid = gtk_button_new_with_label (_("Add New"));
	gtk_box_pack_start (GTK_BOX (vbox2), wid, 0, 0, 0);
	gtk_signal_connect (GTK_OBJECT (wid), "clicked",
							  GTK_SIGNAL_FUNC (key_dialog_add_new), list);
	gtk_widget_show (wid);
	wid = gtk_button_new_with_label (_("Delete"));
	gtk_box_pack_start (GTK_BOX (vbox2), wid, 0, 0, 0);
	gtk_signal_connect (GTK_OBJECT (wid), "clicked",
							  GTK_SIGNAL_FUNC (key_dialog_delete), list);
	gtk_widget_show (wid);
	gtk_widget_show (vbox2);

	wid = gtk_option_menu_new ();
	wid2 = gtk_menu_new ();

	for (i = 0; i <= KEY_MAX_ACTIONS; i++)
	{
		wid3 = gtk_menu_item_new_with_label (_(key_actions[i].name));
		gtk_widget_show (wid3);
		gtk_menu_shell_append (GTK_MENU_SHELL (wid2), wid3);
		gtk_signal_connect (GTK_OBJECT (wid3), "activate",
								  GTK_SIGNAL_FUNC (key_dialog_sel_act),
								  GINT_TO_POINTER (i));
	}

	gtk_option_menu_set_menu (GTK_OPTION_MENU (wid), wid2);
	gtk_option_menu_set_history (GTK_OPTION_MENU (wid), 0);
	gtk_box_pack_end (GTK_BOX (vbox2), wid, 0, 0, 0);
	gtk_widget_show (wid);
	key_dialog_act_menu = wid;

	key_dialog_tog_s = key_dialog_make_toggle (_("Shift"), key_dialog_tog_key,
															 (void *) STATE_SHIFT, vbox2);
	key_dialog_tog_a = key_dialog_make_toggle (_("Alt"), key_dialog_tog_key,
															 (void *) STATE_ALT, vbox2);
	key_dialog_tog_c = key_dialog_make_toggle (_("Ctrl"), key_dialog_tog_key,
															 (void *) STATE_CTRL, vbox2);

	key_dialog_ent_key = key_dialog_make_entry (_("Key"), "key_press_event",
															  key_dialog_set_key, NULL,
															  vbox2);

	key_dialog_ent_d1 = key_dialog_make_entry (_("Data 1"), "activate",
															 key_dialog_set_data, NULL,
															 vbox2);
	key_dialog_ent_d2 = key_dialog_make_entry (_("Data 2"), "activate",
															 key_dialog_set_data,
															 (void *) 1, vbox2);

	hbox2 = gtk_hbox_new (0, 2);
	gtk_box_pack_end (GTK_BOX (vbox), hbox2, 0, 0, 1);

	wid = gtk_xtext_new (colors, 0);
	gtk_xtext_set_tint (GTK_XTEXT (wid), prefs.tint_red, prefs.tint_green, prefs.tint_blue);
	gtk_xtext_set_background (GTK_XTEXT (wid),
									  channelwin_pix,
									  prefs.transparent);
	gtk_widget_set_usize (wid, 0, 75);
	gtk_box_pack_start (GTK_BOX (hbox2), wid, 1, 1, 1);
	gtk_xtext_set_font (GTK_XTEXT (wid), prefs.font_normal);
	gtk_widget_show (wid);

	wid2 = gtk_vscrollbar_new (GTK_XTEXT (wid)->adj);
	gtk_box_pack_start (GTK_BOX (hbox2), wid2, 0, 0, 0);
	gtk_widget_show (wid2);

	gtk_widget_show (hbox2);
	key_dialog_text = wid;

	gtk_widget_show_all (key_dialog);
}
Пример #8
0
static void
open_dialog_window (struct session *sess)
{
	GtkWidget *hbox, *vbox, *bbox;
	int page = prefs.privmsgtab;
	struct User *user;

	if (!main_window)
		page = 0;
	if (!page)
	{
		sess->gui->window = wins_new (sess->channel, "",
												kill_session_callback, sess, link_cb,
												sess, FALSE, FALSE, NULL);
		gtk_widget_set_usize (sess->gui->window, prefs.dialog_width,
									 prefs.dialog_height);
		gtk_signal_connect ((GtkObject *) sess->gui->window, "focus_in_event",
								  GTK_SIGNAL_FUNC (focus_in), sess);
		sess->is_tab = FALSE;
	} else
	{
		sess->gui->window = wins_new (sess->channel, "",
												kill_session_callback, sess, link_cb,
												sess, TRUE, FALSE, NULL);
		sess->is_tab = TRUE;
	}

	sess->gui->vbox = vbox = wins_get_vbox (sess->gui->window);

	if (!page)
		sess->gui->changad = NULL;
	else
		sess->gui->changad = wins_get_notebooklabel (sess->gui->window);

	sess->gui->tbox = hbox = gtk_hbox_new (FALSE, 0);
	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 2);
	if (prefs.topicbar)
		gtk_widget_show (hbox);

	/* create the X ^ < > buttons */
	wins_create_linkbuttons (sess->gui->window, hbox);

	sess->gui->topicgad = gtk_entry_new ();
	gtk_entry_set_editable ((GtkEntry *) sess->gui->topicgad, FALSE);
	gtk_container_add (GTK_CONTAINER (hbox), sess->gui->topicgad);
	if (prefs.inputgad_superfocus)
		show_and_unfocus (sess->gui->topicgad);
	else
		gtk_widget_show (sess->gui->topicgad);

	/*if (prefs.dialogbuttons)*/
		dialog_createbuttons (sess);
	/*else
		sess->gui->button_box = 0;*/

	hbox = gtk_hbox_new (FALSE, 0);
	sess->gui->leftpane = hbox;
	gtk_container_add (GTK_CONTAINER (vbox), hbox);
	gtk_widget_show (hbox);

	sess->gui->textgad =
		gtk_xtext_new (prefs.dialog_indent_pixels * prefs.dialog_indent_nicks,
							prefs.dialog_show_separator);

	gtk_object_set_user_data (GTK_OBJECT (sess->gui->textgad), sess);

	((GtkXText *) sess->gui->textgad)->wordwrap = prefs.dialog_wordwrap;
	((GtkXText *) sess->gui->textgad)->max_auto_indent = prefs.max_auto_indent;
	((GtkXText *) sess->gui->textgad)->auto_indent = prefs.auto_indent;
	((GtkXText *) sess->gui->textgad)->thinline = prefs.thin_separator;
	((GtkXText *) sess->gui->textgad)->max_lines = prefs.max_lines;
	((GtkXText *) sess->gui->textgad)->error_function = gtkutil_simpledialog;
	((GtkXText *) sess->gui->textgad)->urlcheck_function = maingui_word_check;

	((GtkXText *) sess->gui->textgad)->tint_red = prefs.dialog_tint_red;
	((GtkXText *) sess->gui->textgad)->tint_green = prefs.dialog_tint_green;
	((GtkXText *) sess->gui->textgad)->tint_blue = prefs.dialog_tint_blue;

	if (prefs.timestamp && prefs.dialog_indent_nicks)
		((GtkXText *) sess->gui->textgad)->time_stamp = TRUE;

	gtk_xtext_set_palette (GTK_XTEXT (sess->gui->textgad), colors);
	gtk_xtext_set_font (GTK_XTEXT (sess->gui->textgad), dialog_font_normal, 0);
	gtk_xtext_set_background (GTK_XTEXT (sess->gui->textgad),
									  dialogwin_pix,
									  prefs.dialog_transparent, prefs.dialog_tint);

	gtk_container_add (GTK_CONTAINER (hbox), sess->gui->textgad);
	show_and_unfocus (sess->gui->textgad);

#ifdef USE_GNOME
	gtk_drag_dest_set (sess->gui->textgad, GTK_DEST_DEFAULT_ALL, dnd_targets,
							 1, GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
	gtk_signal_connect (GTK_OBJECT (sess->gui->textgad), "drag_data_received",
							  GTK_SIGNAL_FUNC (dialog_dnd_drop), sess);
#endif

	sess->gui->vscrollbar =
		gtk_vscrollbar_new (GTK_XTEXT (sess->gui->textgad)->adj);
	gtk_box_pack_start (GTK_BOX (hbox), sess->gui->vscrollbar, FALSE, FALSE,
							  1);
	show_and_unfocus (sess->gui->vscrollbar);

	if (!sess->is_tab)
		gtk_signal_connect_object (GTK_OBJECT (sess->gui->window),
											"configure_event",
											GTK_SIGNAL_FUNC (maingui_configure),
											GTK_OBJECT (sess));

	bbox = gtk_hbox_new (FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (bbox), 0);
	gtk_box_pack_end (GTK_BOX (vbox), bbox, FALSE, TRUE, 2);
	gtk_widget_show (bbox);

	gtk_signal_connect (GTK_OBJECT (sess->gui->textgad), "word_click",
							  GTK_SIGNAL_FUNC (maingui_word_clicked), sess);

	sess->gui->inputgad = gtk_entry_new_with_max_length (2048);
	gtk_container_add (GTK_CONTAINER (bbox), sess->gui->inputgad);
	gtk_signal_connect (GTK_OBJECT (sess->gui->inputgad), "key_press_event",
							  GTK_SIGNAL_FUNC (key_handle_key_press), sess);
	if (prefs.style_inputbox)
		gtk_widget_set_style (sess->gui->inputgad, inputgad_style);
	gtk_widget_show (sess->gui->inputgad);

	/* create the < ^ buttons on the bottom right (maingui.c) */
	gui_create_toolbox (sess, bbox);

	gtk_widget_show (sess->gui->window);

	if (page && prefs.newtabstofront)
		wins_bring_tofront (sess->gui->window);

	fe_set_title (sess);

	user = find_name_global (sess->server, sess->channel);
	if (user)
	{
		if (user->hostname)
			gtk_entry_set_text (GTK_ENTRY (sess->gui->topicgad), user->hostname);
	}
}