Hi All,
Please could one (or more) or you C68 gurus out their show me some example code to define and use a window? I do not want the default sized window, but to use my own values.
I've looked at the documentation and, apart from a headache (and drinking problem) I've only achieved a remarkable amount of errors.
Thank you,
Whopper
C68 Window
Re: C68 Window
XorA,
No, unfortunately not that. I've got that. I found the definition of the WINDOWDEF-t type and can create an instance of the type. But how to create the thing? That's my problem.
Thanks for answering,
Whopper
You woke me for THAT!!!
Re: C68 Window
The initial Window in a C68 program is called the console - It is normally opened by the startup code and defined by setting the _condetails structure.
If you want to open additional windows beyond the console, there are various ways to do that:
(
is a low-level call to open a new window - It's not associated with C I/O in any way, and only prepared for unbuffered I/O, so your only way to use it is low-level calls like io_sstrg() and sd_... calls.
Is similar, with a device name like "con_512x256a0x0" and the same restrictions.
For C I/O, you need to open or fopen a device with a device name:
will open a new window for C character I/O. You can use standard C I/O functions to communicate with that window. Note you will not get the nice C68 window title and border that you get on the console.
You close such a window in exactly the same way as you would close any other file.
Tobias
If you want to open additional windows beyond the console, there are various ways to do that:
(
Code: Select all
chanid_t ut_con (WINDOWDEF_t *wdef)
Code: Select all
chanid_t ut_window (char *name, char *details)
For C I/O, you need to open or fopen a device with a device name:
Code: Select all
FILE *handle;
handle = fopen (con_512x256a0x0","rw");
if (handle != NULL) {
fprintf (handle, "%s\n", "Hello World");
}
You close such a window in exactly the same way as you would close any other file.
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: C68 Window
tofro,
Thanks for your reply.
The last code example seems to be what I want. I tried this on Qemulator and Q68 and neither worked. They both compiled fine, but on executing the default console was was displayed with the usual end message "Press ENTER to continue."
Whopper
Thanks for your reply.
The last code example seems to be what I want. I tried this on Qemulator and Q68 and neither worked. They both compiled fine, but on executing the default console was was displayed with the usual end message "Press ENTER to continue."
Whopper
You woke me for THAT!!!
Re: C68 Window
Note if you actually want to see the window, you need to give the system some time to draw it - Your program seems to end prematurely and the window is closed again so fast (because the job is done), that you have no chance to see something. Send the program into a long loop after opening the window.
Tobias
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO