00001 #include <gtk/gtk.h> 00002 #include <stdio.h> 00003 #include <errno.h> 00004 #include <stdlib.h> 00005 #include <string.h> 00006 00010 void show_about(void) 00011 { 00012 00013 GtkWidget *window1; 00014 GtkWidget *label; 00015 char about[300]; 00016 window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); 00017 gtk_window_set_title (GTK_WINDOW (window1), "About Text Editor for C"); 00018 gtk_window_set_default_size(GTK_WINDOW(window1), 300, 300); 00019 00020 00021 strcpy(about,"This is text editor for C.\n\n This has features for syntax highlighting and highlights the" 00022 "lines that contains errors.\n "); 00023 00024 strcat(about,"\0"); 00025 label = gtk_label_new (about); 00026 gtk_container_add (GTK_CONTAINER (window1), label); 00027 00028 gtk_widget_show_all (window1); 00029 } 00030 00036 void show_help(void) 00037 { 00038 00039 GtkWidget *window1; 00040 GtkWidget *label; 00041 char help[5000]; 00042 window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); 00043 gtk_window_set_title (GTK_WINDOW (window1), "Help"); 00044 gtk_window_set_default_size(GTK_WINDOW(window1), 300, 300); 00045 00046 00047 strcpy(help,"\nTo Create a New C file, choose file -> New. The application displays a new file in the C editor.\n\nTo Save a File\n - To save changes in an existing file, choose File -> Save.\n - To save a new file or to save an existing file under a new filename, choose File -> Save As. Enter a name for the file in the Save As dialog, then click Save.\n\nTo Edit text\n\n - To copy the selected text to a buffer, choose Edit -> Copy.\n - To delete the selected text from the file and move the selected text to a buffer, choose Edit -> Cut.\n - To insert the contents of the buffer at the cursor position, choose Edit -> Paste.You must cut or copy text before you can paste text into the file.\n - To select all of the text in the file, choose Edit -> Select All.\n\nTo Find Text\n\n - Choose Search -> Find to display the Find dialog.\n-Type the string that you want to find, in the text box.\n- Click Find to search the file for the first occurence of the string.\n If the editor finds the string, application moves the cursor position to the string, and selects the string.\n- To find the next occurence of the string, click Next\n\nTo Find and Replace Text\n\nChoose Search -> Replace to display the Replace dialog.\n-Type the string that you want to find, in the Search For field.\n-Click Find to search the file for the first occurence of the string.\n If the editor finds the string, application moves the cursor position to the string, and selects the string.\n- Click Replace to replace the occurences of the string with the text in the Replace with field. \n- To find the next occurence of the string,click Next.\n\nTo Compile:-\n Select the file to be complied. \nThe file gets displayed on the window1 with all the keywords highlighted.\n Now click on gcc button to compile the code.\n If any errors , they would be displayed in the bottom window and would be highlighted in gray in the main program.\n To view the error at a particular line, click on the error in the window2 and it gets highlighted in the program in yellow.\n. If no errors then the .o file would be created in the current folder."); 00048 00049 00050 strcat(help,"\0"); 00051 label = gtk_label_new (help); 00052 gtk_container_add (GTK_CONTAINER (window1), label); 00053 gtk_widget_show_all (window1); 00054 00055 }