CardLayout works through references and associative arrays. O'Reilly's 'Advanced
Perl Programming' books chapters 1 && 2 were wonderful for explaining
references. There are about 3 chapters on Tk but you can skip those....  :-)

When you call the functions of CardLayout with calls like
$card1 = new Win32::GUI::CardLayout($Window, "main");
you actually are passing 3 variables to the function. The first two are what is
between the ( )'s the other is the object. Here it is $card1 and it becomes the
object.

when a widget is added to the cardlayout with
$card1->add("OpenButton", "main");
again you are passing 3 variables to the function and add() creates a reference
to an annonymous array and puts this array value into the key 'content' of the
associtave array for that object. this array builds as you put more widgets onto
the same card.

when you want to show a card the @{...} is what dereferences the array and loops
through all of its widgets for that window. all of the widgets that belong to
the card you want to view are put through ->show() and the ones that aren't are
run through ->hide().

the window you create the object with
$card1 = new Win32::GUI::CardLayout($Window, "main");
becomes the first card in the series and the last card you declare will become
the last card.

Hope this helps.
Mike

Oh yea,
"There doesn't seem to be much there for a package that does so much good."
THANKS!!!

Ian Taite wrote:

> I saw your previous postings on this subject. I too, recently posted several
> messages without reply. A subsequent search of this discussion group
> revealed a 'guitut5' for my question (amidst 66 other postings); even a
> recommendation to search for that would have been welcome at the time, as a
> time saver. I don't know whether our readers think my questions are too
> simple or my examples are too complex, but this is one module where 'RTFM
> advice' wont get me all that far. Jenda's GUI samples are a step forward,
> but as you might know from the TabStrip example, all it shows is the tab
> strip.
>
> I've got absolutely loads of questions, but now I am wary of posting them
> for fear of being marked a total duffer; everyone learns from square one
> though.
>
> In the past few weeks, I've learned about GUI's, sending SMTP mail,
> accessing the registry, ASDI, and I've experimented with LDAP - I am
> gradually improving my programming expertise however, this module is
> somewhat frustrating.
>
> Do you know of a repository of scripts that exploit Win32-GUI specifically,
> I was thinking that a variety of examples would at least offer some clue as
> to what is possible, as an adjunct to the standard docs.
>
> I've looked through CardLayout.pm to see what it does. There doesn't seem to
> be much there for a package that does so much good. Guess I'll just have to
> learn references and linked lists; I assume that is the mechanism that
> allows this module to work.
>
> Ian.
> [EMAIL PROTECTED]


Reply via email to