mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-09 10:53:27 +00:00
better focus
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@50 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
16
example.c
16
example.c
@@ -7,17 +7,19 @@ void handler(MwWidget handle, void* user_data, void* call_data){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
int i;
|
int y, x;
|
||||||
MwWidget window = MwVaCreateWidget(MwWindowClass, "main", NULL, 0, 0, 400, 400,
|
MwWidget window = MwVaCreateWidget(MwWindowClass, "main", NULL, 0, 0, 400, 260,
|
||||||
MwNtitle, "hello world",
|
MwNtitle, "hello world",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
for(i = 0; i < 6; i++){
|
for(y = 0; y < 5; y++){
|
||||||
MwWidget button = MwVaCreateWidget(MwButtonClass, "button", window, 5, 5 + 55 * i, 390, 50,
|
for(x = 0; x < 2; x++){
|
||||||
MwNtext, "lorem ipsum",
|
MwWidget button = MwVaCreateWidget(MwButtonClass, "button", window, 5 + 195 * x, 5 + 50 * y, 195, 50,
|
||||||
NULL);
|
MwNtext, "lorem ipsum",
|
||||||
|
NULL);
|
||||||
|
|
||||||
MwAddUserHandler(button, MwNactivateHandler, handler, NULL);
|
MwAddUserHandler(button, MwNactivateHandler, handler, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|||||||
MwLLDispatch(u->ll, draw);
|
MwLLDispatch(u->ll, draw);
|
||||||
EndPaint(hWnd, &ps);
|
EndPaint(hWnd, &ps);
|
||||||
} else if(msg == WM_LBUTTONDOWN) {
|
} else if(msg == WM_LBUTTONDOWN) {
|
||||||
|
SetCapture(hWnd);
|
||||||
MwLLDispatch(u->ll, down);
|
MwLLDispatch(u->ll, down);
|
||||||
InvalidateRect(hWnd, NULL, FALSE);
|
InvalidateRect(hWnd, NULL, FALSE);
|
||||||
} else if(msg == WM_LBUTTONUP) {
|
} else if(msg == WM_LBUTTONUP) {
|
||||||
|
SetCapture(NULL);
|
||||||
MwLLDispatch(u->ll, up);
|
MwLLDispatch(u->ll, up);
|
||||||
InvalidateRect(hWnd, NULL, FALSE);
|
InvalidateRect(hWnd, NULL, FALSE);
|
||||||
} else if(msg == WM_ERASEBKGND) {
|
} else if(msg == WM_ERASEBKGND) {
|
||||||
|
|||||||
Reference in New Issue
Block a user