I cant seem to be able to edit the entries. I noticed that it could be the type of window it is. It works for 'toplevel' but not for 'popup'. Is there a way I can get this to work in the popup window? In either case all you have to do is click anywhere and the window closes.
#!/usr/bin/perl -w use strict; use warnings; use Glib qw/TRUE FALSE/; use Gtk2 '-init'; use Gtk2::TrayIcon; use Net::SFTP::Foreign; use threads; use threads::shared; #my $interface = Gtk2::Window->new('toplevel'); my $interface = Gtk2::Window->new('popup'); $interface->set_position('mouse'); $interface->set_border_width( 5); #Eventbox for capturing the mouse click my $eventbox_interface = Gtk2::EventBox->new; #table to contain the widgets my $table_interface = Gtk2::Table->new( 9, 2, FALSE); #Label my $label_nav_waypoint = Gtk2::Label->new( ); my $label_nav_lat = Gtk2::Label->new( 'Lat'); my $label_nav_long = Gtk2::Label->new( 'Long'); #Entries my $entry_nav_lat = Gtk2::Entry->new; my $entry_nav_long = Gtk2::Entry->new; $entry_nav_lat->set_width_chars( 5); $entry_nav_long->set_width_chars( 5); #Markup for the text labels $label_nav_waypoint->set_markup( '<b>Waypoint Generation</b>'); #pack the widgets into the table $table_interface->attach_defaults( $label_nav_waypoint, 0, 2, 0, 1); $table_interface->attach_defaults( $label_nav_lat, 0, 1, 1, 2); $table_interface->attach_defaults( $entry_nav_lat, 1, 2, 1, 2); $table_interface->attach_defaults( $label_nav_long, 0, 1, 2, 3); $table_interface->attach_defaults( $entry_nav_long, 1, 2, 2, 3); #add the widgets to the window: widgets->table->eventbox->window $eventbox_interface->add( $table_interface); $interface->add( $eventbox_interface); $interface->show_all; $interface->signal_connect( 'button-release-event' => sub { Gtk2->main +_quit}); Gtk2->main;

In reply to Gtk2: 'popup' and entry 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.