I tried
Code: Select all
set the title of this card to "test"

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
set the title of this card to "test"
Your posting put me on the track. I looked in the dictionary, and sure enough found what I needed :dunbarx wrote:Now since the label is a property of a stack that stands apart from its name, it might be fun indeed to write a handler that changes the title (of the stack) according to which card you are on. This sounds like cheating, but is definitely not.
Code: Select all
set the title of this stack to "my title"
Frankly, I do not see why I would ever want to change the name of the stack...dunbarx wrote: You could, of course, change the name of the stack, as opposed to its title. But this is pure pedantry. Don't. Just don't.
To quote Isaac Asimov in "The Non-A" : "The map is not the territory".dunbarx wrote:The effect, for your purposes, would be same, if you did not set the "title" property at all. That was my only point, so that you see all the possibilities. But this is fraught with peril, and may well require a layer of management that is totally unnecessary.
So then what did you have in mind with your very first post? You asked for a way to change the titlebar. We can do that now. If not the name of the card, then something else of interest, I assume? I had suggested several possible attributes that might serve.The displayed title bar should not be the name of the card
I have been programming for years in all flavors of Basic (since 1982) including RealBasic now Xojo, and am simply playing around with LiveCode. I follow patiently the tutorials, but exercise around much, to feel more comfortable. For instance today I have created a short method to display time zone and cities from the Windows systemdunbarx wrote:So then what did you have in mind with your very first post? You asked for a way to change the titlebar. We can do that now. If not the name of the card, then something else of interest, I assume? I had suggested several possible attributes that might serve.
Curious. I thought you knew, as I originally requested it and posted a tentative code : I changed the title of the stack in each card.dunbarx wrote:By the way, in your openCard handler, what attribute of each card did you use to change the title property?
Code: Select all
on opencard
set the title of this stack to field "titleField"
end openCard
That is precisely what the code does in the openCard message : change the title of the stack, so it changes the window title according to which card is on the screen.dunbarx wrote:I still do not understand. I see you have an opencard handler, presumably in the stack script. But this sets the title of the stack ubiquitously to "My Title". If I were doing it, then for argument's sake let us assume I had a background field on each card (this could be hidden) that had some unique piece of data. Let us name this field "titleField":
Now the title changes to reflect the value of the contents of the field every time you navigate to a different card. Again, this field is resident on each card, but has unique data on each card (sharedText set to "false").Code: Select all
on opencard set the title of this stack to field "titleField" end openCard
Wasn't the intent to change the title based on the specific card the user is looking at? Or am I missing the whole thing?
Craig, I am not at the app design yet. I posted in the beginners section because I am still discovering LC and originally did not understand why I could not change the card title (which does not exist).dunbarx wrote:I just was asking how you stored, or accessed, the various different titles. Are they local and explicit to "openCard" handlers in each card script? There is nothing wrong with this, I suppose. But if so, then I would suggest thinking of a far more compact and robust method, where a single openCard handler in the stack script uses attributes of each card. One handler, local attributes, instead of multiple handlers, no attributes.
I still do not know if this is how you implemented your project. Or some other way entirely. Just curious, though.