Welcome, Guest. Please login or register.

Author Topic: Executing c command in c  (Read 10433 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nicholas

Re: Executing c command in c
« on: May 10, 2017, 06:04:56 PM »
Quote from: foleyjo;825604
Good to know thanks.

I'm starting to think I might give up or change language as I'm just not finding anything that I is useful to help me understand what to do. Except for the help here which was great.

For example I'm now trying to open a jpg picture in mui.
I found how to play a sound in mui but nothing about pictures.
I found one tutorial that says how to create a datatype object but nothing on how to set that object as a picture or how to display said picture in a window.
I looked at mui_image. I think I have to use the OLD_Image attribute because I didn't see anywhere else to set the image.

I've managed to create a listview with a list that is loaded from a file and when I double click an item in the list it runs an event (Currently shows me the contents of the directory of where the file is stored in the console). I tried to find information on how to do something for a single click .
The only thing I can find that seems to make sense is select_change (https://muidev.de/wiki/Documentation/API/MUI_Listview#MUIA_Listview_SelectChange)
but this only works if I hold the mouse button down and drag it up and down the list.

So I'm thinking it's either keep asking lots of questions here or just give up and as I don't want to annoy people with my questions I'm leaning towards the give up. :(


This is an old but useful guide to developing in C for the Amiga.

http://library.morph.zone/Magic_User_Interface_Programming

A nice MUI tutorial

http://library.morph.zone/Magic_User_Interface_Programming

If you use IRC the #mui channel on Freenode is a good place to ask questions.
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline nicholas

Re: Executing c command in c
« Reply #1 on: May 10, 2017, 10:36:14 PM »
Quote from: foleyjo;825621
Thanks for the advice nicholas though were the 2 links supposed to be to the same site.
I did find that site but I was looking through an example I downloaded from it but the comments were not in English.

I managed to get an image loaded using Dtpic.
It wasn't working earlier but I think I was using an old version of mui as I downloaded the latest from muidev.de and Dtpic worked.

There's also some demos in this version that I didn't have which seem to do things that I need so I can try and learn the code.


Doh! I posted the wrong first link lol

This is the correct one http://aminet.net/package/dev/c/ACM

These are also handy, they are quite Amiga generic and not so MorphOS specific.

http://library.morph.zone/MorphOS_API_and_Its_Organization
http://library.morph.zone/Exec_Lists
http://library.morph.zone/Taglists

And the bombjack site has PDFs of the RKRM's and almost every Amiga development book ever published.

http://www.bombjack.org/amiga/index.htm

Another handy site for reference

http://amigadev.elowar.com/

Some good articles in this repo too

https://github.com/inrms/guidetoamigacompatibleprogramming/blob/master/README.md
« Last Edit: May 10, 2017, 10:54:32 PM by nicholas »
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline nicholas

Re: Executing c command in c
« Reply #2 on: May 10, 2017, 11:06:28 PM »
There's always the excellent Hollywood if you give up on C though.

It's powerful yet simple.

http://hollywood-mal.com/
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline nicholas

Re: Executing c command in c
« Reply #3 on: May 11, 2017, 01:02:02 AM »
Quote from: foleyjo;825628
Haha I thought it was strange they both linked to the same page.
. I'll have a read through those other sites tomorrow.

I looked at Hollywood but I read somewhere that it doesn't allow you to launch external programs which is why I avoided it as its something I need.


I've managed to get images changing with a single click now using

Code: [Select]

DoMethod(list, MUIM_Notify, MUIA_List_Active, MUIV_EveryTime,
app, 2,
MUIM_Application_ReturnID, DISPLAY);
   
Where DISPLAY contains a set attributes function on my DtPic object.

So I think I'm going to keep trying for a bit.
I should have enough information now to help me understand what I'm doing :D


Excellent! I look forward to seeing your first creation when it's finished. :)

Hollywood does support launching external programs though btw.

http://www.hollywood-mal.com/docs/html/hollywood/Execute.html
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline nicholas

Re: Executing c command in c
« Reply #4 on: May 11, 2017, 07:17:41 AM »
Quote from: foleyjo;825639
Oh no way. If I knew that would have looked into getting hollywood as it looks much easier.

If I get stuck again I'll definitely consider changing to it.
For now I'll just convince myself I made the right choice because I'm learning useful things.


You can't go wrong with C, no pain no gain. :)
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini