[PythonCE] Tkinter issues

Anne Wangnick anne.wangnick at t-online.de
Tue Jan 4 16:18:06 CET 2005


Dear all,

my application is based on Tkinter, not wxPython, so please excuse when I'm
asking a question about good ole Tkinter here ...

I was annoyed by the fact that the Tkinter Toplevel windows on the PDA all
come sizeable and with that additional titlebar, eating up valuable screen
estate.

So I had the idea to do the following:
	import Tkinter
	import win32gui
	GWL_EXSTYLE = -20
	WS_EX_NODRAG = 0x40000000
	tk = Tkinter.Tk()
	hwnd = tk.winfo_id()
	wsex = win32gui.GetWindowLong(hwnd,GWL_EXSTYLE)
	win32gui.SetWindowLong(hwnd,GWL_EXSTYLE,wsex|WS_EX_NODRAG)

This "works" on the PC (though the WS_EX_NODRAG is not respected, of
course). wsex is returned as 4 (WS_EX_NOPARENTNOTIFY), which is in line with
the Tk CreateWindowEx call in tkWinWindow.c:TkpMakeWindow:
	hwnd = CreateWindowEx(WS_EX_NOPARENTNOTIFY, TK_WIN_CHILD_CLASS_NAME, NULL,
		style, Tk_X(winPtr), Tk_Y(winPtr), Tk_Width(winPtr),
		Tk_Height(winPtr), parentWin, NULL, Tk_GetHINSTANCE(), NULL);

However, the GetWindowLong and SetWindowLong calls always come back with 0
on the PDA!

Alternatively, I tried the same with hwnd = eval(tk.wm_frame()). Same story,
GetWindowLong and SetWindowLong return 0.

Any idea why this isn't working?

I'd love to call GetLastError on the PDA now, but this is in the pywin
win32api module, and this is not available on the PDA!

Any way win32api could be built for the PDA? I'd give it a try myself, but I
don't have a build environment handy.

Regards,
Sebastian



More information about the PythonCE mailing list