nanogui: Thread: Button problem.


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Button problem.
From: debit ####@####.####
Date: 29 Aug 2000 01:20:13 -0000
Message-Id:

hi allnanogui,
     
       In the microwindows application, when I click a button, 
sometimes the button isn't not up, just remain the BUTTONDOWN status.
When this happens, all other event is not responsed until I click 
the "not up" button again.

Can anyone tell me how to prevent this? Thanks.
 
Regards.

__

Debit  ####@####.####
Aug 28th,2000
            

Subject: Re: Button problem.
From: "Greg Haerr" ####@####.####
Date: 30 Aug 2000 16:32:57 -0000
Message-Id: <031b01c012a0$049031c0$15320cd0@gregh>

:        In the microwindows application, when I click a button, 
: sometimes the button isn't not up, just remain the BUTTONDOWN status.
: When this happens, all other event is not responsed until I click 
: the "not up" button again.

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?

Regards,

Greg

Subject: Re: Re: Button problem.
From: debit ####@####.####
Date: 31 Aug 2000 02:12:11 -0000
Message-Id:

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
            ####@####.####

Subject: Re: Re: Button problem.
From: "Greg Haerr" ####@####.####
Date: 31 Aug 2000 02:36:43 -0000
Message-Id: <03e301c012f4$5e8b94e0$15320cd0@gregh>

: 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;
:                   ....
:          }


Hmmm..  It seems that perhaps there's a race
condition in having SetWindowText end up demanding
a non-client area paint before having returned from
the original window procedure...  

Does this code always draw incorrectly, that is,
whenever executing a SetWindowText in a buttondown
handler?

Regards,

Greg


Subject: Re: Re: Button problem.
From: debit ####@####.####
Date: 1 Sep 2000 01:54:23 -0000
Message-Id:

Hello,Greg Haerr.

>Hmmm..  It seems that perhaps there's a race
>condition in having SetWindowText end up demanding
>a non-client area paint before having returned from
>the original window procedure...  
>
>Does this code always draw incorrectly, that is,
>whenever executing a SetWindowText in a buttondown
>handler?
>
>Regards,
>
>Greg

But this doesn't happen every times.
I think SetWindowText is not the causer.
because I just create two Buttons whick do nothing,
and click them by turn quickly, this happens.

Best regard.

            debit
            ####@####.####

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.