Computer Science Canada GUI.CreateMenu .. Help with disappearing issue plz! |
Author: | midnite13 [ Thu Apr 27, 2006 6:37 pm ] |
Post subject: | GUI.CreateMenu .. Help with disappearing issue plz! |
Hello all, In order to make my summative evaluation look more elegant, my partner and I have decided to delve into the turing GUI library for ideas. We stumbed upon a function called GUI.CreateMenu, and decided it would suffice. Playing around with it, we coded it so that when the user selected an option, it would display '*option name* selected' (like the help example). However, we encountered this problem... The menu bar would disappears if the option name is longer than a character! Have you guys experienced this problem before, and if so, did you find a way around it? Thanks p.s. if need be, i'll paste the code |
Author: | midnite13 [ Thu Apr 27, 2006 6:41 pm ] |
Post subject: | Solution Found |
Sorry if this is considered double posting... I have found a crude solution to my problem. It involves including GUI.ShowMenuBar and a bried delay inside the loop containing 'exit when Gui.ProcessEvent' However, further solutions are appreciated. p.s. I just read over my previous message and found a lot of grammatical mistakes, sry S= |
Author: | jamonathin [ Thu Apr 27, 2006 7:03 pm ] |
Post subject: | |
Firstly, since you are using GUI.CreateMenu - or mainly any gui for that matter, ditch the delay, and ONLY create it once. My guess is your program won't be complicated enough where you would need to reset the value of it. Now to answer your question; Nope. I have never run into that problem you speak of. I went and took a look at Turing's Example and added more than 1 character to the option, and it still works. Here's what you should look for then since your code isn't present. Check for any of these: cls View.Update (you shouldn't be using this with GUI anyways - no real need) locate Draw.Anything Font.Draw And pretty much anything thing else that your put on your screen. If you put up your code I'm shure your question will be solved much faster ![]() |
Author: | midnite13 [ Thu Apr 27, 2006 7:59 pm ] | ||||||
Post subject: | |||||||
[quote="jamonathin"] Now to answer your question; Nope. I have never run into that problem you speak of. I went and took a look at Turing's Example and added more than 1 character to the option, and it still works. [quote] Hello jamonathin, thanks for replying! Sorry if I wasn't clear before, here is an example of a code where the problem occurs. This arises if you try to modify the code slightly:
I altered the code so that the second menu items display the *option name* + selected. The first menu works perfect, but if you click on any item in the second menu, you'll see what I'm talking about. However, I replaced
With this...
and it works ![]() |
Author: | do_pete [ Thu Apr 27, 2006 9:18 pm ] |
Post subject: | |
GUI.Refresh will sove your problem. |
Author: | midnite13 [ Thu Apr 27, 2006 10:17 pm ] |
Post subject: | |
do_pete wrote: GUI.Refresh will solve your problem.
It shows up as a variable when I type this in... Does it work for Turing 4.0.4? |
Author: | do_pete [ Fri Apr 28, 2006 11:30 am ] |
Post subject: | |
It should work. How are you using it in your code? |
Author: | midnite13 [ Sun Apr 30, 2006 3:48 pm ] | ||
Post subject: | |||
do_pete wrote: It should work. How are you using it in your code?
Again, thanks for all your help. I inserted GUI.Refresh into my code here:
Is this correct? |
Author: | BenLi [ Mon May 01, 2006 4:05 pm ] |
Post subject: | |
Well if you're trying to spruce up your FP, maybe you should create your own GUI. I think we all agree Turing's looks like crap |
Author: | HellblazerX [ Mon May 01, 2006 5:28 pm ] | ||
Post subject: | |||
The problem here has nothing to do with refreshing the GUI or whatnot. This is your problem:
Why do you have all that extra spaces? Because when you output those names, your adding all those spaces in as well. What is happening is because your output is at the bottom, it will run out of space, and because the size of your window, it will "shift" the screen down in the attempt to put those spaces in, and what happens is your menu bar gets erased out. Remove those spaces, and enlarge your window, and you'll be fine. And if you're thinking of making your own GUI, then you might as well make it your FP, because there's a lot that goes into a making your own GUI module. There's a reason why it's already been made. |