Partner sites: Aminet - Amiga downloadsIntuitionBase - Amiga guidesAmigaNN - Amiga newsAmiFund - Sponsor projects

[Y]UtilityBase
Your guide to Amiga development
Sign up at our provider 
and get $50 off!
Not logged in
  HomeProjectsForumArticlesResourcesLinksChatAbout 
Search
Login
Username:
Password:
Register now!
Forgot your password?
Aminet - Development
ruby-1.8.7.i386-aros.tar.bz2 (dev/lang)
TilesScrollDemo.lha (dev/amos)
Blitz_SGC.lha (dev/basic)
MCC_TextEditor-15.34.lha (dev/mui)
FlexCat-2.7.lha (dev/misc)
ecx222_upd.lha (dev/e)
fd2sfd_68k.lha (dev/misc)
Blitz_lucy.lha (dev/basic)
AWNP_2-54.lha (dev/misc)
sfd2inc.lha (dev/basic)
More...
Newest users
chris (Chris Young)
root9885
dmjones (Kristian Poul Herkild)
graffias79 (Jamie)
yogi35

Pending:
ZebraZeem, Mad_Dog, hhjoker, voxel, JosDuchIt, MarcB, MarBo, Sollaris, sara, species
More...
Who's Online
Online members:

kas1e 26 min(s) ago
Georg 57 min(s) ago

11 guests are online.

You are an Anonymous user. You can register for free by clicking here.
News sites
Amiga-News.de
Amiga.org
AmigaNN
Amigans.net
Amigaweb.net
AmigaWorld.net
AROS-Exec
MorphOS-News.de
MorphZone
polarBoing
Tutorials
Change Graphics cards in AmigaOS 4.
Installing the latest OS4 SDK in Cubic IDE
Writing Installer scripts for AmiUpdate
Cross Compiling for OS4 or OS3 using MS Visual Studio 2005
Installing an AmigaOS 4 cross compiler
More...
Sources
How to open and use the exec debug interface
How to install a hardware interrupt
Install SObjs with Installer
How to make clean picture datatypes
Most of the old ClassACT examples converted to OS4
More...
Documentations
How to write portable code for Amiga (english)
Comment écrire du code portable pour Amiga (français)
Development How to with OS3.9 SDK
The PartyPack Hack
The Amiga PDA Programming Guidelines
More...
DreamHost

Support
UtilityBase

[Valid RSS]

UtilityBase needs your help!

AmigaAnywhere Tutorial - Part 2 Source window2.c
by Nicolas Mendoza

window2.c

#include <elate/taort.h> // Include system headers
#include <elate/ave/ave.h> // Include all AVE headers
#include <unistd.h> // Needed by for sleep()

int main(void) {
ave_dev_data_t ave; // pointer to AVE data
ave_app_t *app; // pointer to application AVO
ave_toolkit_t *toolkit; // pointer to toolkit
ave_win_t *dialog; // pointer to our window (dialog)
ave_avo_size_t size; // size structure for our window

ave = ave_dev_lookup("device/ave/window2"); // Do we have a running AVE, if not start one.
if(!iselateerrno(ave.ave)) { // If the AVE opened proceed
app = ave_dev_open(ave.ave,ave.residual, 0, 0); // Create an application AVO
if(!iselateerrno(app)) {
printf("Application opened succesfully!\n"); // Print an encouraging message :)

toolkit = ave_dev_opentoolkit(ave.ave, app); // Open toolkit
if (toolkit!=NULL) {

// Opening the dialog, that's our window, the FDI-flags are so called furniture flags which decides whether different features should be on or off.
dialog = ave_toolkit_createdialog(toolkit, "Window2", NULL, 0, 0,
FDI_INNER | // Our sizing defines the inner size
FDI_CLOSE | // Let's add a close-button
FDI_BORDER | // And a border
FDI_TITLE | // And a titlefield
FDI_CONTENT | // And a content field
FDI_DRAG | // Let it be draggable
FDI_RESIZE | // and resizeable
FDI_DEPTH); // and finally let it be able to change it's depth compared to other windows
ave_app_addavo(app, NULL, (ave_avo_t *)dialog, 0); // Add our dialog AVO to our application AVO
}
size = ave_avo_getprefsize((ave_avo_t *)dialog); // get the preferred window size
ave_avo_change((ave_avo_t *)dialog, 0, 0, size.width, size.height, CM_NONE); // and set our windows' size to the preferred one.

ave_avo_update((ave_avo_t *)dialog); // Update our dialog after changing it's size
sleep(10); // Wait 10 seconds
ave_app_closeall(app); // Close all AVOs previously added to out application AVO
ave_dev_closetoolkit(ave.ave,toolkit); // Close toolkit
ave_dev_close(ave.ave,app); // Close our application AVO and destroy it's childs, if this is the last application close the AVE device too.
}
}

return(0);

}

Rate this item
12345678910



:: Your comment
Bold Style  Italic Style  Underlined Style  Image Link  Insert URL  Email Link  Quote  C/C++ Source  Disable *What`s that?


Before posting non-english message, check your browser`s encoding!
» Name » Password

UtilityBase is a site focused on development for Amiga systems,
spanning over all different Amiga clones, that be AmigaOS 3.x, 4.x, MorphOS, AROS or AmigaDE/Anywhere.
News syndication: RSS
Contact address: mail@utilitybase com