Jump to content

Refreshing The GUI


Recommended Posts

Good morning/afternoon/evening/night Everyone!

I am working on a program that does a series of things:

We use AS400 Emulators at my work, and this program will interface with multiple windows to accomplish tasks.

I have already succeeded in creating a "PerUser" login info save in the registry and a customer database that varies per user.

However, on my main GUI which I call the "Widget_Window()" I want it to build buttons based on only the customers that exist in the database, and not blank entries. I have succeeded in accomplishing this, however, When I close the GUI to the Customer Data Entry, and I switch back to the Main Widget_Window, I run into a series of errors depending on how I try to takle this obsticle.

A) I have tried GuiDelete($mainwin) then CALL("Widget_Window")

This tends to lock up the entire process, not even closing the Customer Data window. I then have to Ctrl+Break to get out of this problem, with no errors generated.

:) I have tried Putting a refresh function call in the While loop of the main GUI, but that flickers all of the buttons... (not what I want.)

C) I have tried to write a refresh function that I can execute when I exit the Customer Data GUI, but it locks everything up as well.

I wrote something like this:

This is called from a loop that is SetOnEvent, MustDeclareVars....

Assume all Variables are pre-defined (They are - not getting errors of that nature)

Func REFRESHMAIN()

$TEMPGUIREFRESH = GuiCreate("TEMP",10,10)

GuiSetState(@SW_SHOW) ; At this point, AutoIt deaults focus to this new GUI

GuiDelete($mainwin)

Call("Widget_Window")

GuiSwitch($mainwin)

GuiDelete($TEMPGUIREFRESH)

EndFunc

Now, according to my thought processes, I create a gui, switch to it, delete the old gui, call the old gui back which refreshes it, then switch to it, and delete the temporary GUI.

At this point, everything looks great until I try to click anything, or even try to exit. IT DOES NOTHING.

The button creation works great, but then thats all she wrote. Gui refreshed but stuck on stupid.

Any ideas??

Link to comment
Share on other sites

Good morning/afternoon/evening/night Everyone!

I am working on a program that does a series of things:

We use AS400 Emulators at my work, and this program will interface with multiple windows to accomplish tasks.

I have already succeeded in creating a "PerUser" login info save in the registry and a customer database that varies per user.

However, on my main GUI which I call the "Widget_Window()" I want it to build buttons based on only the customers that exist in the database, and not blank entries. I have succeeded in accomplishing this, however, When I close the GUI to the Customer Data Entry, and I switch back to the Main Widget_Window, I run into a series of errors depending on how I try to takle this obsticle.

A) I have tried GuiDelete($mainwin) then CALL("Widget_Window")

This tends to lock up the entire process, not even closing the Customer Data window. I then have to Ctrl+Break to get out of this problem, with no errors generated.

:) I have tried Putting a refresh function call in the While loop of the main GUI, but that flickers all of the buttons... (not what I want.)

C) I have tried to write a refresh function that I can execute when I exit the Customer Data GUI, but it locks everything up as well.

I wrote something like this:

This is called from a loop that is SetOnEvent, MustDeclareVars....

Assume all Variables are pre-defined (They are - not getting errors of that nature)

Func REFRESHMAIN()

$TEMPGUIREFRESH = GuiCreate("TEMP",10,10)

GuiSetState(@SW_SHOW) ; At this point, AutoIt deaults focus to this new GUI

GuiDelete($mainwin)

Call("Widget_Window")

GuiSwitch($mainwin)

GuiDelete($TEMPGUIREFRESH)

EndFunc

Now, according to my thought processes, I create a gui, switch to it, delete the old gui, call the old gui back which refreshes it, then switch to it, and delete the temporary GUI.

At this point, everything looks great until I try to click anything, or even try to exit. IT DOES NOTHING.

The button creation works great, but then thats all she wrote. Gui refreshed but stuck on stupid.

Any ideas??

Do you think putting it all in one file and removing includes would change how the calls work?

Link to comment
Share on other sites

<CODE REMOVED>

Do you think putting it all in one file and removing includes would change how the calls work?

I have merged the important files into the main code and commented out the includes. All other functions work fine.

Thanks for your help.

Edited by Sylvrwynd
Link to comment
Share on other sites

The helpfile states the following:

Many of the GUI specific functions work on the "current" window - this is usually the last window created with GUICreate. This function allows you to make another window "current". That's does not mean that the referenced window will become active. You have to use WinActivate.

Within this function: GUISwitch

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Link to comment
Share on other sites

Actually, I have plenty of GuiSwitch() calls... but I solved it on my own.. I awoke to an epiphany...

When I choose to update the customer info on the new GUI, I delete all controls on the main before I minimize and switch to the Customer Update GUI. Then when I close the Customer Update GUI, I call the dyanmic Button function which re-builds the controls on the Main GUI based on the new customer info.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...