RE: Use of StdCmds in programs

From: [at]} <weck{>
Date: Wed, 14 Feb 2001 11:22:34 +0100

Dear Michel

Your first command works fine on 1.4. What you suggested has already been done there. Although, you
probably should call StdCmds.InitLayoutDialog first (to avoid a NIL-deref trap if the layout dialog
had not been opened manually before).

I do not understand the problem with your second command, but maybe I am missing what exactly it is
you try to achieve. In both version (1.3.3 and 1.4) it seems to work fine for me.

Note that StdCmds implements a user interface, this is the stuff needed to drive dialogs and menus
and the like. Hence, there may be some underlying assumptions that hold for user interfaces but not
when using StdCmds as a programming interface. When you "import" StdCmds as an API what you can do
is scripting user actions in the GUI. As far as my experiments showed, using your IncSize command
has exactly the same effect as opening, editing and applying the corresponding dialog manually.

StdCmds.InitSizeDialog evaluates the current state (view type, selection and so on) of the front
window to set the value in the dialog. Since I do not know exactly in which context you tried to
apply your command, it may be hard for me to reproduce your problem.

Best regards,
        Wolfgang Weck

--------------------------------------------------------------------
Dr. Wolfgang Weck
Oberon microsystems Inc.
Technoparkstrasse 1, CH-8005 Zürich
Tel: (+41 1) 445 17 51, Fax: (+41 1) 445 17 52
mailto:weck{([at]})nowhere.xy
--------------------------------------------------------------------



> -----Original Message-----
> From: Michel Kuhne [mailto:michel.kuhne{([at]})nowhere.xy
> Sent: Monday, February 12, 2001 11:51 PM
> To: blackbox{([at]})nowhere.xy
> Subject: Use of StdCmds in programs
>
>
> Hello dear BB-MailingList,
> I encounter two problems in using StdCmds in programs (under 1.3.3 version).
>
> FIRST PROBLEM
> The execution of
>
> PROCEDURE WinWidth*;
> BEGIN
> StdCmds.layout.wType := 2; StdCmds.SetLayout
> END WinWidth;
>
> makes the job but also produces an error mesg ("cannot close a dirty
> window"), because the StdCmds.CloseDialog is in the code of
> StdCmds.SetLayout and not in the ok-button link (as it should be, shouldn't
> it ?).
>
> SECOND PROBLEM
> The execution of
>
> PROCEDURE IncSize*;
> BEGIN (*IncSize*)
> StdCmds.InitSizeDialog; INC(StdCmds.size.size); StdCmds.SetSize
> END IncSize;
>
> makes the job : current size increases by 1, as it can be observed with
> Attributes -> Size...
>
> BUT, if you execute it twice, size doesn't increase by 2, as if the
> StdCmds.size.size got by the menu weren't the same as the one got by the
> program... ???
>
> So, dear BB-MailingList, may I have :
> 1° An explanation of this phenomenon
> 2° A solution for my little size-problem
>
> Merci d'avance !
>
> Michel Kuhne, genève
>
> --------------------------------------------
>
> To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
> blackbox-request{([at]})nowhere.xy
>
> To get a list of valid e-mail commands and instructions on their usage, send a message
> containing the word "help" to the above address.
>
> Send any problem reports or questions related to this email list to the list owner at
> owner-blackbox{([at]})nowhere.xy

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy
Received on Wed Feb 14 2001 - 10:22:34 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:44 UTC