-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from MoAlyousef/main
adds a Tile widget
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "tile.h" | ||
|
||
#include <FL/Fl_Tile.H> | ||
|
||
#include "event_handler.h" | ||
|
||
|
||
class GTile : public EventHandler<Fl_Tile> { | ||
public: | ||
GTile(int x, int y, int w, int h, const char *label) | ||
: EventHandler<Fl_Tile>(x, y, w, h, label) {} | ||
}; | ||
|
||
GTile *go_fltk_new_Tile(int x, int y, int w, int h, const char *label) { | ||
return new GTile(x, y, w, h, label); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package fltk | ||
|
||
/* | ||
#include "tile.h" | ||
*/ | ||
import "C" | ||
import "unsafe" | ||
|
||
type Tile struct { | ||
Group | ||
} | ||
|
||
func NewTile(x, y, w, h int, text ...string) *Tile { | ||
t := &Tile{} | ||
initWidget(t, unsafe.Pointer(C.go_fltk_new_Tile(C.int(x), C.int(y), C.int(w), C.int(h), cStringOpt(text)))) | ||
return t | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct Fl_Tile Fl_Tile; | ||
typedef struct GTile GTile; | ||
|
||
extern GTile *go_fltk_new_Tile(int x, int y, int w, int h, const char *text); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |