Re: GtkFileChooser for an Entry




 There are 2 ways to do what you want:

  1) pass the entry as the data on the callback function.

  2) if the entry cannot be set as the data member (because the entry is not on
the same scope), you can associate an object (in this case the entry widget )
with another widget (the dialog entry); then on the callback, you can access
the entry from the dialog.

 For this, use the function g_object_set_data(..) anb get a pointer to it using
g_object_get_data()

http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#g-object-get-data

 Hope this helps.

Harring.


 --- William Dest <ddinbox1-william yahoo com> wrote:
I have a general-purpose function that creates a
dialog with entries and labels that come from an array
of  structs that's passed to the function.  One of the
values in the struct is a flag that says whether the
entry expects a filename from the user, and if so the
function creates a button and g_signal_connects a
callback  function that creates a FileChooserDialog to
the button.  
My newby-ish issue is that I'm having trouble getting
the filename selected by the user in the
FileChooserDialog function to get populated into the
entry, since the callback function isn't associated
directly with the Entry.  I've considered creating a
signal and tying it to the "clicked" event on the
FileChooser, but that seems overly complicated for the
simple(??) thing I'm trying to do.

I'm considering trying to embed the
GtkFileChooserWidget into the GtkEntry, but I don't
see much instruction on how to do that.  Is a browse
button for a text entry really this hard?

Any ideas would be very welcome.

Thanks,
William
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




                
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail



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