[Glade-users] help

S.W.Liu cep02lsw@taurus.zsu.edu.cn
Fri, 10 Oct 2003 19:39:53 +0800


very thanks!

----- Original Message -----
From: "Mike Kordik" <Mike@Kordik.net>
To: "S.W.Liu" <cep02lsw@taurus.zsu.edu.cn>
Cc: <glade-users@lists.ximian.com>
Sent: Friday, October 10, 2003 6:35 AM
Subject: Re: [Glade-users] help


> There maybe something with the gpointer parameter and an option in glade
> with the signal handler but I don't know but...
>
> This is one way to do it.
>
> void
> on_ok_button1_clicked                  (GtkButton       *button,
>                                         gpointer         user_data)
> {
> GtkWidget *fs;
>
> fs = lookup_widget((GtkWidget *)button,"fileselection1");
> printf("%s\n",gtk_file_selection_get_filename((GtkFileSelection *)fs));
> }
>
> The printf is there so I could see that I was returning the file I was
> selecting.
>
> Hope this helps!
>
> Mike
>
> On Wed, 2003-10-08 at 10:06, S.W.Liu wrote:
> > > Well just playing around I took your glade file and added a
> > > on_ok_button1_clicked() signal. Since I made your fileselection1
dialog
> > > protected, in the on_ok_button1_clicked() I can access the
fileslection1
> > it seems that your code is written C++?
> > > object and call it's "std::string get_filename () const" method to
have
> > the callback func generated by glade-2 is like this(in C style):
> >
> > void
> > on_ok_clicked                      (GtkButton       *button,
> >                       gpointer         user_data)
> > {
> > }
> > how could i access fileselection1?
> >
> > > it return the selected filename. The FileSelection object is
documented
> > > on this page
> > >
> >
http://www.gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1FileSelection.ht
> > ml
> > >
> > > You would have to play around a little to make sure you have
everything
> > > covered as the user may double click a filename and that may select
> > > without slecting OK. I am new to all this as well so I am not sure all
> > > the cavaets.
> > >
> > > I hope this helps.
> > very thanks!
> > >
> > >
> >
> > _______________________________________________
> > Glade-users maillist  -  Glade-users@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/glade-users
>
> _______________________________________________
> Glade-users maillist  -  Glade-users@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users