Invalidate()

related to programming for xlobby, code samples, examples etc.

Invalidate()

Postby defrag on Mon Oct 15, 2007 2:19 pm

Have any of you noticed invalidate() not working in certain situations?

I have a text area on the screen to display status and a function in a plugin that changes the text and fires the invalidate. When I then fire an event from a button click, I set the text to processing, invalidate, do stuff then set the text to idle and invalidate again. All works fine. BUT, if I do the same from a category with a built in event that fires on execute (by that I mean the database has an event element for each item), it runs the same invalidate code but no refresh happens.

I'm wondering if the category processing is on a different thread and does not touch the main thread until completion which may explain what I am seeing.
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: Invalidate()

Postby defrag on Mon Oct 15, 2007 9:43 pm

OK, well this is new to me!! I didn't realise that you could set a click event on a category in the skin editor - I assumed that only the selection event was available!! You live and learn. Anyway, doing that solves my problem I had in the above post - but doesn't explain why an embedded event in the database won't invalidate the screen.
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: Invalidate()

Postby P3rv3rt B3ar on Mon Oct 15, 2007 9:57 pm

well just quessing but as we all know invalidate doesnt work while screen is grabbed... mayby when done trough database screen gets crabbed internally? this is pure speculation thought... mayby trying:

Code: Select all
if (called_from_database_determined_who_knows_how)
{
helper.ReleaseScreenCrap();
helper.Invalidate(your_area);
Thread.Sleep(blink_of_an_eye);
helper.CrapScreen();
}
else helper.Invalidate(your_area);


that is actually procedure (without else branch) i use for certain catwalk algorithm for which i need to update dummy screen...

if my diagnose is wrong(most likely) u will get xlobby hanging when release() is called without locking screen...

As u can see i have n real answer to u question... bear simply spamming :D
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: Invalidate()

Postby defrag on Mon Oct 15, 2007 10:13 pm

Code: Select all
Object synchronization method was called from an unsynchronized block of code.


:D :D

Nice try though!!!

I'm now thinking that the execute, which is probably overriden by the inline event has no need to update the screen - who knows... (well we know who knows - silly question!!)

Thanks anyway B3ar!! I'll stick with my click event - does the job!!

BTW: your code doesn't compile :shock: :lol: :lol: :lol: :lol:
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: Invalidate()

Postby P3rv3rt B3ar on Mon Oct 15, 2007 10:52 pm

defrag wrote:
Code: Select all
Object synchronization method was called from an unsynchronized block of code.



:shock: :shock: :shock:

defrag wrote:BTW: your code doesn't compile :shock: :lol: :lol: :lol: :lol:


oh crab!
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: Invalidate()

Postby defrag on Mon Oct 15, 2007 10:56 pm

yeah that little gem of an exception was thrown up by the ReleasePaintMyRoom thingy!!
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: Invalidate()

Postby P3rv3rt B3ar on Mon Oct 15, 2007 11:08 pm

defrag wrote:yeah that little gem of an exception was thrown up by the ReleasePaintMyRoom thingy!!


ohhh got it... the same one im always been too lazy to catch and thinking that xl just hangs, i even wrote a note to Steven. Well that prooves me wrong with the grab theorem (mental bear note: next time dont confuse pickup and coding strategy). well like i said was speculation anyway, gotta catch marbles somehow :D 3 posts closer to target :D
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: Invalidate()

Postby defrag on Mon Oct 15, 2007 11:15 pm

P3rv3rt B3ar wrote:gotta catch marbles somehow :D 3 posts closer to target :D


well I could keep asking you a few more questions!!!

like how is the super b3ear skinning coding going?
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: Invalidate()

Postby P3rv3rt B3ar on Mon Oct 15, 2007 11:25 pm

defrag wrote:
like how is the super b3ear skinning coding going?


Well been lazy for few days again... no advancement, i made though another lucky accidental discovery which might allow speed things with element moving somewhat, mayby not enough to include flash type environment within realm of possibility yet, but could allow moving few elements at time with decent speeds instead of just one... next ill need to build within the code exact measurement for speeds cause i cant rely on my observations while trying small optimizations...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: Invalidate()

Postby defrag on Tue Oct 16, 2007 9:49 am

Looking forward to xlobby tetris already 8)
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK