Adding Script to a Navigation Bar Icons

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Adding Script to a Navigation Bar Icons

Post by liveme » Sat Mar 20, 2021 7:31 am

:idea: Hi ppl,
just dropped a Navigation bar to the top of my stack,
I'm guessing there is some way to add a script to each Icon, just as with we do with buttons, right ?
So, how does one point a specific script to each Icon ?
tks !
good weekend !
Image
Attachments
icon menu bar.png
icon menu bar.png (1.9 KiB) Viewed 5495 times

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Adding Script to a Navigation Bar Icons

Post by jmburnod » Sat Mar 20, 2021 10:17 am

hi,
You. may get the clicked icon by hiliteChanged message

Code: Select all

on hiliteChanged
   put the hilitedItem of me && the hilitedItemName of me
end hiliteChanged
Best regards
Jean-Marc
https://alternatic.ch

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Adding Script to a Navigation Bar Icons

Post by liveme » Sat Mar 20, 2021 6:58 pm

Thanks a lot Jean Marc..I will try that asap !
Have a nice weekend !

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Adding Script to a Navigation Bar Icons

Post by liveme » Mon Mar 22, 2021 11:08 am

@Jean Marc,

I had created card number 2 before I set the navigation bar as a default background :
Would you know if one can add the nav bar to an already created card...or only on tobe next cards... ?
8)

andresdt
Posts: 146
Joined: Fri Aug 16, 2019 7:51 pm

Re: Adding Script to a Navigation Bar Icons

Post by andresdt » Mon Mar 22, 2021 1:32 pm

If possible.
On the LC toolbar, select:
Object> Place Group> The name of your group

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Adding Script to a Navigation Bar Icons

Post by liveme » Mon Mar 22, 2021 7:11 pm

*Correcting :

finally, the Nav Bar did not hold onto other Cards... :( it started disappearing then would not "stick" anymore...
So I guess one has to set it as a default bkg - BEFORE - creating any cards ! :oops:
:shock: :shock:

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Adding Script to a Navigation Bar Icons

Post by liveme » Tue Mar 23, 2021 3:45 am

Would I be creating a BIG MESS if I then copy the Nav Bar from Page 1 to the top of all other cardes of my App ???
:shock:

Or should I recreate all pages AFTER setting it as a default bckgrd ?
thanks
(Script is included in the NavBar)

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Adding Script to a Navigation Bar Icons

Post by liveme » Tue Mar 23, 2021 5:54 am

***filling up a bugs repport, navbar keeps disapearing on every new page..after working for few minutes..***

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9358
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Adding Script to a Navigation Bar Icons

Post by richmond62 » Tue Mar 23, 2021 9:08 am

SShot 2021-03-23 at 10.05.24.png
-
roll-ups.jpeg
roll-ups.jpeg (6.75 KiB) Viewed 5170 times
-
I am not going to repeat what I have already stated several times. 8)
Attachments
Compass.livecode.zip
Here's the stack.
(25.98 KiB) Downloaded 133 times

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Adding Script to a Navigation Bar Icons

Post by liveme » Tue Mar 23, 2021 10:02 am

Getting closer...but still loosing some Icons along the way... :mrgreen:
Maybe still in need of a Covid 2nd shot 8)

Image
Attachments
disapearing icons.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9358
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Adding Script to a Navigation Bar Icons

Post by richmond62 » Tue Mar 23, 2021 10:41 am

Odd, that.
Attachments
ICONZ.zip
Navigator icons
(20 KiB) Downloaded 137 times

andresdt
Posts: 146
Joined: Fri Aug 16, 2019 7:51 pm

Re: Adding Script to a Navigation Bar Icons

Post by andresdt » Tue Mar 23, 2021 12:30 pm

Could not be doing. It works well for me and it doesn't go away.
Attachments
Compass.rar
(25.4 KiB) Downloaded 142 times

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”