Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Question about GUIkit and creating Tabs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83666] Question about GUIkit and creating Tabs
  • From: psycho_dad <s.nesseris at gmail.com>
  • Date: Wed, 28 Nov 2007 05:23:38 -0500 (EST)

Dear friends hi,
I have a question about GUIkit. I want to create an interface that
allows the user to create a new tab at runtime (something like what
happens in Firefox), ie the user will press a button and a new tab
with some content will be created. The problem is I now how to create
tabs a priori but not how to do it at runtime.

For example, the following piece of code creates three tabs numbered
1, ,2,3 , a button and textfield that shows how many times the button
has been pressed. The problem is I don't know how to extend this to
what I mentioned above (press the button and add a new tab).

Any help/advice is much appreciated,
psycho_dad

GUIRun[Widget[
    "Panel", {WidgetGroup[{Widget["
      TextField", {"text" -> "0",
           "columns" -> 6, "horizontalAlignment" ->
              PropertyValue["Right"], BindEvent["action", Script[value
=
                   ToExpression[PropertyValue[{"textField",
"text"}]] ]
                  ]}, Name -> "textField"],
            Widget["Button", {"label" -> "
                  update", BindEvent["action",
                      Script[buttonClicked[]]]}],
                        Widget["CheckBox", {}, Name -> "checkBox"]}, \
WidgetLayout -> Row],

        WidgetGroup[Table[Widget["Button", {"text
              " -> ToString[i]}, Name -> "Button " <> ToString[i]],
{i, 1,
            3}], Name -> "myTabPane",
          WidgetLayout -> {"Grouping" -> {Tabs, Top, Table["
                Tab " <> ToString[i], {i, 1, 3}]}}],

        Script[value = 0; buttonClicked[] := (
            If[PropertyValue[{"checkBox", "selected"}], value--, value+
+];
              SetPropertyValue[{"textField", "text"},
            ToString[value, InputForm]])]}]];


  • Prev by Date: Re: Discrepancy between Integrate and NIntegrate
  • Next by Date: Can't start Mathematica 5
  • Previous by thread: Re: Epilog with 3 dimensional graphics primitives
  • Next by thread: Re: Question about GUIkit and creating Tabs