Thread: Re: [Gambas-user] Displaying Mouse.Wait while running a SHELL Command
Brought to you by:
gambas
From: vikram <aus...@ya...> - 2010-11-23 11:40:20
|
>You can use the Wait keyword, see http://gambasdoc.org/help/lang/shell >Something like: >SHELL command Wait TO checksum Thanks for the quick reply. Adding WAIT to the SHELL command is not causing the mouse cursor to change to Mouse.Wait :( Regards, Vikram |
From: vikram <aus...@ya...> - 2010-11-23 12:22:31
Attachments:
GenerateSHA512.tar.gz
|
Hi, heres a sample program. iam running sha512sum on file which are 100MB+ in size, its takes around 5 seconds. right now the button stays depressed until the hash has been displayed. regards, Vikram |
From: vikram <aus...@ya...> - 2010-11-24 11:01:19
|
Hi, Heres how i "fixed" it, hope it is the right way to display a "wait" cursor while a process executes. ------------------------- FMain.Mouse = Mouse.Wait WAIT Application.Busy = 1 SHELL "sha512sum lenny.iso" TO actualSUM Application.Busy = 0 FMain.Mouse = Mouse.Default ------------------------- I read "If you call WAIT from an event handler, you may create infinite recursions, and then stack overflows" from the Docs, i hope it wouldn't be an issue in this case (i.e., if i were to use WAIT for the click event of a Button). Regards, Vikram |
From: Benoît M. <ga...@us...> - 2010-11-24 11:09:57
|
> Hi, > > Heres how i "fixed" it, hope it is the right way to display a "wait" cursor > while a process executes. > > ------------------------- > FMain.Mouse = Mouse.Wait > WAIT > Application.Busy = 1 > > SHELL "sha512sum lenny.iso" TO actualSUM > > Application.Busy = 0 > FMain.Mouse = Mouse.Default > ------------------------- > > I read "If you call WAIT from an event handler, you may create infinite > recursions, and then stack overflows" from the Docs, i hope it wouldn't be > an issue in this case (i.e., if i were to use WAIT for the click event of > a Button). > > Regards, > Vikram > Setting FMain.Mouse and calling WAIT is useless. Application.Busy should already set the busy cursor for every widget in the application. Otherwise this is a bug. Regards, -- Benoît Minisini |
From: Ron <ro...@cy...> - 2010-11-24 11:25:35
|
On 24-11-2010 12:09, Benoît Minisini wrote: >> Hi, >> >> Heres how i "fixed" it, hope it is the right way to display a "wait" cursor >> while a process executes. >> >> ------------------------- >> FMain.Mouse = Mouse.Wait >> WAIT >> Application.Busy = 1 >> >> SHELL "sha512sum lenny.iso" TO actualSUM >> >> Application.Busy = 0 >> FMain.Mouse = Mouse.Default >> ------------------------- >> >> I read "If you call WAIT from an event handler, you may create infinite >> recursions, and then stack overflows" from the Docs, i hope it wouldn't be >> an issue in this case (i.e., if i were to use WAIT for the click event of >> a Button). >> >> Regards, >> Vikram >> > Setting FMain.Mouse and calling WAIT is useless. Application.Busy should > already set the busy cursor for every widget in the application. Otherwise > this is a bug. > > Regards, > That was what I thought too, but Application.Busy alone is not showing a busy pointer (anymore?) on latest gambas 2 and Ubuntu 10.04 with gb.qt Regards, Ron_2nd. |
From: vikram <aus...@ya...> - 2010-11-25 04:23:27
|
> Setting FMain.Mouse and calling WAIT is useless. Application.Busy should > already set the busy cursor for every widget in the application. Otherwise > this is a bug. Application.Busy alone is not showing a busy pointer on Debian Squeeze, with Gambas 2.21. Regards, Vikram |
From: Dimitris A. <do...@gm...> - 2010-11-25 05:06:59
|
I use INC Application.Busy and DEC Application.Busy in my applications on Debian Lenny (with LXDE) and Gambas 2.21 and it works just fine. Regards, Dimitris On Wed, Nov 24, 2010 at 9:23 PM, vikram <aus...@ya...> wrote: > > Setting FMain.Mouse and calling WAIT is useless. Application.Busy should > > already set the busy cursor for every widget in the application. > Otherwise > > this is a bug. > Application.Busy alone is not showing a busy pointer on Debian Squeeze, > with Gambas 2.21. > > Regards, > Vikram > > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > |
From: Benoît M. <ga...@us...> - 2010-11-25 10:09:43
|
> I use > > INC Application.Busy > > and > > DEC Application.Busy > > in my applications on Debian Lenny (with LXDE) > and Gambas 2.21 and it works just fine. > > Regards, > Dimitris > > On Wed, Nov 24, 2010 at 9:23 PM, vikram <aus...@ya...> wrote: > > > Setting FMain.Mouse and calling WAIT is useless. Application.Busy > > > should already set the busy cursor for every widget in the > > > application. > > > > Otherwise > > > > > this is a bug. > > > > Application.Busy alone is not showing a busy pointer on Debian Squeeze, > > with Gambas 2.21. > > > > Regards, > > Vikram > > > > I see: with gb.gtk, Application.Busy > 0 works only if the event loop is run just after (i.e. you call WAIT just after INC Application.Busy). No idea why, I will look at that... -- Benoît Minisini |
From: Ron <ro...@cy...> - 2010-11-23 11:49:34
|
Strange, this simply works here: ' Gambas class file PUBLIC SUB Form_Open() END PUBLIC SUB Form_Activate() DIM Checksum AS String ME.Mouse = Mouse.Wait Application.Busy = TRUE SHELL "ls -lR" TO checksum Application.Busy = FALSE ME.Mouse = Mouse.DEFAULT 'PRINT checksum END Gambas 2.21.x, ubuntu 10.4, gb.qt Regards, Ron_2nd. >> You can use the Wait keyword, see http://gambasdoc.org/help/lang/shell >> Something like: >> SHELL command Wait TO checksum > Thanks for the quick reply. Adding WAIT to the SHELL command is not causing the mouse cursor to change to Mouse.Wait :( > > Regards, > Vikram > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! > Tap into the largest installed PC base& get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user |
From: Rolf-Werner E. <eil...@t-...> - 2010-11-23 12:00:08
|
Am 23.11.2010 12:40, schrieb vikram: >> You can use the Wait keyword, see http://gambasdoc.org/help/lang/shell > >> Something like: >> SHELL command Wait TO checksum > > Thanks for the quick reply. Adding WAIT to the SHELL command is not causing the mouse cursor to change to Mouse.Wait :( > > Regards, > Vikram > No, but it waits until the shell command is finished. So you have a defined period of time for the mouse cursor to change its shape. Otherwise, your program will just go on, leaving the shell alone, and the change of the mouse is too short to notice... Regards Rolf |