diff --git a/Rakefile b/Rakefile index 8485690..3ac9e58 100644 --- a/Rakefile +++ b/Rakefile @@ -10,11 +10,11 @@ end srcfiles = Sec_files.new srcfiles srcfiles.renum! -mdfilenames = srcfiles.map {|srcfile| srcfile.to_md} -htmlfilenames = srcfiles.map {|srcfile| "html/"+srcfile.to_html} -texfilenames = srcfiles.map {|srcfile| "latex/"+srcfile.to_tex} +mdfilenames = srcfiles.map {|srcfile| "gfm/#{srcfile.to_md}"} +htmlfilenames = srcfiles.map {|srcfile| "html/#{srcfile.to_html}"} +texfilenames = srcfiles.map {|srcfile| "latex/#{srcfile.to_tex}"} -["html", "latex"].each do |d| +["gfm", "html", "latex"].each do |d| if ! Dir.exist?(d) Dir.mkdir(d) end @@ -127,7 +127,7 @@ EOS task default: :md task all: [:md, :html, :pdf] -task md: mdfilenames+["Readme.md"] +task md: ["Readme.md"] file "Readme.md" => mdfilenames do buf = [ "# Gtk4 Tutorial for beginners\n", "\n" ] @@ -136,27 +136,27 @@ file "Readme.md" => mdfilenames do 0.upto(srcfiles.size-1) do |i| h = File.open(srcfiles[i].path) { |file| file.readline } h = h.gsub(/^#* */,"").chomp - buf << "- [#{h}](#{srcfiles[i].to_md})\n" + buf << "- [#{h}](gfm/#{srcfiles[i].to_md})\n" end File.write("Readme.md", buf.join) end 0.upto(srcfiles.size - 1) do |i| - file srcfiles[i].to_md => (srcfiles[i].c_files << srcfiles[i].path) do - src2md srcfiles[i].path, srcfiles[i].to_md, -1 + file "gfm/#{srcfiles[i].to_md}" => (srcfiles[i].c_files << srcfiles[i].path) do + src2md srcfiles[i].path, "gfm/#{srcfiles[i].to_md}", -1 if srcfiles.size == 1 - nav = "Up: [Readme.md](Readme.md)\n" + nav = "Up: [Readme.md](../Readme.md)\n" elsif i == 0 - nav = "Up: [Readme.md](Readme.md), Next: [Section 2](#{srcfiles[1].to_md})\n" + nav = "Up: [Readme.md](../Readme.md), Next: [Section 2](#{srcfiles[1].to_md})\n" elsif i == srcfiles.size - 1 - nav = "Up: [Readme.md](Readme.md), Prev: [Section #{i}](#{srcfiles[i-1].to_md})\n" + nav = "Up: [Readme.md](../Readme.md), Prev: [Section #{i}](#{srcfiles[i-1].to_md})\n" else - nav = "Up: [Readme.md](Readme.md), Prev: [Section #{i}](#{srcfiles[i-1].to_md}), Next: [Section #{i+2}](#{srcfiles[i+1].to_md})\n" + nav = "Up: [Readme.md](../Readme.md), Prev: [Section #{i}](#{srcfiles[i-1].to_md}), Next: [Section #{i+2}](#{srcfiles[i+1].to_md})\n" end - buf = IO.readlines srcfiles[i].to_md + buf = IO.readlines "gfm/#{srcfiles[i].to_md}" buf.insert(0, nav, "\n") buf.append("\n", nav) - IO.write srcfiles[i].to_md, buf.join + IO.write "gfm/#{srcfiles[i].to_md}", buf.join end end @@ -173,8 +173,8 @@ file "html/index.html" do end 0.upto(srcfiles.size - 1) do |i| - file "html/"+srcfiles[i].to_html => (srcfiles[i].c_files << srcfiles[i].path) do - src2md srcfiles[i].path, "html/"+srcfiles[i].to_md, -1 + file "html/#{srcfiles[i].to_html}" => (srcfiles[i].c_files << srcfiles[i].path) do + src2md srcfiles[i].path, "html/#{srcfiles[i].to_html}", -1 buf = IO.readlines "html/"+srcfiles[i].to_md buf.each do |line| line.gsub!(/(\[[^\]]*\])\((sec\d+)\.md\)/,"\\1(\\2.html)") @@ -220,8 +220,8 @@ file "latex/main.tex" do end 0.upto(srcfiles.size - 1) do |i| - file "latex/"+srcfiles[i].to_tex => (srcfiles[i].c_files << srcfiles[i].path) do - src2md srcfiles[i].path, "latex/"+srcfiles[i].to_md, 80 + file "latex/#{srcfiles[i].to_tex}" => (srcfiles[i].c_files << srcfiles[i].path) do + src2md srcfiles[i].path, "latex/#{srcfiles[i].to_tex}", 80 sh "pandoc -o latex/#{srcfiles[i].to_tex} latex/#{srcfiles[i].to_md}" File.delete("latex/#{srcfiles[i].to_md}") end diff --git a/Readme.md b/Readme.md index fbb3fd5..f41392d 100644 --- a/Readme.md +++ b/Readme.md @@ -11,21 +11,21 @@ If you find any bugs, errors or mistakes in the tutorial and C examples, please let me know. You can post it to [github issues](https://github.com/ToshioCP/Gtk4-tutorial/issues). -- [Prerequisite and Licence](sec1.md) -- [Installation of gtk4 to linux distributions](sec2.md) -- [GtkApplication and GtkApplicationWindow](sec3.md) -- [Widgets (1)](sec4.md) -- [Widgets (2)](sec5.md) -- [Widgets (3)](sec6.md) -- [Define Child object](sec7.md) -- [Ui file and GtkBuiler](sec8.md) -- [Build system](sec9.md) -- [Instance and class](sec10.md) -- [Signals](sec11.md) -- [Functions in TfeTextView](sec12.md) -- [Functions with GtkNotebook](sec13.md) -- [tfeapplication.c](sec14.md) -- [tfe5 source files](sec15.md) -- [Menu and action](sec16.md) -- [Stateful action](sec17.md) -- [Ui file for menu and action entries](sec18.md) +- [Prerequisite and Licence](gfm/sec1.md) +- [Installation of gtk4 to linux distributions](gfm/sec2.md) +- [GtkApplication and GtkApplicationWindow](gfm/sec3.md) +- [Widgets (1)](gfm/sec4.md) +- [Widgets (2)](gfm/sec5.md) +- [Widgets (3)](gfm/sec6.md) +- [Define Child object](gfm/sec7.md) +- [Ui file and GtkBuiler](gfm/sec8.md) +- [Build system](gfm/sec9.md) +- [Instance and class](gfm/sec10.md) +- [Signals](gfm/sec11.md) +- [Functions in TfeTextView](gfm/sec12.md) +- [Functions with GtkNotebook](gfm/sec13.md) +- [tfeapplication.c](gfm/sec14.md) +- [tfe5 source files](gfm/sec15.md) +- [Menu and action](gfm/sec16.md) +- [Stateful action](gfm/sec17.md) +- [Ui file for menu and action entries](gfm/sec18.md) diff --git a/sec1.md b/gfm/sec1.md similarity index 95% rename from sec1.md rename to gfm/sec1.md index 948a11f..f26855a 100644 --- a/sec1.md +++ b/gfm/sec1.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Next: [Section 2](sec2.md) +Up: [Readme.md](../Readme.md), Next: [Section 2](sec2.md) # Prerequisite and Licence @@ -59,4 +59,4 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY o See the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html) for more details. -Up: [Readme.md](Readme.md), Next: [Section 2](sec2.md) +Up: [Readme.md](../Readme.md), Next: [Section 2](sec2.md) diff --git a/sec10.md b/gfm/sec10.md similarity index 98% rename from sec10.md rename to gfm/sec10.md index 72a9905..2f579b7 100644 --- a/sec10.md +++ b/gfm/sec10.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 9](sec9.md), Next: [Section 11](sec11.md) +Up: [Readme.md](../Readme.md), Prev: [Section 9](sec9.md), Next: [Section 11](sec11.md) # Instance and class @@ -88,7 +88,7 @@ This is very important. It guarantees a child widget to derive all the features from ancestors. The structure of `TfeTextView` is like the following diagram. -![The structure of the instance TfeTextView](image/TfeTextView.png) +![The structure of the instance TfeTextView](../image/TfeTextView.png) ## Generate TfeTextView instance @@ -342,7 +342,7 @@ Override is rewriting ancestors' class methods in the descendent class.) TfeTextViewClass includes its ancsestors' class in it. It is illustrated in the following diagram. -![The structure of TfeTextView Class](image/TfeTextViewClass.png) +![The structure of TfeTextView Class](../image/TfeTextViewClass.png) ## Destruction of TfeTextView @@ -358,7 +358,7 @@ At this moment, no object refers C and the reference count of C is zero. This means C is no longer useful. Then C destructs itself and finally the memories allocated to C is freed. -![Reference count of B](image/refcount.png) +![Reference count of B](../image/refcount.png) The idea above is based on an assumption that an object refered by nothing has reference count of zero. When the reference count drops to zero, the object starts its destruction process. @@ -402,7 +402,7 @@ Look at the following diagram. There are four classes -- GObjectClass (GInitiallyUnownedClass), GtkWidgetClass, GtkTextViewClass and TfeTextViewClass. Each class has its own dispose handler -- `dh1`, `dh2`, `dh3` and `tfe_text_view_dispose`. -![dispose handers](image/dispose_handler.png) +![dispose handers](../image/dispose_handler.png) Now, look at the `tfe_text_view_dispose` program above. It first releases the reference to GFile object pointed by `tv->file`. @@ -418,4 +418,4 @@ After that, `dh3` calls `dh2`, and `dh2` calls `dh1`. Finally all the references are released. -Up: [Readme.md](Readme.md), Prev: [Section 9](sec9.md), Next: [Section 11](sec11.md) +Up: [Readme.md](../Readme.md), Prev: [Section 9](sec9.md), Next: [Section 11](sec11.md) diff --git a/sec11.md b/gfm/sec11.md similarity index 97% rename from sec11.md rename to gfm/sec11.md index f272216..a34f00c 100644 --- a/sec11.md +++ b/gfm/sec11.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 10](sec10.md), Next: [Section 12](sec12.md) +Up: [Readme.md](../Readme.md), Prev: [Section 10](sec10.md), Next: [Section 12](sec12.md) # Signals @@ -162,4 +162,4 @@ The following is extract from `tfetexties.c`. The fourth parameter is the parameter. -Up: [Readme.md](Readme.md), Prev: [Section 10](sec10.md), Next: [Section 12](sec12.md) +Up: [Readme.md](../Readme.md), Prev: [Section 10](sec10.md), Next: [Section 12](sec12.md) diff --git a/sec12.md b/gfm/sec12.md similarity index 98% rename from sec12.md rename to gfm/sec12.md index d5e7d7f..cc97ef0 100644 --- a/sec12.md +++ b/gfm/sec12.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 11](sec11.md), Next: [Section 13](sec13.md) +Up: [Readme.md](../Readme.md), Prev: [Section 11](sec11.md), Next: [Section 13](sec13.md) # Functions in TfeTextView @@ -233,7 +233,7 @@ The buttons are Cancel and Save. - 1-16: `saveas_dialog_response` signal handler. - 6-14: If the response is `GTK_RESPONSE_ACCEPT`, which is set to the argument when the user has clicked on Save button, then gets a pointer to the GFile object, set it to `tv->file`, turn on the modified bit of the GtkTextBuffer, emits "change-file" signal then call `tfe_text_view_save` to save the buffer to the file. -![Saveas process](image/saveas.png) +![Saveas process](../image/saveas.png) When you use GtkFileChooserDialog, you need to divide the program into two parts. They are a function which generates GtkFileChooserDialog and the signal handler. @@ -332,7 +332,7 @@ In Gtk3, `gtk_dialog_run` function is available. It simplifies the process. However, in Gtk4, `gtk_dialog_run`is unavailable any more. -![Caller and TfeTextView](image/open.png) +![Caller and TfeTextView](../image/open.png) 1. A caller get a pointer `tv` to TfeTextView by calling `tfe_text_view_new`. 2. The caller connects the handler (left bottom in the diagram) and the signal "open-response". @@ -360,4 +360,4 @@ Otherwise, if the caller free the GFile object, `tv->file` is no more guaranteed All the source files are listed in [Section 15](sec15.md). -Up: [Readme.md](Readme.md), Prev: [Section 11](sec11.md), Next: [Section 13](sec13.md) +Up: [Readme.md](../Readme.md), Prev: [Section 11](sec11.md), Next: [Section 13](sec13.md) diff --git a/sec13.md b/gfm/sec13.md similarity index 97% rename from sec13.md rename to gfm/sec13.md index bf16f25..2104b3e 100644 --- a/sec13.md +++ b/gfm/sec13.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 12](sec12.md), Next: [Section 14](sec14.md) +Up: [Readme.md](../Readme.md), Prev: [Section 12](sec12.md), Next: [Section 14](sec14.md) # Functions with GtkNotebook @@ -218,4 +218,4 @@ Otherwise (file is NULL), assign untitled string to `filename`. -Up: [Readme.md](Readme.md), Prev: [Section 12](sec12.md), Next: [Section 14](sec14.md) +Up: [Readme.md](../Readme.md), Prev: [Section 12](sec12.md), Next: [Section 14](sec14.md) diff --git a/sec14.md b/gfm/sec14.md similarity index 98% rename from sec14.md rename to gfm/sec14.md index 0801ff6..75ed6be 100644 --- a/sec14.md +++ b/gfm/sec14.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 13](sec13.md), Next: [Section 15](sec15.md) +Up: [Readme.md](../Readme.md), Prev: [Section 13](sec13.md), Next: [Section 15](sec15.md) # tfeapplication.c @@ -269,4 +269,4 @@ First, get the top level window and call `gtk_window_destroy`. In this file, just the source file names are modified. -Up: [Readme.md](Readme.md), Prev: [Section 13](sec13.md), Next: [Section 15](sec15.md) +Up: [Readme.md](../Readme.md), Prev: [Section 13](sec13.md), Next: [Section 15](sec15.md) diff --git a/sec15.md b/gfm/sec15.md similarity index 99% rename from sec15.md rename to gfm/sec15.md index 0e08098..7203915 100644 --- a/sec15.md +++ b/gfm/sec15.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 14](sec14.md), Next: [Section 16](sec16.md) +Up: [Readme.md](../Readme.md), Prev: [Section 14](sec14.md), Next: [Section 16](sec16.md) # tfe5 source files @@ -621,4 +621,4 @@ The followings are the source files of tfe5. 64 105 2266 tfe5/tfe.ui 576 1507 17864 total -Up: [Readme.md](Readme.md), Prev: [Section 14](sec14.md), Next: [Section 16](sec16.md) +Up: [Readme.md](../Readme.md), Prev: [Section 14](sec14.md), Next: [Section 16](sec16.md) diff --git a/sec16.md b/gfm/sec16.md similarity index 96% rename from sec16.md rename to gfm/sec16.md index 7177ddb..d823bd1 100644 --- a/sec16.md +++ b/gfm/sec16.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 15](sec15.md), Next: [Section 17](sec17.md) +Up: [Readme.md](../Readme.md), Prev: [Section 15](sec15.md), Next: [Section 17](sec17.md) # Menu and action @@ -7,7 +7,7 @@ Up: [Readme.md](Readme.md), Prev: [Section 15](sec15.md), Next: [Section 17](se Users often use menus to tell the command to the computer. It is like this: -![Menu](image/menu.png) +![Menu](../image/menu.png) Now let's analyze the menu above. There are two types of object. @@ -20,7 +20,7 @@ They are called "menu". Menu is an ordered list of items. They are similar to arrays. -![Menu structure](image/menu_structure.png) +![Menu structure](../image/menu_structure.png) - Menubar is a menu which has three items, which are "File", "Edit" and "View". - The menu item labeled "Edit" has a link to the submenu which has two items. @@ -210,9 +210,9 @@ The structure of the menu is shown in the diagram below. - 30: Set GtkApplicationWindow to show the menubar. - 31: Show the window. -![menu and action](image/menu1.png) +![menu and action](../image/menu1.png) -![Screenshot of menu1](image/menu1_screenshot.png) +![Screenshot of menu1](../image/menu1_screenshot.png) -Up: [Readme.md](Readme.md), Prev: [Section 15](sec15.md), Next: [Section 17](sec17.md) +Up: [Readme.md](../Readme.md), Prev: [Section 15](sec15.md), Next: [Section 17](sec17.md) diff --git a/sec17.md b/gfm/sec17.md similarity index 98% rename from sec17.md rename to gfm/sec17.md index 2b193e7..8cc2214 100644 --- a/sec17.md +++ b/gfm/sec17.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 16](sec16.md), Next: [Section 18](sec18.md) +Up: [Readme.md](../Readme.md), Prev: [Section 16](sec16.md), Next: [Section 18](sec18.md) # Stateful action @@ -206,7 +206,7 @@ It is the string "s" given at the generation time. The following code includes stateful actions above. This program has menus like this: -![menu2](image/menu2.png) +![menu2](../image/menu2.png) - Fullscreen menu toggles the size of the window between maximum and non-maximum. If the window is maximum size, which is called full screen, then a check mark is put before "fullscreen" label. @@ -370,4 +370,4 @@ The provider is added to GdkDisplay. - 90: Show the window. -Up: [Readme.md](Readme.md), Prev: [Section 16](sec16.md), Next: [Section 18](sec18.md) +Up: [Readme.md](../Readme.md), Prev: [Section 16](sec16.md), Next: [Section 18](sec18.md) diff --git a/sec18.md b/gfm/sec18.md similarity index 98% rename from sec18.md rename to gfm/sec18.md index b7362b3..31b099d 100644 --- a/sec18.md +++ b/gfm/sec18.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 17](sec17.md) +Up: [Readme.md](../Readme.md), Prev: [Section 17](sec17.md) # Ui file for menu and action entries @@ -59,7 +59,7 @@ So, we usually prefer the former ui file style. The following is a screenshot of the sample program in this section. Its name is `menu3`. -![menu3](image/menu3.png) +![menu3](../image/menu3.png) The following is the ui file of the menu in `menu3`. @@ -338,4 +338,4 @@ meson.build 10 executable('menu3', sourcefiles, resources, dependencies: gtkdep) -Up: [Readme.md](Readme.md), Prev: [Section 17](sec17.md) +Up: [Readme.md](../Readme.md), Prev: [Section 17](sec17.md) diff --git a/sec2.md b/gfm/sec2.md similarity index 97% rename from sec2.md rename to gfm/sec2.md index 8bc4741..6ceea86 100644 --- a/sec2.md +++ b/gfm/sec2.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 1](sec1.md), Next: [Section 3](sec3.md) +Up: [Readme.md](../Readme.md), Prev: [Section 1](sec1.md), Next: [Section 3](sec3.md) # Installation of gtk4 to linux distributions @@ -170,4 +170,4 @@ For example, to compile `sample.c`, type the following. To know how to compile gtk4 applications, refer to the following sections. -Up: [Readme.md](Readme.md), Prev: [Section 1](sec1.md), Next: [Section 3](sec3.md) +Up: [Readme.md](../Readme.md), Prev: [Section 1](sec1.md), Next: [Section 3](sec3.md) diff --git a/sec3.md b/gfm/sec3.md similarity index 96% rename from sec3.md rename to gfm/sec3.md index 11018a6..e98f44e 100644 --- a/sec3.md +++ b/gfm/sec3.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 2](sec2.md), Next: [Section 4](sec4.md) +Up: [Readme.md](../Readme.md), Prev: [Section 2](sec2.md), Next: [Section 4](sec4.md) # GtkApplication and GtkApplicationWindow @@ -202,7 +202,7 @@ And GtkWidget is a base object from which all the GUI objects derive. GtkWindow includes GtkWidget at the top of its object. -![GtkWindow and GtkWidget](image/window_widget.png) +![GtkWindow and GtkWidget](../image/window_widget.png) The function `gtk_window_new` is defined as follows. @@ -253,7 +253,7 @@ Save the program as `pr3.c` and compile and run it. A small window appears. -![Screenshot of the window](image/screenshot_pr3.png) +![Screenshot of the window](../image/screenshot_pr3.png) Click on the close button then the window disappears and the program finishes. @@ -282,6 +282,6 @@ So you don't need to call `gtk_window_set_application` any more. The program sets the title and the default size of the window. Compile it and run `a.out`, then you will see a bigger window with its title "pr4". -![Screenshot of the window](image/screenshot_pr4.png) +![Screenshot of the window](../image/screenshot_pr4.png) -Up: [Readme.md](Readme.md), Prev: [Section 2](sec2.md), Next: [Section 4](sec4.md) +Up: [Readme.md](../Readme.md), Prev: [Section 2](sec2.md), Next: [Section 4](sec4.md) diff --git a/sec4.md b/gfm/sec4.md similarity index 96% rename from sec4.md rename to gfm/sec4.md index 1472a76..c3d776c 100644 --- a/sec4.md +++ b/gfm/sec4.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 3](sec3.md), Next: [Section 5](sec5.md) +Up: [Readme.md](../Readme.md), Prev: [Section 3](sec3.md), Next: [Section 5](sec5.md) # Widgets (1) @@ -49,7 +49,7 @@ Then compile and run it. A window with a message "Hello." appears. -![Screenshot of the label](image/screenshot_lb1.png) +![Screenshot of the label](../image/screenshot_lb1.png) There's only a little change between `pr4.c` and `lb1.c`. Diff is a good program to know the difference between two files. @@ -146,7 +146,7 @@ The suffix cb means "call back". Name the program `lb2.c` and save it. Now compile and run it. -![Screenshot of the label](image/screenshot_lb2.png) +![Screenshot of the label](../image/screenshot_lb2.png) A window with the button appears. Click the button (it is a large button, you can click everywhere inside the window), then a string "Clicked." appears on the shell terminal. @@ -233,7 +233,7 @@ The following procedure shows the way to add two buttons in a window. After this, the Widgets are connected as following diagram. -![Parent-child relationship](image/box.png) +![Parent-child relationship](../image/box.png) Now, code it. @@ -309,10 +309,10 @@ The next function fills a box with children, giving them equal space. After that, two buttons `btn1` and `btn2` are generated and the signal handlers are set. Then, these two buttons are appended to the box. -![Screenshot of the box](image/screenshot_lb4.png) +![Screenshot of the box](../image/screenshot_lb4.png) The handler corresponds to `btn1` changes its label. The handler corresponds to `btn2` destroys the top-level window and the application quits. -Up: [Readme.md](Readme.md), Prev: [Section 3](sec3.md), Next: [Section 5](sec5.md) +Up: [Readme.md](../Readme.md), Prev: [Section 3](sec3.md), Next: [Section 5](sec5.md) diff --git a/sec5.md b/gfm/sec5.md similarity index 96% rename from sec5.md rename to gfm/sec5.md index 844e190..148928b 100644 --- a/sec5.md +++ b/gfm/sec5.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 4](sec4.md), Next: [Section 6](sec6.md) +Up: [Readme.md](../Readme.md), Prev: [Section 4](sec4.md), Next: [Section 6](sec6.md) # Widgets (2) @@ -70,7 +70,7 @@ In line 30, `tv` is set to `win` as a child. Now compile and run it. -![GtkTextView](image/screenshot_tfv1.png) +![GtkTextView](../image/screenshot_tfv1.png) There's an I-beam pointer in the window. You can add or delete any characters on GtkTextview. @@ -164,4 +164,4 @@ This time the window doesn't extend even if you type a lot of characters. It just scrolls. -Up: [Readme.md](Readme.md), Prev: [Section 4](sec4.md), Next: [Section 6](sec6.md) +Up: [Readme.md](../Readme.md), Prev: [Section 4](sec4.md), Next: [Section 6](sec6.md) diff --git a/sec6.md b/gfm/sec6.md similarity index 97% rename from sec6.md rename to gfm/sec6.md index 90a4943..b7c8442 100644 --- a/sec6.md +++ b/gfm/sec6.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 5](sec5.md), Next: [Section 7](sec7.md) +Up: [Readme.md](../Readme.md), Prev: [Section 5](sec5.md), Next: [Section 7](sec7.md) # Widgets (3) @@ -152,7 +152,7 @@ Then compile and run it. $ comp tfv3 $ ./a.out tfv3.c -![File viewer](image/screenshot_tfv3.png) +![File viewer](../image/screenshot_tfv3.png) Now I want to explain the program `tfv3.c`. First, the function `main` changes in only two lines. @@ -199,7 +199,7 @@ If it fails, it outputs an error message and destroys the window. GtkNotebook is a container widget that contains multiple children with tabs in it. -![GtkNotebook](image/screenshot_gtk_notebook.png) +![GtkNotebook](../image/screenshot_gtk_notebook.png) Look at the screenshots above. The left one is a window at the startup. @@ -304,4 +304,4 @@ The numbers at the left of the following items are line numbers in the source co - 53-56: If at least one file was read, then the number of GtkNotebookPage is greater than zero. If it's true, then show the window. If it's false, then destroy the window. -Up: [Readme.md](Readme.md), Prev: [Section 5](sec5.md), Next: [Section 7](sec7.md) +Up: [Readme.md](../Readme.md), Prev: [Section 5](sec5.md), Next: [Section 7](sec7.md) diff --git a/sec7.md b/gfm/sec7.md similarity index 98% rename from sec7.md rename to gfm/sec7.md index 8b61eaa..7334e6c 100644 --- a/sec7.md +++ b/gfm/sec7.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 6](sec6.md), Next: [Section 8](sec8.md) +Up: [Readme.md](../Readme.md), Prev: [Section 6](sec6.md), Next: [Section 8](sec8.md) # Define Child object @@ -41,7 +41,7 @@ What we are thinking about now is "child object". A child object includes its parent object. And a child object derives everything from the parent object. -![Child widget of GtkTwxtView](image/child.png) +![Child widget of GtkTwxtView](../image/child.png) We will define TfeTextView as a child object of GtkTextView. It has everything that GtkTextView has. @@ -349,4 +349,4 @@ We need more features like open, save, saveas, change font and so on. We will add them in the next section and after. -Up: [Readme.md](Readme.md), Prev: [Section 6](sec6.md), Next: [Section 8](sec8.md) +Up: [Readme.md](../Readme.md), Prev: [Section 6](sec6.md), Next: [Section 8](sec8.md) diff --git a/sec8.md b/gfm/sec8.md similarity index 98% rename from sec8.md rename to gfm/sec8.md index f2d22b3..c04730a 100644 --- a/sec8.md +++ b/gfm/sec8.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 7](sec7.md), Next: [Section 9](sec9.md) +Up: [Readme.md](../Readme.md), Prev: [Section 7](sec7.md), Next: [Section 9](sec9.md) # Ui file and GtkBuiler @@ -11,7 +11,7 @@ It is better to make "New", "Open", "Save" and "Close" buttons. This section describes how to put those buttons into the window. Signals and handlers will be explained later. -![Screenshot of the file editor](image/screenshot_tfe2.png) +![Screenshot of the file editor](../image/screenshot_tfe2.png) The screenshot above shows the layout. The function `on_open` in the source code `tfe2.c` is as follows. @@ -452,4 +452,4 @@ Then, compile and run it. The window appears and it is the same as the screenshot at the beginning of this page. -Up: [Readme.md](Readme.md), Prev: [Section 7](sec7.md), Next: [Section 9](sec9.md) +Up: [Readme.md](../Readme.md), Prev: [Section 7](sec7.md), Next: [Section 9](sec9.md) diff --git a/sec9.md b/gfm/sec9.md similarity index 98% rename from sec9.md rename to gfm/sec9.md index 100445f..f1028bc 100644 --- a/sec9.md +++ b/gfm/sec9.md @@ -1,4 +1,4 @@ -Up: [Readme.md](Readme.md), Prev: [Section 8](sec8.md), Next: [Section 10](sec10.md) +Up: [Readme.md](../Readme.md), Prev: [Section 8](sec8.md), Next: [Section 10](sec10.md) # Build system @@ -425,4 +425,4 @@ We divided a file into some categorized files and used a build tool. This method is used by many developers. -Up: [Readme.md](Readme.md), Prev: [Section 8](sec8.md), Next: [Section 10](sec10.md) +Up: [Readme.md](../Readme.md), Prev: [Section 8](sec8.md), Next: [Section 10](sec10.md)