Add Timeout option to MessageRequester()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Add Timeout option to MessageRequester()

Post by Tristano »

There are some use-cases where one might wish the MessageRequester() dialog to be available only for a given number of seconds, and then close -- if it was a "yes/no" dialog, it should then have a default value returned.

For example, applications running in the background might want to popop a MessageRequester() to inform user of some changes that have occured and which might require some user interaction (eg: like firewalls notifications, and so on).

I think this option is particularly important because of the code-execution blocking nature of MessageRequester(). An optional time-out feature would grant that execution would not be stopped for more than a given time if the PC is unattended at the time the MessageRequester() is popped up.

This optional feature shouldn't break backward compatibility with codes already using MessageRequester().
The PureBASIC Archives: FOSS Resources:
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Add Timeout option to MessageRequester()

Post by Mistrel »

You would probably want to create your own custom window for this type of behavior and it's a very unusual kind of behavior for a dialog box. I can probably count the number of times I've seen an auto-dismissing dialog on one hand and I can't even name where I'd seen them.

What is your use case for this?
User avatar
TI-994A
Addict
Addict
Posts: 2704
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Add Timeout option to MessageRequester()

Post by TI-994A »

A usable alternative, for the time being. :wink:

> MessageBox with multi-line text & auto-close timer
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Re: Add Timeout option to MessageRequester()

Post by Tristano »

TI-994A wrote:A usable alternative, for the time being. :wink:

> MessageBox with multi-line text & auto-close timer
Thanks @TI-994A! This is a really good solution, and it works exactly the way I imagined it.

I've added a link to it in my libraries resource page:

https://github.com/tajmone/purebasic-ar ... r/libs#gui
The PureBASIC Archives: FOSS Resources:
Post Reply