Hypertext in treeview

Discuss any general programming issues here
delbourg
Posts: 21
Joined: Tue Jun 20, 2017 6:07 am
Location: Tasmania

Hypertext in treeview

Post by delbourg »

I am relatively new to Hollywood.

I have created a nice treeview list of my famly tree.(it is not a web page.)

Is there a way whereby if I click on an item on my tree I can call up a picture or pdf file say?
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Hypertext in treeview

Post by SamuraiCrow »

You could try using buttons instead of links. They should be nestable in the same way links are.

However, there might be trouble pulling up a PDF unless you use an external program.
I'm on registered MorphOS using FlowStudio.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: Hypertext in treeview

Post by Bugala »

Wihtout knowing how you ahve done that it is difficult to say, but basically as SamuraiCrow said.

You could for example draw a rectangle box layer and then on top of those boxes write each of your entries. Then you could make that rectangle become a button, and that button would work simply work so that when you click it, it woudl show the picture.

Of course you could also make buttons using invisible boxes, in which case you dont need that rectangle box at all, this is called "simplebutton" where you just choose the rectanble area. Downside of this however is that it is more difficult to see if one of the buttons is misplaced. By using those rectangle boxes, you can right away see if one of the boxes is not at correct location.

edit: forgot to mention. Check documentation from part "MakeButton"
delbourg
Posts: 21
Joined: Tue Jun 20, 2017 6:07 am
Location: Tasmania

Re: Hypertext in treeview

Post by delbourg »

Thanks for the suggestions. I will try to see if invisible boxes within a treeview work.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Hypertext in treeview

Post by airsoftsoftwair »

Note that if you're using RapaGUI, MakeButton() won't work. On non-Amiga systems you can just use the following code to show a picture:

Code: Select all

Execute("picture.jpg")
This will open "picture.jpg" with the default viewer for JPG but it will only work on Windows, Mac OS, and Linux.
delbourg
Posts: 21
Joined: Tue Jun 20, 2017 6:07 am
Location: Tasmania

Re: Hypertext in treeview

Post by delbourg »

Thank you airsoft. The execute command is just what I needed. It is so simple and solves all my problems.
delbourg
Posts: 21
Joined: Tue Jun 20, 2017 6:07 am
Location: Tasmania

Re: Hypertext in treeview

Post by delbourg »

I have failed to get hrules in treeview.

What I did was to enter. Moai.set("tv", "HRules", true). In my hollywood hws script. What am I doing wrong?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Hypertext in treeview

Post by airsoftsoftwair »

Treeview.HRules has an applicability of "I" which means that it can only be set at initialization time. So you have to set it in your XML directly, e.g. like this:

Code: Select all

<treeview .... hrules="true">
   ...
</treeview>
delbourg
Posts: 21
Joined: Tue Jun 20, 2017 6:07 am
Location: Tasmania

Re: Hypertext in treeview

Post by delbourg »

Thank you for the instructions. As you see I am gradually learning...

Meanwhile I have found it difficult to identify or extract an item from a treeview. I found the instruction for getentry a bit confusing but that is probably my fault.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: Hypertext in treeview

Post by Bugala »

Just wanting to add to my original comment about using buttons, that I actually didnt understand treeview was some sort of plugin, i thought you were simply meaning that you made your family history in tree like view. Hence my comment about buttons might not be relevant at all, as i have no clue what this treeview thing is.
Post Reply