📄 gefaxview.c
字号:
/* gefax: (gefax is a easy frontend for efax. With efax you can send faxesover your modem to someone else.) Copyright (C) 2000 Rainer Wiener <rainer@konqui.de>This program is free software; you can redistribute it and/ormodify it under the terms of the GNU Public License as published bythe Free Software Foundation; either version 2 of the License, or (atyour option) any later version.This program is distibuted in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public Licence for more details.You should have received a copy of the GNU General Public Licencealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/ #include <gtk/gtk.h>#include <stdio.h>#include "gefaxview.h"extern GtkWidget *window10;extern char buffer[1024];void close_application( GtkWidget *widget, gpointer data ){ gtk_widget_destroy(window10);}void efaxout(){ GtkWidget *box1; GtkWidget *box2; GtkWidget *hbox; GtkWidget *table; GtkWidget *vscrollbar; GtkWidget *text; GdkFont *fixed_font; FILE *errorfile; int nchars; window10 = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize (window10, 600, 300); gtk_window_set_policy (GTK_WINDOW(window10), TRUE, TRUE, FALSE); gtk_signal_connect (GTK_OBJECT (window10), "destroy", GTK_SIGNAL_FUNC(close_application), NULL); gtk_window_set_title (GTK_WINDOW (window10), "efax error"); gtk_container_set_border_width (GTK_CONTAINER (window10), 0); box1 = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window10), box1); gtk_widget_show (box1); box2 = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); gtk_widget_show (box2); table = gtk_table_new (2, 2, FALSE); gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); gtk_box_pack_start (GTK_BOX (box2), table, TRUE, TRUE, 0); gtk_widget_show (table); text = gtk_text_new (NULL, NULL); gtk_text_set_editable (GTK_TEXT (text), FALSE); gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1, GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (text); vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj); gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1, GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); gtk_widget_show (vscrollbar); fixed_font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*"); gtk_widget_realize (text); gtk_text_freeze (GTK_TEXT (text)); errorfile = fopen("gefax.out", "r"); if (errorfile) { while (1) { nchars = fread(buffer, 1, 1024, errorfile); gtk_text_insert (GTK_TEXT (text), fixed_font, NULL, NULL, buffer, nchars); if (nchars < 1024) break; } fclose(errorfile); } gtk_text_thaw (GTK_TEXT (text)); hbox = gtk_hbutton_box_new (); gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); gtk_widget_show (window10);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -