1. help on this window...

in this .exw it won't let me put the last 2 MenuItems in the About menu...
why?

atom x
include win32lib.ew
without warning

constant
win = create(Window, "TETRIS", 0, Default, Default, 400,400,0),
file = create(Menu, "File", win,0,0,0,0,0),
newgame = create(MenuItem, "New", file,0,0,0,0,0),
loadfile = create(MenuItem, "Open", file,0,0,0,0,0),
score = create(MenuItem, "High Scores", file,0,0,0,0,0),
quit = create(MenuItem, "Close",file,0,0,0,0,0),
options = create(Menu, "Options", win,0,0,0,0,0),
level = create(MenuItem, "Level", options,0,0,0,0,0),
omusic = create(MenuItem, "turn Sound on", options,0,0,0,0,0),
fmusic = create(MenuItem, "turn Sound off", options,0,0,0,0,0),
helpgame = create(Menu, "Help", win,0,0,0,0,0),
About = create(MenuItem, "About", help,0,0,0,0,0),
Guide = create(MenuItem, "About", help,0,0,0,0,0)

--These two commands are cuase some kind of problem... When i try and run the
program, it tells me that 'help' has not been declared... but since its a
Menu directory... it doesn't need declareing right??--


x = read_bitmap("c:\\windows\\desktop\\tetris.bmp")
-- note: double backslash needed to get single backslash in a string

setWindowBackColor(win, Black)
-- new code starts here
procedure Close()
closeWindow(win)
end procedure
onClick[quit] = routine_id("Close")

WinMain(win,Normal)

    ~Thanks for all your help~

new topic     » topic index » view message » categorize

2. Re: help on this window...

Hi Alex


> in this .exw it won't let me put the last 2 MenuItems in the About menu...
> why?
>
> atom x
> include win32lib.ew
> without warning
>
> constant
> win = create(Window, "TETRIS", 0, Default, Default, 400,400,0),
> file = create(Menu, "File", win,0,0,0,0,0),
> newgame = create(MenuItem, "New", file,0,0,0,0,0),
> loadfile = create(MenuItem, "Open", file,0,0,0,0,0),
> score = create(MenuItem, "High Scores", file,0,0,0,0,0),
> quit = create(MenuItem, "Close",file,0,0,0,0,0),
> options = create(Menu, "Options", win,0,0,0,0,0),
> level = create(MenuItem, "Level", options,0,0,0,0,0),
> omusic = create(MenuItem, "turn Sound on", options,0,0,0,0,0),
> fmusic = create(MenuItem, "turn Sound off", options,0,0,0,0,0),


Try changing this....

> helpgame = create(Menu, "Help", win,0,0,0,0,0),
> About = create(MenuItem, "About", help,0,0,0,0,0),
> Guide = create(MenuItem, "About", help,0,0,0,0,0)

to this....

> help = create(Menu, "Help", win,0,0,0,0,0),
> About = create(MenuItem, "About", help,0,0,0,0,0),
> Guide = create(MenuItem, "Guide", help,0,0,0,0,0)

Hope this helps.

Mark

new topic     » goto parent     » topic index » view message » categorize

3. Re: help on this window...

mabrown at SENET.COM.AU said:

Try changing this....

> helpgame = create(Menu, "Help", win,0,0,0,0,0),
> About = create(MenuItem, "About", help,0,0,0,0,0),
> Guide = create(MenuItem, "About", help,0,0,0,0,0)

to this....

> help = create(Menu, "Help", win,0,0,0,0,0),
> About = create(MenuItem, "About", help,0,0,0,0,0),
> Guide = create(MenuItem, "Guide", help,0,0,0,0,0)

Hope this helps.

Mark

yes, that helped! What was the problem?? (if its not to much to explain)

new topic     » goto parent     » topic index » view message » categorize

4. Re: help on this window...

You kind of figured it out yourself in your comments.

> About =3D create(MenuItem, "About", help,0,0,0,0,0),
                                                           ^^^^
The "help" above never existed as an lValue (a variable on the left of the =
equals sign) in the original example, because you had named the lvalue =
"helpgame" instead.  By changing "helpgame" to "help" in the lValue, the =
create command now knows what menu to put the item into.  For the same =
reason, you could have also changed "help" to "helpgame" in the two create =
lines and it would have worked just as well.

Hope this clears things up.
Michael J. Sabal


>>> FFUltimateMaster at CS.COM 07/26/00 11:44AM >>>
mabrown at SENET.COM.AU said:

Try changing this....

> helpgame =3D create(Menu, "Help", win,0,0,0,0,0),
> About =3D create(MenuItem, "About", help,0,0,0,0,0),
> Guide =3D create(MenuItem, "About", help,0,0,0,0,0)

to this....

> help =3D create(Menu, "Help", win,0,0,0,0,0),
> About =3D create(MenuItem, "About", help,0,0,0,0,0),
> Guide =3D create(MenuItem, "Guide", help,0,0,0,0,0)

Hope this helps.

Mark

yes, that helped! What was the problem?? (if its not to much to explain)

new topic     » goto parent     » topic index » view message » categorize

5. Re: help on this window...

> -----Original Message-----
> From: Alex Ford


<snip>

> helpgame = create(Menu, "Help", win,0,0,0,0,0),
> About = create(MenuItem, "About", help,0,0,0,0,0),
> Guide = create(MenuItem, "About", help,0,0,0,0,0)


> --These two commands are cuase some kind of problem... When i
> try and run the
> program, it tells me that 'help' has not been declared... but
> since its a
> Menu directory... it doesn't need declareing right??--

Actually, it does.  Help does not automatically show up as a menu.  You
still need to declare it (both to Win and to Eu).  Here's what you want to
use:

About = create(MenuItem, "About", helpgame,0,0,0,0,0),
Guide = create(MenuItem, "Guide", helpgame,0,0,0,0,0)

Matt

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu