Writing simple GUI - yet another GEM demo coding in C
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
-
- Fuji Shaped Bastard
- Posts: 2080
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Writing simple GUI - yet another GEM demo coding in C
Just create a dialog with an edit field in it, then use form_do(). For console programs, just use gets() or Cconrs() directly.
Re: Writing simple GUI - yet another GEM demo coding in C
what I try to have is a real GEM window (so not the console vt52 screen) where I can write text (easy with v_gtext) and input text like in the old adventure text. This cannot be done with a form_do() I think ?ThorstenOtto wrote: ↑Sun Jan 23, 2022 12:58 pm Just create a dialog with an edit field in it, then use form_do(). For console programs, just use gets() or Cconrs() directly.
Pit
-
- Fuji Shaped Bastard
- Posts: 2080
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Writing simple GUI - yet another GEM demo coding in C
No, for this you have to the handle the MU_KEYBD events in your event loop, and assemble them to an input line if that's what you need. But this is a bit more complicated, you also need some kind of pseudo terminal where you store the texts, so that you can redisplay them when receiving a WM_REDRAW. You also have to handle all line editing (backspace, cursor movement etc) yourself.
Re: Writing simple GUI - yet another GEM demo coding in C
ok (unfortunaly) clear...ThorstenOtto wrote: ↑Thu Jan 27, 2022 6:08 am No, for this you have to the handle the MU_KEYBD events in your event loop, and assemble them to an input line if that's what you need. But this is a bit more complicated, you also need some kind of pseudo terminal where you store the texts, so that you can redisplay them when receiving a WM_REDRAW. You also have to handle all line editing (backspace, cursor movement etc) yourself.

thanks ThorstenOtto

Pit
Re: Writing simple GUI - yet another GEM demo coding in C
How about a bunch of long blank edit fields one on top of the other and let GEM do most of the work? This may not work at all depending on what you're trying to achieve, though.
Re: Writing simple GUI - yet another GEM demo coding in C
Isn't there something called xdialog which handles this multiline text edit object stuff? AFAIK xdialog has extended the textedit fields to handle multiline text inputs.
Re: Writing simple GUI - yet another GEM demo coding in C
No word wrap, horrible UX for longer texts, so indeed the OP could clarify the target. And perhaps try existing solutions.
Re: Writing simple GUI - yet another GEM demo coding in C
Maybe this is not in the scope of the threads topic, but I remebbered ASH E-Mailer (and probably other applications) implemented multi line form objects. It is called "XTED" and extends the TEDINFO Object. It also supports scrolling.
You can find it in the ASH E-Mailer Sources [1], however it't probably not so easy to figure out how it works and maybe it depends on Magic kernel.
[1] ASH E-Mailer Sources: https://www.atariworld.org/download.php?id=213
You can find it in the ASH E-Mailer Sources [1], however it't probably not so easy to figure out how it works and maybe it depends on Magic kernel.
[1] ASH E-Mailer Sources: https://www.atariworld.org/download.php?id=213
-
- Fuji Shaped Bastard
- Posts: 2080
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Writing simple GUI - yet another GEM demo coding in C
XTED is a MagiC extension only, and makes use of the EDITOBJC shared library. It doesn't work in TOS (not even with WDIALOG).
Re: Writing simple GUI - yet another GEM demo coding in C
I suppose we don't have the sources of EDITOBJC? That would be a pretty neat addition to modern AESes.
Re: Writing simple GUI - yet another GEM demo coding in C
Jo Even
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
-
- Fuji Shaped Bastard
- Posts: 2080
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Writing simple GUI - yet another GEM demo coding in C
Yes but the source alone does not help much. The SLB relies on an internal MagiC function to hook into the AES function dispatcher: https://github.com/th-otto/MagicMac/blo ... slb.c#L334 That (or a similar mechanism) would have to implemented in other AES, too.
Re: Writing simple GUI - yet another GEM demo coding in C
HI all
question.
I use "vst_height" to choose the height of the font (the system font) iused in my text window
with "13" the font appear at the right size in low or medium resolution
but, whatever the size I choose, in the monochrome resolution, the size remain shorter than the normal size (like in the menu)
any idea how to choose the "normal" size of the font in mono resolution ?
thanks
Pit
question.
I use "vst_height" to choose the height of the font (the system font) iused in my text window
with "13" the font appear at the right size in low or medium resolution
but, whatever the size I choose, in the monochrome resolution, the size remain shorter than the normal size (like in the menu)
any idea how to choose the "normal" size of the font in mono resolution ?
thanks
Pit
Re: Writing simple GUI - yet another GEM demo coding in C
Sorry, forget my question.... 
I had another issue in fact.
Pit

I had another issue in fact.

Pit
Re: Writing simple GUI - yet another GEM demo coding in C
IIRC, the GEM library Windom had special objects for multiline editing...
AtariUpToDate - Atari ST/TT/Falcon software database and version tracker: https://www.atariuptodate.de
ST-Computer magazine - https://www.st-computer.org/
ST-Computer magazine - https://www.st-computer.org/
Re: Writing simple GUI - yet another GEM demo coding in C
use vst_point() to set the font size and check the return value; this will be the next available "real" font size you should set.
Re: Writing simple GUI - yet another GEM demo coding in C
typedef struct W_XEDIT:
http://windom.sourceforge.net/doc/html/ ... XEDIT.html
Maybe the structure is initialized by using mt_RsrcXload?
http://windom.sourceforge.net/doc/html/ ... ource.html
-
- Fuji Shaped Bastard
- Posts: 2080
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Writing simple GUI - yet another GEM demo coding in C
No, that function just handles color icons. Its hardly possible for the library to initialize it, since that object type will not appear in resource files.