/* * File: hello2.m */ #import "Photon.h" #import "PhWidget.h" #import "PhWindow.h" #import "PhButton.h" #include int activated( PtWidget_t *widget, void *data, PtCallbackInfo_t *info) { //suppress compiler warnings concerning unused arguments. widget = widget, data = data, info = info; PtExit( 0 ); return Pt_CONTINUE; } int main( int argc, char *argv[] ) { PhWindow * mainWindow; PhButton * button; [ Photon init ]; mainWindow = [[PhWindow alloc] init]; button = [[PhButton alloc] init ]; [ button parent: [mainWindow widget]]; [ mainWindow createWindow ]; [ mainWindow title: "To jest proba" ]; [ mainWindow Width: 300 Height: 100 ]; // button.DIMx = 100; // button.DIMy = 20; button.POSx = 80; button.POSy = 35; button.tekst = "Press to exit"; // lub [ button setWidth: 120 andHeight: 25 ]; [ button createButton ]; [ button AddCallback: activated ]; [ mainWindow realize ]; [ Photon main ]; return (EXIT_SUCCESS); }