Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
119 user(s) are online (75 user(s) are browsing Forums)

Members: 0
Guests: 119

more...

Headlines

 
  Register To Post  

New tutorial online
Amigans Defender
Amigans Defender


See User information
A new instalment in my loose series of tutorials on OS4 user interface programming can now be found on OS4coding.net, this time with a full working C code example. Enjoy!

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: New tutorial online
Just can't stay away
Just can't stay away


See User information
Thank you very much,

very instructive tutorial.

We sure do need good C programmers, i could not resist though:

a Gui4 Cli look alike
G4C

WINBIG 
--1 315 200 "Gui4Cli AppWindow"
 
WINTYPE 11110001

xONLOAD
 GuiOpen 
#this

xONCLOSE
 GuiQuit 
#this
 
xAPPWINDOW File_
 ChangeGad 
#this 1 0 0 315 200 $File_
 
GadRedraw #this 1 0 0 0 0

xBUTTON 0 0 315 200 "Drop a file icon here!"
 
GadID 1
 Attr frame 31


Edited by JosDuchIt on 2011/8/5 9:50:16
Go to top
Re: New tutorial online
Home away from home
Home away from home


See User information
@Trixie
New article also pretty interesting. Few more articles of this kind, and we can make a os4-progamming-book at last

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: New tutorial online
Amigans Defender
Amigans Defender


See User information
@ kas1e
Quote:

Few more articles of this kind, and we can make a os4-progamming-book at last


Actually, the material for my articles comes from the sketches I wrote for the OS4 Programmer's Guide (which unfortunately never took off).

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: New tutorial online
Quite a regular
Quite a regular


See User information
Thank you. Tutorial are always welcome. Keep up with the good work.


Retired
Go to top
Re: New tutorial online
Just popping in
Just popping in


See User information
Really a pitty. Any chance to release some pre-version of your tutorial to public?

Go to top
Re: New tutorial online
Just can't stay away
Just can't stay away


See User information
Good job, Trixie, keep 'em coming!

Quote:
Reth wrote:
Really a pitty. Any chance to release some pre-version of your tutorial to public?

Isn't that what he is doing already?

Best regards,

Niels

Go to top
Re: New tutorial online
Just can't stay away
Just can't stay away


See User information
I have been studying the example and have some questions about declaring structures and opeing libraries;

- at line 40/41 i read ( not in 'main')
struct Library *IntuitionBase, *UtilityBase;
struct IntuitionIFace *IIntuition;
Why is it not needed to declare *IUtility here ?

- more generally: why not declare all used structures (in a one-file source) at the beginning? Seems easier to maintain using such a standard, or are there reasons not to ?

Go to top
Re: New tutorial online
Amigans Defender
Amigans Defender


See User information
@JosDuchIt
Quote:

Why is it not needed to declare *IUtility here ?

Because the example does not call any Utility Library functions. The library is opened to provide the hook functionality but you don't need the interface unless you want to use the library's functions yourself.

Quote:

why not declare all used structures (in a one-file source) at the beginning?

What exactly do you mean?

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: New tutorial online
Home away from home
Home away from home


See User information
@JosDuchIt

Depending on how you compile your program.

You don't need to open and close libraries and you don't need to declare the interfaces, Just include the proto types.

Compile your program whit

GCC myapp.c -o myapp.exe -lauto

if you don't like to type IExec/IDOS in front of every exec command, you can type

GCC myapp.c -o myapp.exe -lauto -D__USE_INLINE__

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: New tutorial online
Amigans Defender
Amigans Defender


See User information
Quote:

LiveForIt wrote:

Compile your program whit

GCC myapp.c -o myapp.exe -lauto


No, don't do that when using ReAction for GUI. Read the first tutorial, section 2.3.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: New tutorial online
Just can't stay away
Just can't stay away


See User information
@trixie
Quote:
Quote:

Quote:
why not declare all used structures (in a one-file source) at the beginning?


What exactly do you mean?


I think an erroneous read of your source made me miss some declarations (besides IIntuition) As i missed IIntuition and thought others were only declared in main or in the functions, i was wondering in which cases there is an advantage to do that. I did not see one, but then some parts of C are really puzzling to me.







Go to top
Re: New tutorial online
Amigans Defender
Amigans Defender


See User information
@JosDuchIt

I always prefer declaring local variables for data that is not needed throughout the entire lifetime of the program. A good example is the pointer to the Intuition window: you'll see in the tutorial example that instead of declaring and keeping one global variable, the struct Window pointer is declared three times locally (inside the functions) and is obtained from the window object when it is needed. It does not have any particular advantage in this example but avoiding globals is good coding practice because it is generally safer.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project