lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Jun 22, 2016 at 11:14 AM, Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
> On Wed, Jun 22, 2016 at 7:14 PM, Coda Highland <chighland@gmail.com> wrote:
>
>>
>> on Windows, you can shell out to
>> PowerShell instead of cmd.exe to get a native dialog.
>
>
> Windows XP doesn't have PowerShell.
> (Yes, I must support Win XP)

Fair enough, but you could do a feature detect like you do with
terminal emulators.

>> I would point out that there are better alternatives than popping open
>> a shell window on almost all platforms, though.
>
>
> In what aspect these alternatives are better?
> IMO, the decision which one is better is a matter of taste  ;-)
> I agree that "alert" should give user a choice to use what he wants.

The main aspect is that they open something that's obviously a dialog
box that can be interacted with using the keyboard or the mouse. It's
visually going to be closer to the original function you're imitating.
Having a big terminal window with a single line of text show up is
reasonable enough for a developer needing some quick feedback, but end
users will probably find it awkward.

>> there's xmessage, gmessage, kdialog, zenity, xdialog, shellgui, gxmessage,
>> and gtkdialog that I
>> can find on a quick search; most users will have one of the first
>> three installed already.
>
>
> I doubt that it would have 100% *nix systems coverage.
> Meanwhile, a terminal emulator exists on every system,
> including *nices on low memory devices.

Depends on how you're judging coverage. If you're judging it based on
how many end users will be covered rather than by how many
distributions will be covered, you're going to be looking at 90%+ of
desktop UNIX usage, and it's irrelevant for server UNIX usage. :P
Embedded is the remaining point of concern, and for those it's
reasonable to be able to fall back to a terminal emulator if you don't
have another option (and that's also where you're most likely to be
able to choose what's available).

xmessage, specifically, is installed by default on Ubuntu (it's
provided by the x11-utils package) and most other distros that provide
X.org.

>
> Fortunately, "alert" is configurable enough to do what you want.
> "alert" already supports "zenity" and can easily support other
> dialog-like utilities.

You didn't mention this in your original post. ;) I would still make
sure to bundle in xmessage at least, though, due to the abovementioned
coverage.

/s/ Adam