@XENIX thanks for the explanations.
Why does not Amigaguide.library just provide a window handler of the opened window, so you can change its position & size with Intuitions ChangeWindowBox ?
This is what i do now: after opening the node with openguide, i am using a Cli command i wrote a while ago, looking for the window with the given name (node) & changing its position & size.
I am sure it can be impoved in many ways & i would much prefer a solution based on an amigaguide.library feature.
To explain why the problem deserves some attention :
- a lot of documentation of applications is written in amigaguide format.
- Amigaguide is still the best way, i understand, to integrate serious on line help
To make a presentation of some complicated application (say the Gui4Cli language) you need to be able to address directly the nodes of its amigaguide doc, in a predefined sequence (list). This list should be visible at all times to the presentator in a presentation app. So i have a small gui on the left part of the screen and want to present all doc nodes, example application output on the bigger right side of the screen. Clicking on a line opens the appropriate node.
Ideally this presentation app is not visible to the audience looking at a beamer's output. I have no solution for that yet ( i would if the beamer could present only the bigger right part, don't know if this is possible)
/*WindosPosSizeSet.c */
/*compiles and runs, use -lauto */
/* Joseph Duchâtelet JosDuchIt */
/* modify size&pos of a window on some public screen*/
#define __USE_INLINE__
//#define __USE_BASETYPE__
#include <exec/types.h>
#include <proto/intuition.h>
#include <intuition/intuition.h>
#include <proto/dos.h> //Printf
#include <stdio.h>
#include <string.h>
#define TEMPLATE "WINDOW/A,SCREEN/K,LEFT/N,TOP/N,WIDTH/N,HEIGHT/N" // if screen not mentioned Workbench
struct Window * GetWindow( STRPTR , STRPTR ) ;
int main(int argc, char *argv[]) {
char scrnname[MAXPUBSCREENNAME+1]; //= ""; "Workbench"; //default pubscreen
scrnname[0] = 0;
char winnamesh[31];
LONG *left, *top, *width, *height;
left = (LONG *)20l;
top = (LONG *)40l;
width = (LONG *)200l;
height = (LONG *)300l;
LONG args[] = { 0, 0, 0, 0, 0, 0};
struct RDArgs *rdargs;
int RC = RETURN_FAIL;
struct Window *win;
rdargs = ReadArgs(TEMPLATE,args, NULL);
if (rdargs == NULL){
PrintFault(IoErr(), NULL);
goto endprog;
}
if (args[0]) strncpy (winnamesh, (char *)args[0] , 30); //OK
if (args[1]) strncpy (scrnname, (char *)args[1], MAXPUBSCREENNAME);
if (args[2]) left = (LONG *)*(LONG *)args[2];
if (args[3]) top = (LONG *)*(LONG *)args[3];
if (args[4]) width = (LONG *)*(LONG *)args[4];
if (args[5]) height = (LONG *)*(LONG *)args[5];
//printf("%s %s %ld %ld %ld %ld\n", winnamesh, scrnname, left, top, width, height);
if (winnamesh) {
if (win = GetWindow((STRPTR)scrnname, (STRPTR)winnamesh)) {
ChangeWindowBox( win, left, top, width, height ); //ChangeWindowBox( struct Window *, WORD, WORD, WORD, WORD ); /// warning cast from pointer to integer of different size
}
else goto endprog;
}
else goto endprog;
FreeArgs(rdargs);
return (RETURN_OK);
endprog:
printf("%s\n", "sorry");
FreeArgs(rdargs);
return (RETURN_FAIL);
}
struct Window * GetWindow( STRPTR screenname, STRPTR windowabbrev ) {
struct Screen *nxtscreen, *scr;
struct Window *win, *selwin;
int lgtwt, lgtabbr;
char wtshort[31];
BOOL winfound =FALSE;
lgtabbr = strlen(windowabbrev);
///if (screenname == "" ) { /// if (screenname == NULL ) does not work either
if (screenname[0] == 0 ) {
printf("%s\n", "default pubscreen");
scr = LockPubScreen(NULL);
}
else scr = LockPubScreen(screenname); /// does not work with screenname = ""
if (!(scr )) return (NULL); /// NULL Default public screen , mostly WB screen
win = scr->FirstWindow;
while (win)
{
lgtwt = strlen(win->Title);
if (lgtwt >= lgtabbr) {
strncpy (wtshort, (char *)win->Title, lgtabbr);
wtshort[lgtabbr]=0;
if (strcmp(wtshort, windowabbrev) == 0) {
winfound=TRUE;
break;
}
}
win = win->NextWindow;
}
if (winfound) {
UnlockPubScreen(screenname, scr);
return (win);
}
else {
UnlockPubScreen(screenname, scr);
return (NULL);
}
}