nanogui: Thread: Create buttons in microwin


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Create buttons in microwin
From: tan yongzai ####@####.####
Date: 1 Aug 2006 11:15:08 +0100
Message-Id: <20060801101502.74254.qmail@web33109.mail.mud.yahoo.com>

Hi guyz,

  I am using the Win32 API to port the microwin to embedded linux. I am unsuccessful in creating buttons in microwin. Any help is appreciated.
Here's the button coding that work in embedded vc4.0++.

static HWND hOk;
TCHAR* item = TEXT("BUTTON");    
TCHAR* label = TEXT("OK");    

hOk = CreateWindow(item, label, WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE, 0, GetSystemMetrics(SM_CYSCREEN)-26, 120, 26, hWnd, (HMENU)IDOK, 0, 0L);                
ShowWindow(hOk, SW_SHOWNORMAL);

In microwin, I also add
#define IDOK 1

What am I missing here?

Thanks and Regards,
YongZai

 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.
Subject: Re: [nanogui] Create buttons in microwin
From: "Greg Haerr" ####@####.####
Date: 9 Aug 2006 04:31:07 +0100
Message-Id: <04d301c6bb64$2ce6ba40$6401a8c0@winXP>

: static HWND hOk;
: TCHAR* item = TEXT("BUTTON");
: TCHAR* label = TEXT("OK");
:
: hOk = CreateWindow(item, label, WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE, 0,
GetSystemMetrics(SM_CYSCREEN)-26, 120, 26, hWnd, (HMENU)IDOK, 0, 0L);
: ShowWindow(hOk, SW_SHOWNORMAL);

The code looks fine, I can only think perhaps the GetSystemMetrics
isn't returning a valid value for the y coordinate, perhaps change
x,y to hard values.  Of course, hWnd needs to be valid.

There's no need for the ShowWindow, since you already
list WS_VISIBLE in the flags.

Regards,

Greg

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


Powered by ezmlm-browse 0.20.