Skip to content

Commit 9a91cae

Browse files
committed
Add docs project and fix mistakes in existing Markdown files
The other platform projects have a proper Eclipse project set up for the docs folder. Their contents are then embedded into the Eclipse website. This change makes the existing docs folder of the SWT repository a proper Eclipse project as well and fixes invalid Markdown in the existing files. It prepares for the contents to be embedded in the website.
1 parent 367a0a6 commit 9a91cae

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

docs/.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.eclipse.swt.docs</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

docs/gtk-dev-guide.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ To learn about SWT, try out the snippets and examples in the repository. Search
235235

236236
You should learn at least:
237237
* Set of basic widgets (Button/Label/Table/Tree etc..)
238-
* Layouts (Absolute [i.e no layout]/Grid/Row/Column/FormAttach)
238+
* Layouts (Absolute, i.e no layout with Grid/Row/Column/FormAttach)
239239
* Attaching listeners
240240

241241
**General Widget Hierarchy**
@@ -557,7 +557,7 @@ If you inspect a widget, in almost every createHandle() method, you will see the
557557

558558
This means that SWT is creating a new instance of the SWTFixed container. Normally it then assigns something to the handle variable puts the widgets inside it.
559559

560-
Usually in GTK you create a drawing surface (GdkWindow) [note the 'd'] and draw one or several widgets inside it. In SWT, we create a new drawing surface (GdkWindow) for every single widget. This is very ineffective but gives SWT more control about drawing order and permits easier implementation of overlapping widgets. At this point it might be beneficial to understand that a GdkWindow is a drawing surface, where as a GtkWindow [note 't vs d' difference] is a shell with decorations like 'X', '-' and it interacts with the X drawing system. More will be discussed in the GTK sections that follow.
560+
Usually in GTK you create a drawing surface `GdkWindow` (note the 'd') and draw one or several widgets inside it. In SWT, we create a new drawing surface (GdkWindow) for every single widget. This is very ineffective but gives SWT more control about drawing order and permits easier implementation of overlapping widgets. At this point it might be beneficial to understand that a GdkWindow is a drawing surface, where as a `GtkWindow` (note 't vs d' difference) is a shell with decorations like 'X', '-' and it interacts with the X drawing system. More will be discussed in the GTK sections that follow.
561561

562562
**Technical C details**
563563

@@ -992,7 +992,9 @@ Launch your SWT application. In terminal execute jps (java processes) and identi
992992
2824 LayoutExample #<<< this is the SWT snippet.
993993

994994
As a side note, I often set the title of a snippet to the PID of the process. This way I don't have to look for it with jps anymore. To do this in java:
995-
<code>ManagementFactory.getRuntimeMXBean().getName().split("@")[0];</code>
995+
```
996+
ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
997+
```
996998

997999
In Eclipse, press Ctrl+3, then search for 'Debug Attached Executable'. (I usually search for 'attached' and it pops up). Search for 'java'. You should see a list of multiple java processes. Pick the one that has the PID of your snippet:
9981000

@@ -1052,7 +1054,7 @@ SWT Tools then copies code here (for debugging, don't edit as this folder is del
10521054
* This site is good for the conversion: http://www.binaryhexconverter.com/hex-to-decimal-converter
10531055
* You can also convert using the built in Long library in Java:
10541056
Long.toHexString (OS.gtk_widget_get_window(<handle>);
1055-
* Identify which GdkWindow maps to which GtkWidget using GtkInspector - see [images/Gdk_window.png](images/Gdk_window.png) or [images/README.md](images/README.md) for download instructions.
1057+
* Identify which GdkWindow maps to which GtkWidget using GtkInspector - see [images/Gdk_window.png](images/Gdk_window.png)
10561058
* Remember to cast when writing native GTK applications:
10571059
* GtkWidget *button, sometimes a function can accept any widget
10581060
* Bug you need to cast to a particular widget, i.e.: ((GtkButton*)button)->x

0 commit comments

Comments
 (0)