nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: Re: Re: Button problem.
From: debit
Date: Thu, 31 Aug 2000 10:11:35 +0800

Hello,Greg Haerr.

>This is probably complicated.  Are you
>running in Win32 or Nano-X API?  The problem is 
>likely that the server doesn't pass the button the UP
>event after the mouse has moved away from the
>button.  In the Win32 API, you have to capture the mouse
>when the button is down.
>
>Which demo are you running?  Is this problem with
>the BUTTON control or with the scrollbar buttons?
>

I'm running the application in Win32,using the linux os.
The application has some buttons

I use the following method to create BUTTON control:        
    CreateWindowEx(0L, "BUTTON", "Click me",
                   BS_PUSHBUTTON| WS_CHILD | WS_VISIBLE,
                   10, 50, 60, 20,
                   hwnd, (HMENU)EVENTBTN, NULL, NULL);
              
In the and catch the button event when it receive WM_COMMAND message:
    case WM_COMMAND:
         switch(LOWORD(wParam)) {
	     case EVENTBTN : 
		  if( HIWORD(wParam) == BN_CLICKED)
		      SetWindowText( hwnd_txt, (LPSTR)" Hello World!");
		      break;
                  ....
         }
         ....

I find out when this happens, the "break;" line has been executed.
In other word,it has already returned by the event CALLBACK function.

Best regard.

            debit
            debit@21cn.com


nanogui@linuxhacker.org