 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jens Munk Guest
|
Posted: Tue Oct 28, 2003 10:12 pm Post subject: TmainMenu |
|
|
In this application I have a loop always running (checking some external
hardware) but when I pull down a menu from TMainMenu the loop stops until I
click the menu item. I know the same thing happens in e.g. visual basic, but
is there any way of keeping my loop running while the menu is pulled down?
The obvious suggestion would be to put the loop in a separate thread but I
don't want to do that for other reasons.
Thanks,
Jens.
|
|
| Back to top |
|
 |
Jon Jacobs Guest
|
Posted: Tue Oct 28, 2003 11:31 pm Post subject: Re: TmainMenu |
|
|
Put your loop in a separate thread.
Jon
"Jens Munk" <j.munk (AT) maccor (DOT) dk> wrote
| Quote: | In this application I have a loop always running (checking some external
hardware) but when I pull down a menu from TMainMenu the loop stops until
I
click the menu item. I know the same thing happens in e.g. visual basic,
but
is there any way of keeping my loop running while the menu is pulled down?
The obvious suggestion would be to put the loop in a separate thread but I
don't want to do that for other reasons.
Thanks,
Jens.
|
|
|
| Back to top |
|
 |
Kurt Barthelmess Guest
|
Posted: Wed Oct 29, 2003 12:52 am Post subject: Re: TmainMenu |
|
|
"Jens Munk" <j.munk (AT) maccor (DOT) dk> wrote:
| Quote: | In this application I have a loop always running (checking some external
hardware) but when I pull down a menu from TMainMenu the loop stops until I
click the menu item. I know the same thing happens in e.g. visual basic, but
is there any way of keeping my loop running while the menu is pulled down?
|
What are you doing now to keep this loop running? Calling
Application.ProcessMessages in between times?
I don't know of any elegant solutions. The problem is that once you
surrender control be that call to ProcessMessages, you are stuck until
that menu closes. You can still get messages, however (this is the not
so elegant solution<g>), so if you restructure your code so that it
does a "chunk" of stuff in response to an event like a timer or an
OnIdle event, it can continue to grind.
Good luck.
Kurt
|
|
| Back to top |
|
 |
Jens Munk Guest
|
Posted: Wed Oct 29, 2003 5:45 am Post subject: Re: TmainMenu |
|
|
Thanks Kurt,
Comments inserted below,
Jens.
| Quote: |
What are you doing now to keep this loop running? Calling
Application.ProcessMessages in between times?
|
==>A couple of things: The application was written in Visual Basic when I
took over and I am now in the process of migrating to Delphi. So in the VB
application a timer is started when the menu is started as you suggest
below. In Delphi I have detached the user interface from the core grinding
part of the program into a separate application mainly to get remote
operation. So really I do not desparately need a menu in the "server"
application since I can just use a few buttons. Currently just three
functions are needed: One to setup user rights, one to call a maintenance
screen and one to shut down.
| Quote: |
I don't know of any elegant solutions. The problem is that once you
surrender control be that call to ProcessMessages, you are stuck until
that menu closes. You can still get messages, however (this is the not
so elegant solution<g>), so if you restructure your code so that it
does a "chunk" of stuff in response to an event like a timer or an
OnIdle event, it can continue to grind.
|
==>I will just go for plain buttons instead then. I want my server
application to be lean, clean and solid. The reason for my question Is that
I just wanted to be 100% sure that I wasn't missing something to get it
working in a simple way, but apparently I am not.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|