I have a number of pages in my app developed over the past few years. I just created a new one to add to the mix
however, when pushing a button trying to do create_Toplevel1, gives an error saying no such function exists (and this seems true) ...however if I look at my old files I DO see it (and it was/is still working)
This is rather confusing....
this is from an old file
def create_Toplevel1(rt, args, kwargs):
'''Starting point when module is imported by another module.
Correct form of call: 'create_Toplevel1(root, args, **kwargs)' .'''
global w, w_win, root
root=rtw=tk.Toplevel(root)scpop_support.set_Tk_var()top=Toplevel1(w)scpop_support.init(w,top,*args,**kwargs)w.overrideredirect(True)#newbinder.scpop_exists=Truereturn(w,top)AmImissingsomething---Ican't find create_Toplevel1 in my new page? How does my program call up my new page (when I press a button) to show it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2024-10-12
By this new page, I mean when I press a button the new page should pop up on top of the current page, until the new page's exit button is pressed. I've always used
def destroy_Toplevel1():
global w
w.destroy()
But this doesn't seem to exist now either??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What version is the "old" PAGE program?
If you are trying to add a new toplevel window to a program from back around PAGE 6.x or earlier (and probably 7.x), you probably can't do it.
There is some backwards compatibility but only a small amount.
You would probably have better luck doing a borrow of the earlier Toplevel forms into a new (8.0) PAGE project, then you should have no problems adding new Toplevel forms to the new project.
If you would like, you can always zip up the old .tcl file(s) and post them here and that way I can see exactly what is happening.
Greg
Last edit: Greg Walters 2024-10-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2024-10-12
There are about 20 different screens, ( some are pop up screens ,others are just changing to other screens)..The project has been using page since around 2020 (ver5.x). What changed with displaying TKINTER pages? Not sure I follow There is some backwards compatibility
Now, I did have slight luck with:
import newpopup as the_newpopup ......... (newpopup.py & newpopup_support.py)
button callback:
the_newpopup.newpopup_support.main() ...seems to bring up the popup
w.overrideredirect(True)
The screen pops up but the graphics is not yet fully responsive ...popup buttons make assigned click sounds as they should, but the popup screen values do not update/frozen)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Back in PAGE 5.x, each Toplevel form was considered it's own Python program. So for each Toplevel form, you had three files. The .tcl file, the GUI.py file and the support.py file.
In PAGE 8 (and PAGE 7), that changed. In the "newer" PAGE versions, you can have as many Toplevel forms as you want and there are only 3 files. The .tcl and the two .py files.
You don't have to import each Toplevel PAGE files, that's all ready done for you by PAGE.
It's extremely difficult to explain in a small form like this.
Something that might be helpful is in the PAGE distribution folder|docs|tutorials| Migrating to PAGE 7x.pdf. That might help you understand better.
I have a number of pages in my app developed over the past few years. I just created a new one to add to the mix
however, when pushing a button trying to do create_Toplevel1, gives an error saying no such function exists (and this seems true) ...however if I look at my old files I DO see it (and it was/is still working)
This is rather confusing....
this is from an old file
def create_Toplevel1(rt, args, kwargs):
'''Starting point when module is imported by another module.
Correct form of call: 'create_Toplevel1(root, args, **kwargs)' .'''
global w, w_win, root
By this new page, I mean when I press a button the new page should pop up on top of the current page, until the new page's exit button is pressed. I've always used
def destroy_Toplevel1():
global w
w.destroy()
But this doesn't seem to exist now either??
What version is the "old" PAGE program?
If you are trying to add a new toplevel window to a program from back around PAGE 6.x or earlier (and probably 7.x), you probably can't do it.
There is some backwards compatibility but only a small amount.
You would probably have better luck doing a borrow of the earlier Toplevel forms into a new (8.0) PAGE project, then you should have no problems adding new Toplevel forms to the new project.
If you would like, you can always zip up the old .tcl file(s) and post them here and that way I can see exactly what is happening.
Greg
Last edit: Greg Walters 2024-10-12
There are about 20 different screens, ( some are pop up screens ,others are just changing to other screens)..The project has been using page since around 2020 (ver5.x). What changed with displaying TKINTER pages? Not sure I follow There is some backwards compatibility
Now, I did have slight luck with:
import newpopup as the_newpopup ......... (newpopup.py & newpopup_support.py)
button callback:
the_newpopup.newpopup_support.main() ...seems to bring up the popup
w.overrideredirect(True)
The screen pops up but the graphics is not yet fully responsive ...popup buttons make assigned click sounds as they should, but the popup screen values do not update/frozen)
Back in PAGE 5.x, each Toplevel form was considered it's own Python program. So for each Toplevel form, you had three files. The .tcl file, the GUI.py file and the support.py file.
In PAGE 8 (and PAGE 7), that changed. In the "newer" PAGE versions, you can have as many Toplevel forms as you want and there are only 3 files. The .tcl and the two .py files.
You don't have to import each Toplevel PAGE files, that's all ready done for you by PAGE.
It's extremely difficult to explain in a small form like this.
Something that might be helpful is in the PAGE distribution folder|docs|tutorials| Migrating to PAGE 7x.pdf. That might help you understand better.
You can also try the PAGE Discord forum. The invite link is https://discord.gg/vm6mTt9FDZ
Greg