Ma ogni volta definire all'arma bianca? Possibile che non si possa fare una discussione civile, anche se l'argomento è spinoso? Mah. :roll: Citazione da: "TheKaneB"Ad esempio mi piacerebbe vedere un porting di Qt su MOS,No, dai. Le Qt no. Se di porting si dovesse parlare, preferirei di gran lunga quello di WPF (Windows Presentation Foundation). :animals-pig: (purtroppo manca l'emoticon che sbava :snooty: )
Ad esempio mi piacerebbe vedere un porting di Qt su MOS,
Citazioneperchè MUI4 proprio non riesco a digerirlo (nè tantomeno le versioni vecchie e i cloni, come Zune).Come mai?
perchè MUI4 proprio non riesco a digerirlo (nè tantomeno le versioni vecchie e i cloni, come Zune).
// gcc hello.c -lmui#include <exec/types.h>#include <libraries/mui.h> #include <proto/exec.h>#include <proto/intuition.h>#include <proto/muimaster.h>#include <clib/alib_protos.h> int main(void){ Object *wnd, *app, *but; // GUI creation app = ApplicationObject, SubWindow, wnd = WindowObject, MUIA_Window_Title, "Hello world!", WindowContents, VGroup, Child, TextObject, MUIA_Text_Contents, "33cHello world!nHow are you?", End, Child, but = SimpleButton("_Ok"), End, End, End; if (app != NULL) { ULONG sigs = 0; // Click Close gadget or hit Escape to quit DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR)app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); // Click the button to quit DoMethod(but, MUIM_Notify, MUIA_Pressed, FALSE, (IPTR)app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); // Open the window set(wnd, MUIA_Window_Open, TRUE); // Check that the window opened if (XGET(wnd, MUIA_Window_Open)) { // Main loop while((LONG)DoMethod(app, MUIM_Application_NewInput, (IPTR)&sigs) != MUIV_Application_ReturnID_Quit) { if (sigs) { sigs = Wait(sigs | SIGBREAKF_CTRL_C); if (sigs & SIGBREAKF_CTRL_C) break; } } } // Destroy our application and all its objects MUI_DisposeObject(app); } return 0;}
CitazioneCitazioneperchè MUI4 proprio non riesco a digerirlo (nè tantomeno le versioni vecchie e i cloni, come Zune).Come mai?Perchè è vecchio. Cablare la GUI dentro al codice è una cosa da anni '90. Oggi, nel 2011, voglio un editor visuale o almeno un sistema per definire le GUI a prescindere dal codice (cosa che Qt mi offre tramite QtDesigner, ad esempio). Programmare con MUI, invece, significa affossare la GUI in chilometri di illegibili funzioni innestate, abbellite da simpatici #define che trasformano un potenziale programma C in una oscena lista della spesa con sindrome da CAPS-LOCK.Esempio tratto da http://en.wikibooks.org/wiki/Aros/Developer/ZuneCodice: [Seleziona]// gcc hello.c -lmui#include <exec/types.h>#include <libraries/mui.h> #include <proto/exec.h>#include <proto/intuition.h>#include <proto/muimaster.h>#include <clib/alib_protos.h> int main(void){ Object *wnd, *app, *but; // GUI creation app = ApplicationObject, SubWindow, wnd = WindowObject, MUIA_Window_Title, "Hello world!", WindowContents, VGroup, Child, TextObject, MUIA_Text_Contents, "33cHello world!nHow are you?", End, Child, but = SimpleButton("_Ok"), End, End, End; if (app != NULL) { ULONG sigs = 0; // Click Close gadget or hit Escape to quit DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR)app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); // Click the button to quit DoMethod(but, MUIM_Notify, MUIA_Pressed, FALSE, (IPTR)app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); // Open the window set(wnd, MUIA_Window_Open, TRUE); // Check that the window opened if (XGET(wnd, MUIA_Window_Open)) { // Main loop while((LONG)DoMethod(app, MUIM_Application_NewInput, (IPTR)&sigs) != MUIV_Application_ReturnID_Quit) { if (sigs) { sigs = Wait(sigs | SIGBREAKF_CTRL_C); if (sigs & SIGBREAKF_CTRL_C) break; } } } // Destroy our application and all its objects MUI_DisposeObject(app); } return 0;}Comunque, lasciamo perdere questo OT, magari se ne riparla in un topic adatto :-)
@Shinkuro: so come si separa il View (la GUI) dal Model (l'engine del programma), ma ho mostrato quell'hello world perchè ricalca esattamente ciò che volevo mostrare: la GUI va generata programmaticamente nel codice, e non esiste alcuno strumento per il design delle GUI data-driven. Come dicevo prima si tratta di un modello di sviluppo anni '90, e non mi va di perdere il mio tempo nella scrittura di codice che potrebbe fare un tool al posto mio. Appunto citavo Qt Designer, perchè sebbene la GUI venga generata staticamente a compile time, il suo codice viene processato da un tool automatico a partire da una descrizione XML generata da un tool visuale.
Credo ci sia anche per aros...
Ma non era meglio aprire un topic allo scopo? Io non ho risposto proprio perché Antonio ha detto che eravamo OT.
@ThekaneBAlmeno in questo os4 è piu' avanti:http://http://amigabounty.net/index.php?function=viewproject&projectid=46