Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tray
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
tray
Commits
3802357a
Commit
3802357a
authored
Aug 22, 2017
by
Serge Zaitsev
Committed by
GitHub
Aug 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from lawsonry/master
Add platform-specific examples and update readme
parents
0c80268f
b4a8218c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
0 deletions
+67
-0
README.md
README.md
+59
-0
example.c
example.c
+8
-0
icon.ico
icon.ico
+0
-0
icon.png
icon.png
+0
-0
No files found.
README.md
View file @
3802357a
...
@@ -11,6 +11,65 @@ Works well on:
...
@@ -11,6 +11,65 @@ Works well on:
There is also a stub implementation that returns errors on attempt to create a tray menu.
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
# Example
```
c
```
c
...
...
example.c
View file @
3802357a
#include <stdio.h>
#include <stdio.h>
#include <string.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"
#include "tray.h"
#if TRAY_APPINDICATOR
#if TRAY_APPINDICATOR
...
...
icon.ico
0 → 100644
View file @
3802357a
361 KB
icon.png
0 → 100644
View file @
3802357a
361 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment