1. Pretend example problem
- Posted by don cole <doncole at pacbell.net> Oct 12, 2006
- 496 views
Hello everyone. In the Pretend.exw example from Win32lib I attempted to add a PushButton. ----------------------------------------------------------------------------- -- the gui constant Win = create( Window, "Pretender", 0, Default, Default, WinWide, WinHigh+26, 0 ), Buffer = create( Pixmap, "", 0, 0, 0, WinWide, WinHigh, 0 ) constant PushBu8utton3 = create( PushButton, "Hello", Win, 10, 10, 148, 20, 0) ----------------------------------------------------------------------------- But it does not show up on screen. anyone know why? Don Cole
2. Re: Pretend example problem
- Posted by "Greg Haberek" <ghaberek at gmail.com> Oct 12, 2006
- 481 views
Later in the code, the Pixmap 'Buffer' is being blitted to the entire screen. On 10/12/06, don cole <guest at rapideuphoria.com> wrote: > > > posted by: don cole <doncole at pacbell.net> > > > Hello everyone. > > In the Pretend.exw example from Win32lib I attempted to add a PushButton. > > > ----------------------------------------------------------------------------- > -- the gui > constant > Win = create( Window, "Pretender", 0, Default, Default, WinWide, > WinHigh+26, 0 ), > Buffer = create( Pixmap, "", 0, 0, 0, WinWide, WinHigh, 0 ) > > constant PushBu8utton3 = create( PushButton, "Hello", Win, 10, 10, 148, 20, > 0) > ----------------------------------------------------------------------------- > But it does not show up on screen. anyone know why? > Don Cole > > > >
3. Re: Pretend example problem
- Posted by don cole <doncole at pacbell.net> Oct 12, 2006
- 494 views
- Last edited Oct 13, 2006
Greg Haberek wrote: > > Later in the code, the Pixmap 'Buffer' is being blitted to the entire screen. > > On 10/12/06, don cole <guest at rapideuphoria.com> wrote: > > > > > > posted by: don cole <doncole at pacbell.net> > > > > > > Hello everyone. > > > > In the Pretend.exw example from Win32lib I attempted to add a PushButton. > > > > > > > > ----------------------------------------------------------------------------- > > -- the gui > > constant > > Win = create( Window, "Pretender", 0, Default, Default, WinWide, > > WinHigh+26, 0 ), > > Buffer = create( Pixmap, "", 0, 0, 0, WinWide, WinHigh, 0 ) > > > > constant PushBu8utton3 = create( PushButton, "Hello", Win, 10, 10, 148, 20, > > 0) > > > > ----------------------------------------------------------------------------- > > But it does not show up on screen. anyone know why? > > Don Cole > > > > Thank you Greg, So to make the pushButton show up on every tick one must Cut a hole in the buffer at that point. Or what? I appreciate your help Don Cole
4. Re: Pretend example problem
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 12, 2006
- 477 views
- Last edited Oct 13, 2006
don cole wrote: > > Greg Haberek wrote: > > > > Later in the code, the Pixmap 'Buffer' is being blitted to the entire > > screen. > > > > On 10/12/06, don cole <guest at rapideuphoria.com> wrote: > > > > > > > > > posted by: don cole <doncole at pacbell.net> > > > > > > > > > Hello everyone. > > > > > > In the Pretend.exw example from Win32lib I attempted to add a PushButton. > > > > > > > > > > > > ----------------------------------------------------------------------------- > > > -- the gui > > > constant > > > Win = create( Window, "Pretender", 0, Default, Default, WinWide, > > > WinHigh+26, 0 ), > > > Buffer = create( Pixmap, "", 0, 0, 0, WinWide, WinHigh, 0 ) > > > > > > constant PushBu8utton3 = create( PushButton, "Hello", Win, 10, 10, 148, > > > 20, > > > 0) > > > > > > ----------------------------------------------------------------------------- > > > But it does not show up on screen. anyone know why? > > > Don Cole > > > > > > > Thank you Greg, > > So to make the pushButton show up on every tick one must Cut a hole in the > buffer > at that point. Or what? > > I appreciate your help > I don't think it's a good idea to have the button overlay the playing area so I'd place it outisde the playfield. For example, if I put it above the playfield,... (a) Add this line after the line 'sequence mountains' integer PlayfieldTop (b) at the beginning of the 'initialize' routine enter these four lines ... sequence btnsize btnsize = getRect(Btn) PlayfieldTop = btnsize[2] + btnsize[4] setClientRect(Win, WinWide, WinHigh + PlayfieldTop) (c) Replace the two copyBlt() lines with ... copyBlt( Win, 0, PlayfieldTop, Buffer ) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
5. Re: Pretend example problem
- Posted by "Greg Haberek" <ghaberek at gmail.com> Oct 13, 2006
- 474 views
> So to make the pushButton show up on every tick one must Cut a hole in the > buffer at that point. Or what? Well, you can make the Pixmap the parent of the PushButon, or make the Windows slightly taller and put it below the Pixmap.
6. Re: Pretend example problem
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 13, 2006
- 491 views
Greg Haberek wrote: > > > So to make the pushButton show up on every tick one must Cut a hole in the > buffer at that point. Or what?</font></i> > > Well, you can make the Pixmap the parent of the PushButon Except that Pixmap's don't have parents. Bitmaps do, but not Pixmaps. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
7. Re: Pretend example problem
- Posted by don cole <doncole at pacbell.net> Oct 13, 2006
- 484 views
Derek Parnell wrote: > > don cole wrote: > > > > Greg Haberek wrote: > > > > > > Later in the code, the Pixmap 'Buffer' is being blitted to the entire > > > screen. > > > > > > On 10/12/06, don cole <guest at rapideuphoria.com> wrote: > > > > > > > > > > > > posted by: don cole <doncole at pacbell.net> > > > > > > > > > > > > Hello everyone. > > > > > > > > In the Pretend.exw example from Win32lib I attempted to add a > > > > PushButton. > > > > > > > > > > > > > > > > ----------------------------------------------------------------------------- > > > > -- the gui > > > > constant > > > > Win = create( Window, "Pretender", 0, Default, Default, WinWide, > > > > WinHigh+26, 0 ), > > > > Buffer = create( Pixmap, "", 0, 0, 0, WinWide, WinHigh, 0 ) > > > > > > > > constant PushBu8utton3 = create( PushButton, "Hello", Win, 10, 10, 148, > > > > 20, > > > > 0) > > > > > > > > ----------------------------------------------------------------------------- > > > > But it does not show up on screen. anyone know why? > > > > Don Cole > > > > > > > > > > Thank you Greg, > > > > So to make the pushButton show up on every tick one must Cut a hole in the > > buffer > > at that point. Or what? > > > > I appreciate your help > > > > I don't think it's a good idea to have the button overlay the playing area so > I'd place it outisde the playfield. For example, if I put it above the > playfield,... > > > (a) Add this line after the line 'sequence mountains' > > integer PlayfieldTop > > (b) at the beginning of the 'initialize' routine enter these four lines ... > > sequence btnsize > > btnsize = getRect(Btn) > PlayfieldTop = btnsize[2] + btnsize[4] > setClientRect(Win, WinWide, WinHigh + PlayfieldTop) > > (c) Replace the two copyBlt() lines with ... > > copyBlt( Win, 0, PlayfieldTop, Buffer ) > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Thank you Derek and Greg, What I am really tring to do is place a button in a window with a constantly moving pixmap. (not a game). I will try Dereks idea of putting a smaller pixmap in the window and Greg's idea of putting the button below the pixmap. I haven't tried anything yet as I just got home from work and just read your posts. I'm tired now and will do it later but I don't see any reason it won't work. Thanks again, Don Cole