Esempio n. 1
0
package wx

//#include "gdidim.h"
//#include <wx/defs.h>
import "C"

// int Width, Height
type Size C.Size

// int X, Y
type Point C.Point

// int X, Y, Size, Point
type Rect C.Rect

var (
	DefaultCoord    int   = int(C.wxDefaultCoord)
	DefaultSize     Size  = Size(C.Get_wxDefaultSize())
	DefaultPosition Point = Point(C.Get_wxDefaultPosition())
	//BUG:
	DefaultRect Rect = Rect{-1, -1, -1, -1}
)
Esempio n. 2
0
File: gdidim.go Progetto: nzlov/wxgo
func (r *Rect) Width() int {
	return int(r.W)
}

func (r *Rect) Height() int {
	return int(r.H)
}

func (r *Rect) SetWidth(w int) {
	r.W = C.int(w)
}

func (r *Rect) SetHeight(h int) {
	r.H = C.int(h)
}

func NewRect(x, y, width, height int) *Rect {
	return &Rect{C.int(x), C.int(y), C.int(width), C.int(height)}
}

func goRect(rc C.Rect) *Rect {
	return (*Rect)(&rc)
}

var (
	DefaultCoord    int    = int(C.wxDefaultCoord)
	DefaultSize     *Size  = goSize(C.Get_wxDefaultSize())
	DefaultPosition *Point = goPoint(C.Get_wxDefaultPosition())
)