[Gambas-user] setfocus eats way too much time

Jean-Yves F. Barbier 12ukwn at ...626...
Sun Aug 16 05:40:32 CEST 2009


Doriano Blengino a écrit :
...
> Fabien was asking what toolkit you are using: GTK or QT?

Qt

> Try the other one, who knows... it's a quick way to know if the problem 
> is in the toolkit.

a real mess: permanent scrolling of GTK errors in console, unusable because
printing errors takes all cycles (15 sec. to stop after hitting 'Quit')

> In QT I experienced similar delays whith message boxes - I think those 
> delays are related to sound (yeah, it's very important to play a sound 
> together with a popup... and I don't know how to disable sound).

Strangely, today the delay is only ~0.6 sec (weird: no X restart, no reboot,
no more charge than yesterday, no more more (more or less:))

> I understand one doesn't want to mess with the code, especially a timer 
> when there is no reason. But sometimes it solves. For example, once I 
> wanted to close a tabstrip from a button sitting on the tabstrip itself. 
> It was impossible without using a timer, because the tabstrip refused to 
> destroy while executing an event from a gadget owned by the tabstrip. 
> Too long to explain - I had to "unrelate" the button and the tabstrip - 

Yeah, I see what you mean; but I don't see how you made it (got some code?)

> I did it with a timer. Now I am playing with GTK, and I see that focus 
> and visibility of gadgets (and other things) behave strangely. Trying to 
> use a timer is a 4-lines piece of code: instead of doing a thing, you 
> start a timer. In the event of the timer you do what you want to do, and 
> disable the timer; you don't even need to put the timer in the form; you 
> create it on the fly in the program, and destroy or stop it after it has 
> done the job. The reason for all this is that when you execute 
> somthing.show(), a lot of things must happen; these things sometimes are 
> deferred, but you, just after show(), want to focus a gadget that 
> perhaps is not even visible. By exiting the event handler, you give the 
> toolkit the CPU time to show the window and do whatever it needs.

Ok I've got the overall.
1st I'll finished the application, and if this last, I'll contact you.

Thanks Doriano

(late because I had a PB with gmail that took me hours to solve:(
-- 
tearing off a quicky:
	Gunning the jump.




More information about the User mailing list