Re: What am I doing wrong?
- Posted by Derek Parnell <ddparnell at bigpond.com> Sep 29, 2003
- 521 views
----- Original Message ----- From: <Louis at cwshop.com> To: "EUforum" <EUforum at topica.com> Subject: What am I doing wrong? > > > Although an experienced programmer, I know nothing about Windows programming > except what is in the Win32Lib documentation. Yes, well.... Those docs can do with a bit of 'rounding out' I suppose > I am trying to put text into a window that also has a button in it. This is > my test program: > > constant -- Win32 Setup > Win = create(Window, "Window Title", 0, > {0.5,-150}, {0.5, -220}, 300, 220, 0) > > --constant > -- Done = create(PushButton, {"Exit","Close window and exit."}, > -- Win, 150, 160, 60, 25, w32AUTOCLOSE) > > procedure onPaint_Win(integer x1, integer y1, integer x2, integer y2) > wPuts(Win, "This is some text") > end procedure > > onPaint[Win] = routine_id("onPaint_Win") > > WinMain(Win, Normal) > > This displays the text OK, but if I uncomment the lines to create a button, > the text disappears. Why? The other comments regarding this are all correct. My advice would be to use the LText control if you have static text to display. Just to tantalize you, in the next release of win32lib, you will be able to code your test program thus ... createForm ({ "Window, Window Title, left=Center, top=Center," & "width=300, height=220", "Text,This is some text", "Button, Exit, tooltip=Close window and exit," & "left=150, top=160,flag=AUTOCLOSE" }) startApp(w32NoCallBack) The documentation is almost completed for the next release, and some testing is still to be completed. -- Derek