Re: [[glade--]Beginner question]
- From: Murray Cumming <murrayc usa net>
- To: "Dennis Joseph D" <DennisJD BATTELLE ORG>, "glademm-list gnome org" <glademm-list gnome org>
- Subject: Re: [[glade--]Beginner question]
- Date: 7 Feb 2002 03:46:22 GMT
"Dennis, Joseph D" <DennisJD BATTELLE ORG> wrote:
> I am writing a small application in C++ and want to put a gui front end on
> it. I found this tutorial (http://writelinux.com/glade/index.php ) for
> Glade and C and have been trying to apply it to glademm and c++. I am
stuck
> trying to figure out how to write this function in c++:
>
> void on_button1_clicked(GtkButton *button, gpointer user_data){
>
> GtkWidget * label = lookup_widget(GTK_WIDGET(button), "label1");
> GtkWidget * entry = lookup_widget(GTK_WIDGET(button), "entry1");
>
> gchar output[50]="Hello ";
> strcat(output,gtk_entry_get_text(GTK_ENTRY(entry)));
> gtk_label_set_text(GTK_LABEL(label),output);
> }
>
> Apparently the lookup_widget() method only applies to C. How can I pull
the
> text out of the entry box and push it into the label in this function?
>
> Thanks for your help.
I think you need libglademm, which might provide a widget lookup method. But
anway, whenever you've got a C GtkWhatever* you can get a Gtk::Whatever* by
using Gtk::wrap() - see the gtkmm FAQ.
Murray Cumming
murrayc usa net
www.murrayc.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]