Skip to content

Commit

Permalink
Merge pull request #81 from MoAlyousef/main
Browse files Browse the repository at this point in the history
adds a Tile widget
  • Loading branch information
pwiecz committed Jun 26, 2023
2 parents 93b83da + 46b8b94 commit 39848df
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tile.cxx
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);
}
17 changes: 17 additions & 0 deletions tile.go
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
}
14 changes: 14 additions & 0 deletions tile.h
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

0 comments on commit 39848df

Please sign in to comment.