I cant seem to figure this out and am wondering if anyone has any ideas. The user should do this:
1) right click the system tray icon and select VCI.
2) Left click the system tray icon. The interface should become visible.
3) Click the "Connect" button. It shouldthen turn to "Stop".
4) Left click the system tray icon and the window will 'hide'.
I cant get the program to hide the VCI window and become visible after a left click and be in the same state as it was before. The "Connect" button does not stay as "Stop". Any ideas? The clicked and interface subroutines must be the involved ones.
| [reply] [d/l] |
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;
}
| [reply] [d/l] |