Sie befinden sich auf der NewGUI Sourcepage

Start
Über NewGui
Featureübersicht
Changesübersicht
Installation
Download
Demos
Anwendungen
Tutorials
Sourcecodes
-Button Beispiel
-Checkbox Beispiel
-TextEditor
-Flächen & Füllroutinen
-Eingabegadgets
-
Links
Kontakt

Unser Hostingpartner


#include <signal.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h> 

#include <sys/types.h>
#include <sys/errno.h>

#include <exec/types.h>
#include <exec/tasks.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/newgui.h>


#include <intuition/intuition.h>
#include <newgui/defines.h>


// arg2 is defined in the newgui_helper.o

void __asm arg2(register __a0 long *arg1,
                register __a1 long *arg2);
   
main(int argc,char *argv) {

    struct Library *NewGuiBase;
    void *gui;
    long Class,Gadget;

   struct TagItem gui_tags[3];

        gui_tags[0].ti_Tag  = NG_THEMEABLE;
        gui_tags[0].ti_Data = 1;
        gui_tags[1].ti_Tag  = NG_SIZEABLE;
        gui_tags[1].ti_Data = 1;
        gui_tags[2].ti_Tag  = TAG_DONE;
        gui_tags[2].ti_Data = NULL;


    NewGuiBase = OpenLibrary("newgui.library",0);
    if (NewGuiBase!=NULL) {

	// Open a Window, let the theme do the rest, wait for ESC to end the program.

        gui=Open_WindowTagList(100,100,320,240,"mein Fenstername",
                    WFLG_BORDERLESS||WFLG_REPORTMOUSE||WFLG_RMBTRAP||WFLG_SMART_REFRESH||WFLG_WINDOWREFRESH,
                    IDCMP_VANILLAKEY||IDCMP_MOUSEBUTTONS||IDCMP_ACTIVEWINDOW||IDCMP_MOUSEMOVE,
                    gui_tags);
        if (gui) {

            WorkGui(gui,0);
                    
            Class=-1;
            Gadget=0;
     
            while (Class!=IDCMP_CLOSEWINDOW)
             { 
                WaitGuiEvent(gui,NULL);
                arg2(&Gadget,&Class);
                
                printf("gadget=%08x class=%08x\n",Gadget,Class);

             }
        
            Close_Window(gui);
        }
    
        CloseLibrary(NewGuiBase);
    }


    return 0;

}