Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Passing multiple user data GLADE

by sam_bakki (Pilgrim)
on Mar 16, 2014 at 14:10 UTC ( #1078512=note: print w/ replies, xml ) Need Help??


in reply to Passing multiple user data GLADE

Hi

I do not exactly get your requirement. I use a GTK2 + GLADE based GUIs a lot. To get inputs from various text boxes, I get the text box objects from Glade and put them as a global / member variable. So I can access all the text box's when some button is clicked.

Have a look at the 'BUILD' function and 'get_object' in http://code.google.com/p/saaral-soft-search-spider/source/browse/trunk/src/Libs/GtkSpiderGui.pm



Thanks & Regards,
Bakkiaraj M
My Perl Gtk2 technology demo project - http://code.google.com/p/saaral-soft-search-spider/ , contributions are welcome.


Comment on Re: Passing multiple user data GLADE
Download Code
Re^2: Passing multiple user data GLADE
by hakim-djz (Novice) on Mar 16, 2014 at 14:35 UTC

    Hi,

    Well I have 4 text entry boxes:

    ip: 192.168.0.2

    SSID:My Router

    PSK: Passphrase

    Device: Gadget1

    Where the values in the '[]' I need when the okay is clicked, and passed to my callback routine. And these are stored in a 4 element vbox.

    Now in Glade's properties window in the signals tab you can put the routine in the 'handler' box, and the data you want passed to the routine in the 'user data' box, but only allows you to add one object. So I'm stuck in passing it to the callback routine.

    I am using Glade 3.14.2 and Gtk3. As well Glade and Perl are both quite new to me. Thanks for your help

      Hi

      Ok. Then expose the text entry boxes as a global variables like below,

      my $GuiBuilder = Gtk2::Builder->new (); $GuiBuilder->add_from_file('test.glade'); my $text_ip_entry = $GuiBuilder->get_object('text_ip_entry'); my $text_ssid_entry = $GuiBuilder->get_object('text_ssid_entry'); ..... sub on_some_click { my $widget=shift @_; my $userData = shift @_; my $text_ip = $text_ip_entry->get_text(); }

      Thanks & Regards,
      Bakkiaraj M
      My Perl Gtk2 technology demo project - http://code.google.com/p/saaral-soft-search-spider/ , contributions are welcome.

        Thanks, I got it sorted and updated the post.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-10-01 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (9 votes), past polls