Building a simple calendar application

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
camezun
Posts: 1
Joined: Fri Apr 23, 2010 4:51 am

Building a simple calendar application

Post by camezun » Fri Apr 23, 2010 4:59 am

I'm a newbie, and am following the tutorial for building a basic calendar app. I've gotten to the point where I need to add another card to show a different month from the first one I started, which was January. So, basically I have two cards, one that represents January, and one that should represent February. However, when I go to edit the Label for the February card, it also changes the label for the January card too. So, now I have 2 February cards. What am I doing wrong? It's probably something super simple but I just can't figure it out. How can I make one card to say January, and the other February?

Also, in regards to the buttons and the script that goes in to activate them.....On the January card, I was able to disable the "Go to Previous Month," like the tutorial said, but how do I enable the button "Go to Next Month" to actually work?

Help!!! I'm super frustrated!!!!!

Thanks!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Building a simple calendar application

Post by Mark » Fri Apr 23, 2010 1:30 pm

camezun,

I never looked at those toturials, but I'll try to answer.

Probably you need to set the sharedText of the label field to false.

You can enable a button with the enable command:

Code: Select all

enable btn "Go to Next Month"
Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Building a simple calendar application

Post by dunbarx » Fri Apr 23, 2010 2:30 pm

Mark is probably correct. You have set up a condition where the field's contents (not really a label, is it? That is another attribute) are common across all the cards you have, or will ever have, in the stack. This can be changed so that the field's contents are local to the card you are on. This is usually the more natural behavior, though there is nothing wrong with the other way.

And a great self-tutorial is to use the card itself as a guide to loading the contents of the field. What if you keep the background behavior as it is, name the various cards with the month, and then load the name of the card into the field with an openCard handler placed in the stack script?

Fun stuff. Write back with more...

Craig Newman

Post Reply