[squeak-dev] Host Window Support
Bert Freudenberg
bert at freudenbergs.de
Fri Jan 6 16:13:30 UTC 2012
On 06.01.2012, at 16:55, John McKeon wrote:
> I thought I would help out and test it on Windows.
> For some reason the mouse events from the HostWindow never reflect the button press. evt at: 5 always returns 0.
That's strange. HostWindowPlugin uses the same code to record mouse events as the regular window ...
> One other thing I noticed is the main Squeak window title changes to "Paint Test" and the host window title is "Squeak!".
> Tested on Win7 and XP with the cog vm v2522 13 Dec 2011
Hehe. Okay, that one is obviously a bug in the VM. It should really use SetWindowTextW(hwnd, ...:
sqInt ioSetTitleOfWindow(sqInt windowIndex, char * newTitle, sqInt sizeOfTitle) {
HWND hwnd = (windowIndex == 1 ? stWindow : ((HWND)windowIndex));
char titleString[1024];
WCHAR wideTitle[1024];
if(!IsWindow(hwnd)) return 0;
if (sizeOfTitle > 1023) sizeOfTitle = 1023;
strncpy(titleString, newTitle, sizeOfTitle);
titleString[sizeOfTitle] = 0;
MultiByteToWideChar(CP_UTF8, 0, titleString, -1, wideTitle, 1024);
if(SetWindowTextW(stWindow, wideTitle) == 0) return -1;
return sizeOfTitle;
}
- Bert -
More information about the Squeak-dev
mailing list
|