StatusDlg.Show(); help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • bobbie
    Forum Member
    • Feb 2005
    • 770

    StatusDlg.Show(); help

    I would like to StatusDlg.Show(); when it is loading the txt file but I can't seem to get it to work?
    The code is not mine but Azmanar from a example he has.
    If iI can't show the StatusDlg.Show(); could I show maybe a small window with some kind of gif type animations showing that it is working?

    Code:
    tSelected = ListBox.GetSelected("ListBox2");
    
    if tSelected then
    StatusDlg.Show();
    
    sPlayListFilePath = ListBox.GetItemData("ListBox2", tSelected[1]);
    tSelectedPlayList = TextFile.ReadToTable(sPlayListFilePath);
    nTable = Table.Count(tSelectedPlayList);
    	if tSelectedPlayList then
    		for i=1,nTable do
    			sPath = tSelectedPlayList[i];
    			if sPath =="" then
       				Table.Remove(tSelectedPlayList, i) -- remove empty lines
       			else
    				tFileParts = String.SplitPath(sPath);
    				sFile = tFileParts.Filename..tFileParts.Extension;
    				ListBox.AddItem("ListBox1", sFile, sPath);
    			end
    		end
    		nPlayList = ListBox.GetCount("ListBox1");
    		Label.SetText("Total", nPlayList);
    		StatusDlg.Hide();
    
    	end
    else
    --result = Dialog.Message("Notice", "No File Selected", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end
  • bobbie
    Forum Member
    • Feb 2005
    • 770

    #2
    Well the StatusDlg.Show(); is opening but it seems to be frozen till the txt file loads into the listbox.
    You can't move it or the window till it is done.

    Comment

    • mz241508
      Forum Member
      • Oct 2006
      • 351

      #3
      Maybe you can post the *.apz file so that we find it much easier to help you. :yes

      Comment

      • Roboblue
        Forum Member
        • Dec 2003
        • 892

        #4
        Bobbie
        I don't use the status dialog very often, but I think it will only animate from an action that has a callback function.
        I don't see such an action in your code.

        Comment

        • bobbie
          Forum Member
          • Feb 2005
          • 770

          #5
          Ok thanks, but like I added it seems to be lock anyways while it is loading the txt file.

          Comment

          • Roboblue
            Forum Member
            • Dec 2003
            • 892

            #6
            That's because it's an embedded function of AMS. It shows up where you put it in the code to .Show, it goes away when the reaches the .Hide.
            But, without a callback function in the action, there won't be any activity. None of the actions you have in that bit of code has a callback function to give the StatusDlg anything to react to.
            Look at the help for a ZIP.Extract (or file.copy, or any action that has the capability to take an extended time to complete, or if a "Cancel the action" is needed). The Callback Function is going to have the information to allow the StatusDlg to have activity.

            Comment

            Working...
            X