The user needs to change the config setting. After the config settings are changed the global variable needs to change as well. I was wondering if there is a way for these global settings to get updated when the user clicks the tabs in the notebook or when they click somewhere else. Here is a tester code for this.
#!/usr/bin/perl -w use strict; use Gtk2 '-init'; use Glib qw/TRUE FALSE/; my $username = 'Whats the Server?'; my $server = 'Whats the Username?'; my $entry_sftp_username; my $entry_sftp_server; #create main window my $window = Gtk2::Window->new('toplevel'); $window->signal_connect(delete_event=> sub {Gtk2->main_quit}); $window->set_title("Config Load Notebook Test"); $window->set_default_size(400, 300); #create notebook my $notebook = Gtk2::Notebook->new; $notebook->set_tab_pos('top'); #build the correct interfaces &user_interface; #add widgets $window->add($notebook); $window->show_all; Gtk2->main; #-------------------Config Grabber------------------- #Grab the current config settings sub current { $username = $entry_sftp_username->get_text; $server = $entry_sftp_server->get_text; } #-------------------User Interface------------------- sub user_interface { #build the new notebook my $config_notebook = Gtk2::Notebook->new; $config_notebook->set_tab_pos('right'); #create tables my $table = Gtk2::Table->new(5, 2, FALSE); #Current settings display my $dis_table = Gtk2::Table->new(2, 1, FALSE); my $label1 = Gtk2::Label->new($server); my $label2 = Gtk2::Label->new($username); $dis_table->attach_defaults($label1, 0, 1, 0, 1); $dis_table->attach_defaults($label2, 0, 1, 1, 2); #Connection Group (all users) my $config_table = Gtk2::Table->new(2, 2, FALSE); my $label_sftp_username = Gtk2::Label->new( 'Username'); my $label_sftp_server = Gtk2::Label->new( 'Server'); $entry_sftp_username = Gtk2::Entry->new(); $entry_sftp_username->set_text($username); $entry_sftp_server = Gtk2::Entry->new(); $entry_sftp_server->set_text( $server); $config_table->attach_defaults($label_sftp_username, 0, 1, 0, 1); $config_table->attach_defaults($label_sftp_server, 0, 1, 1, 2); $config_table->attach_defaults($entry_sftp_username, 1, 2, 0, 1); $config_table->attach_defaults($entry_sftp_server, 1, 2, 1, 2); $config_notebook->append_page($config_table, "Connection"); $table->attach_defaults($config_notebook, 0, 2, 0, 1); $notebook->append_page($dis_table, "GPS"); $notebook->append_page($table, "Configure"); }

In reply to Grab Config Setting When clicking on Notebook Tab by deadpickle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.