Core Function GUICreateTabPage
From Sputnik Wiki
GUICreate( "TabPage", <gui object>, <Text> )
Contents |
Description
Create a TabPage
Parameters
gui object
The GUI object (TabSheet) to place the TagPage on.
text
The text the Tabpage should display.
Return Value
Success: Returns the new GUI object.
Failure: Returns 0 if error occurs.
Example
// Create the GUI Global $GUI = GUICreate("Window", "Hello", 300, 300); // Show the GUI GUILoad( $GUI ); // Make a button Global $TestyButton = GUICreate("Button", $GUI, "Test...", 8, 8); // Make Tab sheet Global $Tab = GUICreate( "TabSheet", $GUI, 8, 48, 200, 200 ); // Add 2 pages to sheet Global $TabPage1 = GUICreate("TabPage", $Tab, "I am Page1"); Global $TabPage2 = GUICreate("TabPage", $Tab, "I am Page2"); // Add buttons to page 1 Global $MyButton1 = GUICreate("Button", $TabPage1, "Click me!", 16, 16); Global $MyButton2 = GUICreate("Button", $TabPage1, "Click me too!", 16, 56); // Add buttons to page 2 Global $MyButton3 = GUICreate("Button", $TabPage2, "Click me OMG!", 16, 56); Global $MyButton4 = GUICreate("Button", $TabPage2, "Click me NOW!", 16, 86); // Add links GUILink($MyButton1, "Click", 'Println("Hello from MyButton1");'); GUILink($MyButton2, "Click", 'Println("Hello from MyButton2");'); GUILink($MyButton3, "Click", 'Println("Hello from MyButton3");'); GUILink($MyButton4, "Click", 'Println("Hello from MyButton4");'); GUILink($TestyButton, "Click", 'Testy();'); // Keep the GUI running as long as long as the window is open While ( GUIStatus( $GUI ) ) DoEvents( ); Function Testy() { //GUITabSheet($Tab, "DelPage", 0); // Uncomment to delete Page1 //Unset($TabPage2); // Uncomment to delete Page2 my $Index = GUITabSheet($Tab, "SelectedIndex"); println("Page index selected: $Index"); my $Text = GUITabSheet($Tab, "SelectedText"); println("Page text selected: $Text"); //GUITabSheet($Tab, "SelectedIndex", 1); // Uncomment to change tab page to Page2 //GUITabSheet($Tab, "Clear"); // Uncomment to delete all pages }