Skip to content

Commit

Permalink
docs(gtk): adding GTK GUI development guide (#1472)
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy authored Aug 14, 2024
1 parent 83261e1 commit e773444
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Please follow these guidelines when contributing to the project:
You can use these commands in the Makefile:

- `make build` compiles the code into executable binaries.
- `make build_gui` compiles the gtk GUI code into executable binary.
- `make devtools` installs required development tools.
- `make fmt` formats the code according to the Go standards.
- `make check` runs checks on the code, including formatting and linting.
Expand All @@ -27,6 +28,10 @@ You can use these commands in the Makefile:
- `make proto` generates [protobuf](https://protobuf.dev/) files.
Run this target if you have made any changes to the proto buffer files.

### GUI Development

Development of the Pactus Core GUI have some requirements on your machine which you can find a [quick guide about it here](./docs/gtk-gui-development.md).

### Error and Log Messages

Error and log messages should not start with a capital letter (unless it's a proper noun or acronym) and
Expand Down Expand Up @@ -115,4 +120,4 @@ Please read it before contributing to the project.

---

Thank you for your contributions to Pactus blockchain!
Thank you for your contributions to the Pactus blockchain!
52 changes: 52 additions & 0 deletions docs/gtk-gui-development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Pactus GUI

This document is quick guide for developing and updating [the Pactus Core GUI](../cmd/gtk/).

## Requirements

The Pactus Core GUI utilizes gtk for desktop GUI. To develop, build and test it you must have these packages installed:

### Linux

1. `libgtk-3-dev`
2. `libcairo2-dev`
3. `libglib2.0-dev`

Install using apt:

```bash
apt install libgtk-3-dev libcairo2-dev libglib2.0-dev
```

### Mac OS

1. `gtk+3`

Install using brew:

```bash
brew install gtk+3
```

### Windows

1. `glib2-devel`
2. `mingw-w64-x86_64-go`
3. `mingw-w64-x86_64-gtk3`
4. `mingw-w64-x86_64-glib2`
5. `mingw-w64-x86_64-gcc`
6. `mingw-w64-x86_64-pkg-config`


With these packages installed you can build GUI using `make build_gui` command. You can run the GUI like: `./pactus-gui`, `./pactus-gui.exe`.


The [Assets](../cmd/gtk/assets/) file includes required images, icons, ui files and custom CSS files. All [`.ui`](../cmd/gtk/assets/ui/) files are used to defined the user interface of GUI, for a proper edit and change on them make sure you have [Glade](https://gitlab.gnome.org/GNOME/glade) installed on your machine.

## Running linter

When you make changes on GUI files and try to run linter using `make check`, it won't include [gtk](../cmd/gtk/) in it's checks. So make sure you add gtk build flag like this:

```bash
BUILD_TAG=gtk make check
```

0 comments on commit e773444

Please sign in to comment.