Okay... I'll have to get back to you on the disable panelbars option, and the 
following code has a small memory leak (It's a bug in the server or client lib) but 
the following code should point you in the right direction.

PicoGUI's contexts are a lot like variable scopes in C, and help to eliminate big 
chunks of unneeded memory. They work like a stack, and can be nested practically 
indefinitely.

Also note that this uses a new feature, toggle buttons, so update and recompile your 
server and client lib

----8<----

#include <picogui.h>

int btnLaunchPanel(struct pgEvent *evt) {

   if (pgGetWidget(evt->from,PG_WP_ON)) {
      /* Make panel */
      pgEnterContext();
      pgRegisterApp(PG_APP_NORMAL,"Finder Panel",0);

      /* Your Panel Here :) 
       * If you want a button grid, take a look at the "calculator" demo
       */
      pgNewWidget(PG_WIDGET_LABEL,0,0);
      pgSetWidget(PGDEFAULT,
                  PG_WP_TEXT,pgNewString("Hello,\nWorld!"),
                  PG_WP_SIDE,PG_S_ALL,
                  PG_WP_FONT,pgNewFont(NULL,25,PG_FSTYLE_BOLD),
                  0);
   }
   else
     /* Destroy panel */
     pgLeaveContext();

   return 0;
}

int btnExit(struct pgEvent *evt) {
   exit(0);
}

int main(int argc, char **argv) {
   pgInit(argc,argv);
   pgRegisterApp(PG_APP_TOOLBAR,"Finder Toolbar",0);

   pgNewWidget(PG_WIDGET_BUTTON,0,0);
   pgSetWidget(PGDEFAULT,
               PG_WP_TEXT,pgNewString("Panel"),
               PG_WP_EXTDEVENTS,PG_EXEV_TOGGLE,  /* Use new toggle button! */
               0);
   pgBind(PGDEFAULT,PG_WE_ACTIVATE,&btnLaunchPanel,NULL);

   pgNewWidget(PG_WIDGET_BUTTON,0,0);
   pgSetWidget(PGDEFAULT,
               PG_WP_TEXT,pgNewString("X"),
               PG_WP_SIDE,PG_S_RIGHT,
               0);
   pgBind(PGDEFAULT,PG_WE_ACTIVATE,&btnExit,NULL);

   pgNewWidget(PG_WIDGET_LABEL,0,0);
   pgSetWidget(PGDEFAULT,
               PG_WP_TEXT,pgNewString("Panel Launcher Test"),
               PG_WP_SIDE,PG_S_LEFT,
               0);

   pgEventLoop();
   return 0;
}

---->8----

On Fri, 30 March 2001, Philippe Ney wrote:

> 
> Hi Micah,
> 
> We want to make a 'finder' (Mac) as follows:
> - the main app has to contain a toolbar and a background
>   with img+text buttons.
> - when a button is pressed the background must disappear
>   (but the toolbar has to stay displayed) and let the
>   graphical place for the launched app (with a vfork).
> - we don't want the app to have a panel bar but it
>   should be closed through a button in the toolbar
>   that must act as 'back to finder'.
>   (By the way, I tried the 'disable panel bar' option
>    of the widget but don't succeed in making it working.
>    Does it work?)
> - and when the app is closed, the background must be
>   rendered again.
> 
> By now, I've been trying to make it by using the followings ideas:
> - a toolbar app that 'fork' a child app containing
>   the background.
> - a button pressed in the finder exits it and load
>   the chosen app.
> I have to make this 2 apps to make the finder because
> I don't know how to make one app free part of the
> graphical place it uses 
> And that way, the finder is a child process and we
> want it to be part of the parent.
> 
> We thought about:
> - possibility for one app to free the graphical place it takes
> - resizing of one app at runtime by the program
> 
> Do you have any tips?
> 
> Cheers,
> Philippe
> 
> 
> 
> +-------------------------------+
> | +-------+ +-------+ +-------+ |
> | | App 1 | | App 2 | | App 3 | |
> | +-------+ +-------+ +-------+ |
> | +-------+ +-------+ +-------+ |
> | | App 4 | | App 5 | | App 6 | |
> | +-------+ +-------+ +-------+ |
> | +-------+ +-------+ +-------+ |
> | | App 7 | | App 8 | | App 9 | |
> | +-------+ +-------+ +-------+ |
> | +---------------------------+ |
> | | +--------+                | |
> | | | FINDER |                | |
> | | +--------+                | |
> | +---------------------------+ |
> +-------------------------------+
> 
> _______________________________________________
> Pgui-devel mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/pgui-devel

--

Only wimps use tape backup: _real_ men just upload
their important stuff on ftp, and let the rest of the
world mirror it ;)
  -- Linus Torvalds


_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/pgui-devel

Reply via email to