Page 1 of 1

X1000 procedures can't access MUI elements?

Posted: Fri Apr 26, 2013 1:53 pm
by Spirantho
Hi everybody,

This I believe is probably an X1000-specific question but I don't have access to the X1000 forum.

I have a MUI program (SuperDiskImage) which reads and writes Amiga and other disk images.
I have added a Cancel button. To do this I had to spawn a new procedure to do the actual disk work.

On the non-X1000 machines, it works perfectly - the spawned procedure (CreateNewProcTags() ) changes the blocks, greys out buttons, that sort of thing.
On the X1000, it fails. The GUI doesn't update. If the window is moved around a lot, occasionally the GUI will update to the current state.

How can I make this work on the X1000?

Thanks!

Re: X1000 procedures can't access MUI elements?

Posted: Mon Apr 29, 2013 1:37 pm
by zzd10h
On my x1000,
it works well (for example with my MUI program FastView).

I use CreateNewProcTags and DoMethod(app,MUIM_Application_PushMethod,...) from the child process to update my MUI interface.

Is FastView (OS4depot) GUI updates the number of files found on your system when scanning images drawer ?
Is your executable program available to test on my X1000 ?

Re: X1000 procedures can't access MUI elements?

Posted: Mon Apr 29, 2013 2:49 pm
by Spirantho
Thanks for the help!

I'm not trying to call a MUI Method though, rather I'm just setting attributes (enabled/disabled, source colour, that sort of thing). Also it works on my non-X1000s, though of course that's no guarantee of anything.

I think if you download http://www.retroreview.com/iang/Catweas ... 130422.lha I think you should be able to see if it works. Put a filename into the file box (RAM:test or something), then click "Read Disk". It should do *something*, but I'm not sure what if you have no Catweasel. :) All I'm looking for though is for the buttons to disable when you press Read Disk, and for the Cancel button to enable. This should then revert back when the operation fails, along with a couple of coloured boxes instead of black ones.
Try and see what happens. :)
Thanks again!

Re: X1000 procedures can't access MUI elements?

Posted: Mon Apr 29, 2013 3:31 pm
by zzd10h
Hi,
You are welcome !

I try your program and when I click "read disk", it says me that it's illegal to call MUIM_Redraw from a child process.

It's exactly why I suggest you to try PushMethod from your child process.
edit: I had the same problem than you and Fab suggests me this method.

1) Please try, something like that

DoMethod(app,MUIM_Application_PushMethod,
My_Button,3,MUIM_Set,MUIA_Disabled,TRUE);

edit : this method works well if you have few updates to do, otherwise you will have to use signaling method.
personally, I use just a few PushMethod in FastView.

2) Do you try to see if number of files are changing when you scan image's drawer with FastView ?

http://www.os4depot.net/index.php?funct ... stview.lha



Guillaume

Re: X1000 procedures can't access MUI elements?

Posted: Mon Apr 29, 2013 3:39 pm
by Spirantho
Right! That looks like what must be happening! How strange it works on one machine and not another, though.
I'll try that though and see what happens!

Thanks very much for your help, it's much appreciated!

Re: X1000 procedures can't access MUI elements?

Posted: Mon Apr 29, 2013 3:44 pm
by zzd10h
take care I have edited my post...

Re: X1000 procedures can't access MUI elements?

Posted: Mon Apr 29, 2013 7:45 pm
by tboeckel
Spirantho wrote:Right! That looks like what must be happening! How strange it works on one machine and not another, though.
I'll try that though and see what happens!

Thanks very much for your help, it's much appreciated!
Which MUI versions exactly are we talking about here? Older MUI 3.9 releases might allow redraw operations from other tasks than the main task. However, since November 2012 MUI will refuse to perform any redraw operations that are not done by the main application task. Thus the GUI will appear to be not being updated unless the window is resized. This is just an enforcement of one of the oldest MUI rules ever.

Re: X1000 procedures can't access MUI elements?

Posted: Mon May 06, 2013 2:25 pm
by Spirantho
I must be using an old version of MUI....

I made the changes suggested above, and got an oddity:

// set( gTrackField[ track ], MUIA_Bitmap_SourceColors, colour);
DoMethod(app,MUIM_Application_PushMethod, gTrackField[ track ],3,MUIM_Set,MUIA_Bitmap_SourceColors, colour);

This is the old code and the new code.
The old code works perfectly (except on newer MUI builds, it seems).
The new code does nothing (or at least nothing correct).
Should they not do the same?

Edit:
This is the complete code I have:

Code: Select all


		if ( mainThread == TRUE )
		{
        	DoMethod(grp, OM_REMMEMBER, obj);
			set( gTrackField[ track ], MUIA_Bitmap_SourceColors, colour);
	        DoMethod(grp, OM_ADDMEMBER, obj);
    	    DoMethod(grp, MUIM_Group_ExitChange);
		}
    	else
        {
        	DoMethod(app,MUIM_Application_PushMethod, grp, 2, OM_REMMEMBER, obj);
	    	DoMethod(app,MUIM_Application_PushMethod, gTrackField[ track ],3,MUIM_Set,MUIA_Bitmap_SourceColors, colour);
        	DoMethod(app,MUIM_Application_PushMethod, grp, 2, OM_ADDMEMBER, obj);
        	DoMethod(app,MUIM_Application_PushMethod, grp, 1, MUIM_Group_ExitChange );
		}
                 
Am I still doing something wrong? Thanks for all the help!

Re: X1000 procedures can't access MUI elements?

Posted: Tue May 07, 2013 12:22 am
by zzd10h
Personaly, I never made InitChange / ExitChange (where is your qinitChange? ) ADD REMMEMBER with
PushMethod

And if you try simply to set a simple things, without ADD REMMEMBER, InitChange, ExitChange,,,
on a simple button, for example, does it works ?

Re: X1000 procedures can't access MUI elements?

Posted: Tue May 07, 2013 10:24 am
by Spirantho
Doing simple changes work fine (disabling/enabling buttons for example). However, changing the bitmap colour changes the colour correctly the first 8 times, and then nothing happens. Run it again (different bitmaps) and again, the first 8 change correctly, then nothing.
Weird. I may have to do it by messaging but I'm wondering if this is my bug or not?