Layout Monitor

class lwsdk.LWLMonFuncs(self)

Bases: object

Proxy of C++ PCore::LWLMonFuncs class

 create() → LWLMonID

Create a new monitor instance. The value returned by this method is passed as the first argument to the other monitor functions.

 destroy(LWLMonID mon)

Free the monitor instance and resources allocated by LWLMonFuncs::create(). If it's open, the monitor window will be closed.

 done(LWLMonID mon)

Tell the monitor that the task has been completed. If the flags passed to LWLMonFuncs.setup() included lwsdk.LMO_REVIEW, the monitor window remains open and control won't be returned from LWLMonFuncs::done() until the user closes the window. Otherwise, LWLMonFuncs::done() closes the window and control returns immediately.

 init(LWLMonID mon, unsigned int total, char msg)

Open the monitor window. The total is the number of steps in the operation. While step is being called, Layout displays your progress to the user as a percentage of this total. The message is the first string displayed to the user.

 setup(LWLMonID mon, char title, unsigned int uiflags, char histfile)

Configure the monitor. The title string is the title of the monitor window. The histfile is the filename of a history file where messages displayed to the user will also be written. This can be None if you don't want a history file. The flags can be any of the following combined using bitwise-or:

lwsdk.LMO_NOABORT
  By default, the user can inform you that your operation should be stopped. This
  flag disables the Abort button.
lwsdk.LMO_REVIEW
  If this is set, the monitor window remains open after you call done. This allows
  the user to review the messages displayed during the operation.
lwsdk.LMO_HISTAPPEND
  By default, the history file is overwritten each time init is called. This flag
  causes new message strings to be appended to the file instead.
lwsdk.LMO_IMMUPD
  Enables immediate update of the monitor on every step. The default is to delay
  updates to avoid incurring too much overhead for rapid step events.
lwsdk.LMO_TOOLBAR
  Uses the Layout tooltip bar to display the progress. No monitor window will be
  opened. If abort handling is enabled, pressing the default abort key (Esc) will trigger an
  abort return from the step function.

 setwinpos(LWLMonID mon, int x, int y, int w, int h)

Set the position and size of the monitor window. The dimensions are in pixels. If you don't call this, Layout will select defaults for you.

 step(LWLMonID mon, unsigned int incr, char msg) → int

Advance the progress display by the fraction total / incr. When the sum of the steps reaches the total, the progress display will indicate to the user that the task has finished. An increment of 0 is valid and can be used to change the message without changing the progress indication. The message can also be None, in which case Layout may substitute a generic progress message. If step returns 1, the user has requested that the task be aborted.

Previous topic

Font List Funcs

Next topic

Node Drawing Funcs

This Page