Question about tabs

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
pony
Posts: 8
Joined: Tue Mar 15, 2011 3:04 pm

Question about tabs

Post by pony » Wed Mar 16, 2011 2:33 pm

So, upon reading the user manual, it appears I am responsible for handling tab events and then drawing the necessary interface on each pane, is this correct?
In other development environments I can design my interface by adding controls to each tab, the compiler takes care of the rest. I'm not sure why I would want the same control on each tab, and the LiveCode method seems to be a laborious and unnecessary method of designing the interface. Why can't I drop a control on the first pane, this click to the next pane and add a different control? It also appears impossible to move a control from outside the pane to the pane - it always ends up behind the pane (so, I have a control on my main window and decide it would be better on a tab pane, I can not move it to the pane once it has been placed outside the pane).

I like the fact Livecode compiles for iOS, but its a lot different from the Real Studio I am used to. I'm not sure if its worst than Real Studio, or just so different that I have to rethink all this from scratch - thoughts?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Question about tabs

Post by FourthWorld » Wed Mar 16, 2011 3:34 pm

LiveCode is very different from many, if not most, other IDEs. IMO it's uncommon way of working also delivers equally uncommonly high productivity, esp. given the zero compile time, but of course that high level of productivity will only be realized after one has gone through the unlearning curve. ;)

With tab controls, there are at least two different ways to handle them: you can put controls for each tab into a group, or put the tab itself into a group shared among multiple cards and put the controls for each tab on the card.

There are advantages to each approach, so it's difficult to say which one is "best". But this unusual degree is flexibility is why tab controls in LiveCode aren't true containers themselves, but instead are triggers for you to handle whichever type of container that fits the needs of the layout you're working on.

While it may seem "laborious" at first, as you work with LiveCode more and realize the benefits of a typeless language you'll come to appreciate that overall working with LiveCode is generally simpler than most typed or even semi-typed languages.

And with tabs it's not all that hard - here are handlers for using each type of container, requiring only that you name your groups or cards to match the labels in the tab control:

Code: Select all

-- Groups:
on menuPick  pItem
  repeat for each line tTab in me
    set the visible of group tTab to (pItem = tTab)
  end repeat
end menuPick

-- Cards:
on menuPick pItem
  go cd pItem
end menuPick
For a broad view of the benefits of scripting languages, these two papers may be helpful - while they specifically address languages other than LiveCode, much of what they have to say about those languages applies equally well to LC:

In Praise of Scripting: Real Programming Pragmatism
http://www.cse.wustl.edu/~loui/praiseieee.txt

Scripting: Higher Level Programming
for the 21st Century
http://www.tcl.tk/doc/scripting.html
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply