From: Daan L. <daa...@xs...> - 2003-12-01 12:32:49
|
Hi Martin, > Both tricks works perfectly, however the program launch still looks a bit > nasty because the main window always starts up with a default width/height > and the resizes to whatever I specified. This happens even though I use: > > f <- frameFixed [text := "Hello", clientSize := size 100 100] > > Is there a known work-around for this problem? This behaviour is a somewhat intertwined with wxWindows itself. The "WX" layer tries to abstract from the basic wxWindows calls (in WXCore) and is very dynamic: that is, a frame is first created with some unspecified width and height, and later it is changed to the "clientSize" specified in the attribute list. One would expect that the window would only be shown once the layout is set, but unfortunately, that is not how wxWindows works. I could solve this by requiring an initial widht and height as a parameter to "frame" (or "frameFixed") but I feel that is somewhat against the spirit of the WX design. Another solution that I am contemplating is the use of reflective attributes where the constructor would look in the list of attributes to see if an initial size is specified. This would solve your troubles but it is kind of unsatifying that this would create a distinction between: > f <- frame [attr := expr] and > f <- frame [] > set f [attr := expr] Anyhow, I think that I will implement the latter solution anyway, so your program will work as expected in the next release. All the best, Daan. |