Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds a Tile widget #81

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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