diff --git a/tile.cxx b/tile.cxx new file mode 100644 index 0000000..e2b2419 --- /dev/null +++ b/tile.cxx @@ -0,0 +1,16 @@ +#include "tile.h" + +#include + +#include "event_handler.h" + + +class GTile : public EventHandler { +public: + GTile(int x, int y, int w, int h, const char *label) + : EventHandler(x, y, w, h, label) {} +}; + +GTile *go_fltk_new_Pack(int x, int y, int w, int h, const char *label) { + return new GTile(x, y, w, h, label); +} diff --git a/tile.go b/tile.go new file mode 100644 index 0000000..1c9e739 --- /dev/null +++ b/tile.go @@ -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 +} diff --git a/tile.h b/tile.h new file mode 100644 index 0000000..766701d --- /dev/null +++ b/tile.h @@ -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