octave-maintainers
[Top][All Lists]
Advanced

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

Re: isguirunning() versus __octave_link_enabled__?


From: Daniel J Sebald
Subject: Re: isguirunning() versus __octave_link_enabled__?
Date: Tue, 13 Aug 2013 12:44:59 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 08/13/2013 11:43 AM, Rik wrote:
8/13/13

Does anyone know which function should be preferred in m-files?  They both
seem to be used to tell whether the GUI is running.  My vote would be for
isguirunning since the name is clear about its functionality and it is not
an internal hidden function.  Can the GUI ever be running and the link not
enabled?

--Rik

It depends on what the exact function/purpose of the two are. Here is the description for isguirunning:

 -- Built-in Function:  isguirunning ()
     Return true if Octave is running in GUI mode and false otherwise.

Granted this stuff is in the works, but the description doesn't say anything about a GUI actually being active, as the function name might imply, i.e., "running in GUI mode" is slightly different from "GUI is running". The former would simply mean that the user did not use the option

octave --no-gui

If the purpose is simply to reflect the startup option the user chose, then perhaps "isguimode()" is a more accurate function name.

On the other hand, I would think __octave-link-enabled__ reflects exactly if there is a graphical user interface (or IDE) that is functional. It is used in cases where the fallback option might be JAVA. That begs the question whether a user might conclude that "--no-gui" option means that even Java error and list dialogs shouldn't be functional.

So, perhaps some clarity is needed here and there is a different purpose for the two routines. As with C coding style, I'd say use these routine sparingly. For example, we don't want to propagate style like

  if (isguirunning ())
    errordlg (...);
  endif

When I run in a mode that doesn't have Qt available (superuser), I get:

address@hidden build-gui-12]# ./run-octave
**
GLib-GIO:ERROR:gdbusconnection.c:2270:initable_init: assertion failed: (connection->initialization_error == NULL)

address@hidden build-gui-12]# ./run-octave --no-gui
GNU Octave, version 3.7.5
[snip]
For information about changes from previous versions, type 'news'.
octave:1>

so I can't answer your question about GUI running and link not enabled, other than to say probably not.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]