Menu

something odd about creating the TK page

Anonymous
2024-10-12
2024-10-12
  • Anonymous

    Anonymous - 2024-10-12

    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 = rt
    w = tk.Toplevel (root)
    
    scpop_support.set_Tk_var()
    top = Toplevel1 (w)
    scpop_support.init(w, top, *args, **kwargs)
    
    w.overrideredirect(True)  #new
    binder.scpop_exists=True
    return (w, top)
    
    Am I missing something---I can'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?
    
     
  • 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??

     
  • Greg Walters

    Greg Walters - 2024-10-12

    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
  • 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)

     
  • Greg Walters

    Greg Walters - 2024-10-12

    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

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.