Commit 3802357a authored by Serge Zaitsev's avatar Serge Zaitsev Committed by GitHub

Merge pull request #2 from lawsonry/master

Add platform-specific examples and update readme
parents 0c80268f b4a8218c
......@@ -11,6 +11,65 @@ Works well on:
There is also a stub implementation that returns errors on attempt to create a tray menu.
# Setup
Before you can compile `tray`, you'll need to add an environment definition before the line where you include `tray.h`.
**For Windows:**
```c
#include <stdio.h>
#include <string.h>
#define TRAY_WINAPI 1
#include "tray.h"
...
```
**For Linux:**
```c
#include <stdio.h>
#include <string.h>
#define TRAY_APPINDICATOR 1
#include "tray.h"
...
```
**For Mac:**
**For Windows:**
```c
#include <stdio.h>
#include <string.h>
#define TRAY_APPKIT 1
#include "tray.h"
...
```
// For Linux:
//#define TRAY_APPINDICATOR 1
// For Mac:
//#define TRAY_APPKIT 1
# Demo
The included example `.c` files can be compiled based on your environment.
For example, to compile and run the program on Windows:
```shell
$> gcc example_windows.c [Enter]
```
This will compile and build `a.out`. To run it:
```
$> a [Enter]
```
# Example
```c
......
#include <stdio.h>
#include <string.h>
#if defined (_WIN32) || defined (_WIN64)
#define TRAY_WINAPI 1
#elif defined (__linux__) || defined (linux) || defined (__linux)
#define TRAY_APPINDICATOR 1
#elif defined (__APPLE__) || defined (__MACH__)
#define TRAY_APPKIT 1
#endif
#include "tray.h"
#if TRAY_APPINDICATOR
......
icon.ico

361 KB

icon.png

361 KB

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment