UtilityBase
Your guide to Amiga development |
|
|
|
|
|
|
| |
| |
| |
|
|
|
Online members:
abalaban 28 min(s) ago tboeckel 35 min(s) ago
25 guests are online.
You are an Anonymous user. You can register for free by clicking here. |
|
|
| |
| |
| |
| |
| |
| |
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);
} |
|
|
|
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:  Contact address: mail@utilitybase com
|
|
|