mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-16 14:14:07 +00:00
menu
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@105 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
42
src/menu.c
Normal file
42
src/menu.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/* $Id$ */
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
static void set_xywh(MwWidget handle) {
|
||||
int height = 0;
|
||||
|
||||
height += 20;
|
||||
|
||||
MwVaApply(handle,
|
||||
MwNx, 0,
|
||||
MwNy, 0,
|
||||
MwNwidth, MwGetInteger(handle->parent, MwNwidth),
|
||||
MwNheight, height,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void create(MwWidget handle) {
|
||||
MwSetDefault(handle);
|
||||
|
||||
set_xywh(handle);
|
||||
}
|
||||
|
||||
static void draw(MwWidget handle) {
|
||||
MwRect r;
|
||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
r.width = MwGetInteger(handle, MwNwidth);
|
||||
r.height = MwGetInteger(handle, MwNheight);
|
||||
|
||||
MwDrawFrame(handle, &r, base, 0);
|
||||
MwDrawRect(handle, &r, base);
|
||||
}
|
||||
|
||||
MwClassRec MwMenuClassRec = {
|
||||
create, /* create */
|
||||
NULL, /* destroy */
|
||||
draw, /* draw */
|
||||
NULL /* click */
|
||||
};
|
||||
MwClass MwMenuClass = &MwMenuClassRec;
|
||||
Reference in New Issue
Block a user