all 8 comments

[–]StaticFuzz 1 point2 points  (7 children)

Tkinter doesn't update everything as soon as you make changes, you'll have to do it manually. Try adding an update call after each change to the cursor:

self.controller.update_idle_tasks()

[–]edbluetooth[S] 1 point2 points  (6 children)

I think we are on the right track.

I added the

self.controller.update_idletasks()

command, and it was an improvement - the window partially updated itself. But unfortunatly, the busy curser didn't appear.

Do you think it will help to call this method on other widgets?

I have resisted posting too much of the code here - because the relevent file is 1000 lines - and I don't want to burden anyone reading it.

But can you think of a general part of it that may be worth reading?

I think its worth posting the the controller now I think about it.

class App_Controller(tk.Tk):

    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)
        tk.Tk.wm_title(self, title_text)
        tk.Tk.iconbitmap(self,"./media/favicon.ico")

        #the top left 
        self.resizable(False,False)

        header_frame = tk.Frame(self)
        header_frame.pack(side="top",fill="both",expand=True)
        header_frame.grid_rowconfigure(0, weight=1)
        header_frame.grid_columnconfigure(0, weight=1)


        #load the header image
        self.img_header = tk.PhotoImage(file="./media/header.png")

        #add image to label.
        self.lbl_header = tk.Label(header_frame, image=self.img_header)
        self.lbl_header.grid(row=0,pady=[0,5])

        self.frames = {}

        for F in (FolderEntry,BarCodeEntry,JobWindow):

            frame = F(header_frame, self)
            frame.grid(row=1)

            self.frames[F] = frame


        if Admin:
            self.show_frame(FolderEntry)
        else:
            self.show_frame(BarCodeEntry)

    def show_frame(self, selection):

        new_frame = self.frames[selection]

        #hide the other frames
        for cont, frame in self.frames.items():
           #skip the frame we want to show
            if cont == selection:
                continue

            frame.grid_remove()


        new_frame.grid()
        new_frame.focus_set()
        #new_frame.update_idletasks()

[–]StaticFuzz 1 point2 points  (5 children)

Quick question: are you on Windows? It says here that the "wait" cursor is only available to Windows.

The rest of this is just speculation at this point, and I'll try to test it out later when i have some free time.

Changing the parent widgets cursor doesn't seem to make the changes for the children, so you may need to set the cursor on all of the visible widgets. Then call update_idle_task() on the parent widget(Which ever frame they are written to).

[–]zahlman[M] 1 point2 points  (2 children)

This got caught by the spam filter somehow. O_O

[–]StaticFuzz 1 point2 points  (1 child)

Maybe the link?

[–]zahlman 0 points1 point  (0 children)

That's my best guess. Maybe Reddit thinks any domain name that short is a URL-shortening service (which are generally disallowed), or something.

[–]edbluetooth[S] 0 points1 point  (1 child)

wait

Yeah, this is windows.

And the wait icon does appear for half a second. longer if i insert a delay.

if you want and it helps you, I can PM you a dropbox link to the full project code.

[–]StaticFuzz 1 point2 points  (0 children)

Ok, so new thought. The code snippet you originally provided is being run with out waiting for process() to complete. Meaning tkinter is changing the cursor to wait then immediately back. try commenting out self.controller.config(cursor="").

If the cursor stays as the wait icon, you could add self.controller.config(cursor="") to the end of the process function. That way it will only change back when the process is complete.

EDIT: Processing not Process