diff --git a/Rakefile b/Rakefile old mode 100755 new mode 100644 diff --git a/Readme_for_developers.md b/Readme_for_developers.md old mode 100755 new mode 100644 diff --git a/image/screenshot_tfv1.png b/image/screenshot_tfv1.png index 73fed07..f369509 100644 Binary files a/image/screenshot_tfv1.png and b/image/screenshot_tfv1.png differ diff --git a/lib/lib_src2md.rb b/lib/lib_src2md.rb old mode 100755 new mode 100644 diff --git a/sec4.md b/sec4.md index 7777576..1eaf9c7 100644 --- a/sec4.md +++ b/sec4.md @@ -23,7 +23,7 @@ See a sample program `tfv1.c` below. 12 "It is a japanese word that means a man whose work is making bamboo baskets.\n" 13 "One day, he went into a mountain and found a shining bamboo." 14 "\"What a mysterious bamboo it is!,\" he said." - 15 "He cuts it, then there was a small cute baby girl in it." + 15 "He cut it, then there was a small cute baby girl in it." 16 "The girl was shining faintly." 17 "He thought this baby girl is a gift from Heaven and took her home.\n" 18 "His wife was surprized at his tale." @@ -76,7 +76,7 @@ You can add or delete any character on GtkTextview. And your change is kept in GtkTextBuffer. If you add more characters than the limit of the window, the height of the window extends. If the height gets bigger than the height of the display screen, you won't be able to control the size of the window back to the original size. -It's a problem. +It's a problem and it shows that there exists a bug in the program. You can solve it by putting GtkScrolledWindow between GtkApplicationWindow and GtkTextView. ### GtkScrolledWindow @@ -84,12 +84,12 @@ You can solve it by putting GtkScrolledWindow between GtkApplicationWindow and G What we need to do is: - Generate GtkScrolledWindow and set it as a child of GtkApplicationWindow. -- Set GtkTextVies as a child of GtkScrolledWindow. +- Set GtkTextView as a child of GtkScrolledWindow. Modify `tfv1.c` and save it as `tfv2.c`. The difference between these two files is very little. - $ diff tfv1.c tfv2.c + $ cd tfv; diff tfv1.c tfv2.c 5a6 > GtkWidget *scr; 24a26,28 @@ -122,7 +122,7 @@ Though you can modify the source file by this diff output, It's good for you to 13 "It is a japanese word that means a man whose work is making bamboo baskets.\n" 14 "One day, he went into a mountain and found a shining bamboo." 15 "\"What a mysterious bamboo it is!,\" he said." - 16 "He cuts it, then there was a small cute baby girl in it." + 16 "He cut it, then there was a small cute baby girl in it." 17 "The girl was shining faintly." 18 "He thought this baby girl is a gift from Heaven and took her home.\n" 19 "His wife was surprized at his tale." diff --git a/sec5.md b/sec5.md index 199d469..2c91946 100644 --- a/sec5.md +++ b/sec5.md @@ -127,7 +127,7 @@ The program is as follows. 37 } else { 38 filename = g_file_get_path (files[0]); 39 g_print ("No such file: %s.\n", filename); - 40 gtk_window_destroy (GTK_WINDOW (win)); + 40 gtk_window_destroy (GTK_WINDOW (win)); 41 } 42 } 43 diff --git a/src/misc/comp b/src/misc/comp old mode 100755 new mode 100644 diff --git a/src/sec4.src.md b/src/sec4.src.md index d43c1a4..629fcee 100644 --- a/src/sec4.src.md +++ b/src/sec4.src.md @@ -8,7 +8,7 @@ GtkTextview is a widget for multiline text editing. GtkTextBuffer is a text buffer which is connected to GtkTextView. See a sample program `tfv1.c` below. -@@@ tfv1.c +@@@ tfv/tfv1.c Look at line 25. GtkTextView is generated and its pointer is assigned to `tv`. @@ -30,7 +30,7 @@ You can add or delete any character on GtkTextview. And your change is kept in GtkTextBuffer. If you add more characters than the limit of the window, the height of the window extends. If the height gets bigger than the height of the display screen, you won't be able to control the size of the window back to the original size. -It's a problem. +It's a problem and it shows that there exists a bug in the program. You can solve it by putting GtkScrolledWindow between GtkApplicationWindow and GtkTextView. ### GtkScrolledWindow @@ -38,18 +38,18 @@ You can solve it by putting GtkScrolledWindow between GtkApplicationWindow and G What we need to do is: - Generate GtkScrolledWindow and set it as a child of GtkApplicationWindow. -- Set GtkTextVies as a child of GtkScrolledWindow. +- Set GtkTextView as a child of GtkScrolledWindow. Modify `tfv1.c` and save it as `tfv2.c`. The difference between these two files is very little. $$$ -diff tfv1.c tfv2.c +cd tfv; diff tfv1.c tfv2.c $$$ Though you can modify the source file by this diff output, It's good for you to show `tfv2.c`. -@@@ tfv2.c +@@@ tfv/tfv2.c Now compile and run it. This time the window doesn't extend even if you type a lot of characters. diff --git a/src/sec5.src.md b/src/sec5.src.md index c93b008..86b74f5 100644 --- a/src/sec5.src.md +++ b/src/sec5.src.md @@ -87,7 +87,7 @@ It works as follows. The program is as follows. -@@@ tfv3.c +@@@ tfv/tfv3.c Save it as `tfv3.c`. Then compile and run it. @@ -154,7 +154,7 @@ It is shown in the right screenshot. GtkNotebook widget is between GtkApplicationWindow and GtkScrolledWindow. Now I want to show you the program `tfv4.c`. -@@@ tfv4.c +@@@ tfv/tfv4.c Most of the change is in the function `on_open`. The numbers at the left of the following items are line numbers in the source code. diff --git a/src/tfv/a.out b/src/tfv/a.out new file mode 100755 index 0000000..aa8a773 Binary files /dev/null and b/src/tfv/a.out differ diff --git a/src/tfv/comp b/src/tfv/comp new file mode 100644 index 0000000..6cc7185 --- /dev/null +++ b/src/tfv/comp @@ -0,0 +1 @@ +gcc `pkg-config --cflags gtk4` $1.c `pkg-config --libs gtk4` diff --git a/src/tfv1.c b/src/tfv/tfv1.c similarity index 95% rename from src/tfv1.c rename to src/tfv/tfv1.c index f6dd45e..27c1ec3 100644 --- a/src/tfv1.c +++ b/src/tfv/tfv1.c @@ -12,7 +12,7 @@ on_activate (GApplication *app, gpointer user_data) { "It is a japanese word that means a man whose work is making bamboo baskets.\n" "One day, he went into a mountain and found a shining bamboo." "\"What a mysterious bamboo it is!,\" he said." -"He cuts it, then there was a small cute baby girl in it." +"He cut it, then there was a small cute baby girl in it." "The girl was shining faintly." "He thought this baby girl is a gift from Heaven and took her home.\n" "His wife was surprized at his tale." diff --git a/src/tfv2.c b/src/tfv/tfv2.c similarity index 96% rename from src/tfv2.c rename to src/tfv/tfv2.c index 6edd635..2c10641 100644 --- a/src/tfv2.c +++ b/src/tfv/tfv2.c @@ -13,7 +13,7 @@ on_activate (GApplication *app, gpointer user_data) { "It is a japanese word that means a man whose work is making bamboo baskets.\n" "One day, he went into a mountain and found a shining bamboo." "\"What a mysterious bamboo it is!,\" he said." -"He cuts it, then there was a small cute baby girl in it." +"He cut it, then there was a small cute baby girl in it." "The girl was shining faintly." "He thought this baby girl is a gift from Heaven and took her home.\n" "His wife was surprized at his tale." diff --git a/src/tfv3.c b/src/tfv/tfv3.c similarity index 97% rename from src/tfv3.c rename to src/tfv/tfv3.c index 92fe1ac..9bb78d4 100644 --- a/src/tfv3.c +++ b/src/tfv/tfv3.c @@ -37,7 +37,7 @@ on_open (GApplication *app, GFile ** files, gint n_files, gchar *hint, gpointer } else { filename = g_file_get_path (files[0]); g_print ("No such file: %s.\n", filename); - gtk_window_destroy (GTK_WINDOW (win)); + gtk_window_destroy (GTK_WINDOW (win)); } } diff --git a/src/tfv4.c b/src/tfv/tfv4.c similarity index 100% rename from src/tfv4.c rename to src/tfv/tfv4.c diff --git a/src2md.rb b/src2md.rb old mode 100755 new mode 100644