glade whit multiple windows

Discussion in 'Perl Misc' started by Spocchio, Mar 31, 2008.

  1. Spocchio

    Spocchio Guest

    hi,
    I'm making a glade-based tool: there is a window "father" that have to
    open more child windows, here my code:

    sub btnNewMessage_onclick
    {
    my $newWin = Gtk2::GladeXML->new('gui/wSMS.glade');
    my $newForm = $newWin->get_widget('wSMS');
    $newWin->signal_autoconnect_from_package('callbackSMS');
    $newForm->show;
    }

    package callbackSMS;
    my $ID;
    sub init #it's on form.show()
    {
    $ID=rand(0,1000);
    }

    sub btnOk_clicked
    {
    print $ID;
    }


    ok, if I open more than 1 windows, when i click btnOk i get the some
    result from all windows.
    so when i run the init(), I overwrite the data of the previous window.
    What could be the correct method to open more of the some window? i
    don't think the package is the best solution.

    thanx!
     
    Spocchio, Mar 31, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Dykes
    Replies:
    2
    Views:
    445
    dimitri pater
    Oct 16, 2004
  2. Fernando
    Replies:
    1
    Views:
    396
  3. Richard Lyons

    Glade for Windows and Python

    Richard Lyons, Apr 15, 2005, in forum: Python
    Replies:
    2
    Views:
    3,041
    flupke
    Apr 18, 2005
  4. glade and windows

    , Nov 9, 2006, in forum: C Programming
    Replies:
    4
    Views:
    526
  5. Replies:
    0
    Views:
    118
Loading...

Share This Page