remove menu
This commit is contained in:
parent
6963617025
commit
82083f1663
1 changed files with 3 additions and 15 deletions
18
mbiff/main.c
18
mbiff/main.c
|
|
@ -3,14 +3,14 @@
|
||||||
#include "mailempty.xpm"
|
#include "mailempty.xpm"
|
||||||
#include "mailfull.xpm"
|
#include "mailfull.xpm"
|
||||||
|
|
||||||
MwWidget window, menu, image, mail;
|
MwWidget window, image, mail;
|
||||||
MwLLPixmap empty, full;
|
MwLLPixmap empty, full;
|
||||||
static int waiting = 0;
|
static int waiting = 0;
|
||||||
static void* help_about;
|
static void* help_about;
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* user, void* client) {
|
static void resize(MwWidget handle, void* user, void* client) {
|
||||||
int w = MwGetInteger(handle, MwNwidth);
|
int w = MwGetInteger(handle, MwNwidth);
|
||||||
int h = MwGetInteger(handle, MwNheight) - MwGetInteger(menu, MwNheight);
|
int h = MwGetInteger(handle, MwNheight);
|
||||||
int iw = w < h ? w : h;
|
int iw = w < h ? w : h;
|
||||||
|
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
@ -18,7 +18,7 @@ static void resize(MwWidget handle, void* user, void* client) {
|
||||||
|
|
||||||
MwVaApply(image,
|
MwVaApply(image,
|
||||||
MwNx, (w - iw) / 2,
|
MwNx, (w - iw) / 2,
|
||||||
MwNy, MwGetInteger(menu, MwNheight) + (h - iw) / 2,
|
MwNy, (h - iw) / 2,
|
||||||
MwNwidth, iw,
|
MwNwidth, iw,
|
||||||
MwNheight, iw,
|
MwNheight, iw,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
@ -47,12 +47,6 @@ static void mouseUp(MwWidget handle, void* user, void* client) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_menu(MwWidget handle, void* user, void* client) {
|
|
||||||
if(client == help_about) {
|
|
||||||
MDEAboutDialog(window, "mbiff", VERSION, mail);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
void* m;
|
void* m;
|
||||||
|
|
||||||
|
|
@ -64,11 +58,6 @@ int main() {
|
||||||
MwNtitle, "mbiff",
|
MwNtitle, "mbiff",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
menu = MwCreateWidget(MwMenuClass, "menu", window, 0, 0, 0, 0);
|
|
||||||
|
|
||||||
m = MwMenuAdd(menu, NULL, "?Help");
|
|
||||||
help_about = MwMenuAdd(menu, m, "About");
|
|
||||||
|
|
||||||
empty = MwLoadImage(window, ICON128DIR "/mailempty.png");
|
empty = MwLoadImage(window, ICON128DIR "/mailempty.png");
|
||||||
full = MwLoadImage(window, ICON128DIR "/mailfull.png");
|
full = MwLoadImage(window, ICON128DIR "/mailfull.png");
|
||||||
mail = MwLoadImage(window, ICON128DIR "/mail.png");
|
mail = MwLoadImage(window, ICON128DIR "/mail.png");
|
||||||
|
|
@ -84,7 +73,6 @@ int main() {
|
||||||
|
|
||||||
resize(window, NULL, NULL);
|
resize(window, NULL, NULL);
|
||||||
|
|
||||||
MwAddUserHandler(menu, MwNmenuHandler, menu_menu, NULL);
|
|
||||||
MwAddUserHandler(image, MwNmouseUpHandler, mouseUp, NULL);
|
MwAddUserHandler(image, MwNmouseUpHandler, mouseUp, NULL);
|
||||||
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
||||||
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue