Re: [gnomemm] Gnome::FileEntry -- get_full_path causes crash



Thanks for the reply, Julian. However, with the supplied code, I am
still getting errors:

printf("trans_log_file: %s\n",
   pbox->transaction_log_file->gtk_entry().get_text());

results in:

propertybox.cc: In method `void Gtivo_Prefs::Set_Configuration(propertybox *)':
propertybox.cc:500: request for member `get_text' in `pbox->propertybox::transaction_log_file->Gnome::FileEntry::gtk_entry()', which is of non-aggregate type `Gtk::Widget *'

-j

On Mon, 22 Jul 2002, Julian Missig wrote:

: Date: Mon, 22 Jul 2002 02:12:24 -0400
: From: Julian Missig <julian jabber org>
: To: Jeremy Dinsel <jeremy gunix net>
: Cc: gnomemm-list gnome org
: Subject: Re: [gnomemm] Gnome::FileEntry -- get_full_path causes crash
:
:  From the Gnome::FileEntry object you can call
: fentry->gtk_entry().get_text() -- since a Gnome::FileEntry is a
: Gnome::Entry, which has the gtk_entry() accessor.
:
: With gnomemm2, a Gnome::UI::FileEntry has a gtk_entry() accessor
: directly, so the same call would work.
:
: It would of course be better if this problem were fixed on gnomemm's
: side, but for the time being you can do things like check for a length
: greater than 0 and use things like g_file_exists (g_file_test(str,
: G_FILE_TEST_EXISTS) in glib2) to make sure the path is decent before
: getting it.
:
: Julian
:
: Jeremy Dinsel wrote:
: > I can't seem to find out how to use this widget after reading all the
: > docs that I can find. Any assistance would be appreciated.
: >
: > If I'm going the following:
: >
: > // Create
: > this->transaction_log_file = manage(new class Gnome::FileEntry());
: >
: > ...
: >
: > // Read from in a callback
: > pbox->transaction_log_file->get_full_path(true);
: >
: >
: > ... and the value that the user supplied is either NULL or does not match
: > what the method expects (a directory when looking for a file, for
: > example), how can I prevent the routine from crashing? It returns an
: > improperly formed STL String class. Is there a way that I can get the
: > entry from the Gnome::FileEntry without using the get_full_path() method
: > -- similar to Gtk::Entry's or Gtk::SpinButton's get_text()? Gnome::Entry
: > is a mystery, too.
: >
: > If anyone would like to comment on adding history to the selected values
: > of Gnome::FileEntry and Gnome::Entry, I'd appreciate that, too.
: >
: > I've been reading documents here:
: >
: > http://gtkmm.sourceforge.net/gtkmm2/
: > http://david.hedbor.org/pikeman/pigtk/
: >
: > There don't seem to be many example Gnome::FileEntry programs available,
: > either. I've tried downloading code form sourceforge or items linked off
: > of the gnome.org page and reading the code, but haven't had success
: > there either.
: >
: > Thanks,
: > -j
: > --
: > - Jeremy Dinsel
: > - somewhere in the monkey house
:


--
- Jeremy Dinsel
- somewhere in the monkey house




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]