in reply to Gtk2 question(s)

You are opening the file for reading (<), and you are not printing into the Filehandle.

Try

my @settings = @_; open my $default, '>', 'default.cfg' or die $!; for (@settings){ print $default $_, "\n"; } close $default;

BTW I don't have a system tray under linux...

Replies are listed 'Best First'.
Re^2: Gtk2 question(s)
by zentara (Cardinal) on Jul 17, 2007 at 10:13 UTC
    BTW I don't have a system tray under linux...

    I do. The Gtk2::TrayIcon will put an entry into the ICEWM control bar ( or whatever you call it where the minimized icons appear, with the clock and virtual desktop selector). I'm fairly sure it does the same with the KDE and Gnome desktops( or fvwm Blackbox, etc. )


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      Aye, I just wanted to hint that not every window manager under linux supports something like a system tray, so it's a feature you shouldn't rely on if you want your app to stay portable.
Re^2: Gtk2 question(s)
by deadpickle (Pilgrim) on Jul 19, 2007 at 17:06 UTC
    Thanks for the help! I am trying to use Gtk2::FileChooser to select a configuration file to load. I noticed that that module is not documented very well and does not have a "$widget = Gtk2::FileChooser->new;" line so I was wondering if anyone had an example on how to use this widget? Also is there a way I can save the settings after closing the program without writing them to a file? Possibly to memory? Also, I am trying to add in threads to the program. What is the best way to do this? I cant seem to get the program to close correctly when I click on "Quit" in the menu, what do I need to do to get a clean exit? ( the tread is at the bottom and the quit is in the menu section)
      Gtk2::FileChooser is just an interface (that is, a GInterface). See the manpage for Gtk2::FileChooserDialog, which is a concrete class that you can construct.