I don't know how many times you've posted this code, or a variant, here or on the gtk2/perl maillist. First, if you want people to look at it, simplify it down to it's basics. When I tried your code, first I had to get 3 png images to test with, then I get an error about "no SFTP::Foreign, and finally it dosn't work as you claim. Your step(2) dosn't do anything on my machine, no interface appears. Finally your balloon pop ups just get in the way and are annoying.

So please, reduce this to a minimal script, which uses pre-defined icons instead of the pngs, get rid of the annoying balloons, and the sftp stuff. Show us a script that simply concentrates on the problem you describe, i.e. popping up a window when clicking on a trayicon.

I will be willing to bet, that in the process of simplifying this down to it's basics, you will find the glitch. But as it stands now, your script presents too many extraneous hurdles for us to casually spot your error.

But just as a quick push in the right direction, you need to bind the interface sub to a left click.

#events and timeouts $eventbox->signal_connect('button_release_event', \&click); # add a left click binding $eventbox->signal_connect('button_press_event', \&click); #handles tray clicks sub click { #left mouse button if ($_[1]->button == 1) { #Window show/hide controls if ( $current_controls != 0) { #&interface; if ( $visible == 0) { $visible = 1 } if ( $visible == 1) { $visible = 0 } } ################################ # call the interface window if a left click is done &interface; ############################## } #right mouse button elsif ($_[1]->button == 3) { &menu; } return 1; }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re^3: Gtk2: main window visibility by zentara
in thread Gtk2: main window visibility 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.