Re: Re: gnomemm-list digest, Vol 1 #266 - 3 msgs
Christof Petig <[email protected]> Mon, 08 Mar 2004 09:20:23 +0100
| Newsgroups | gmane.comp.gnome.gnomemm,gmane.comp.gnome.glademm |
|---|---|
| Organization | Adolf Petig GmbH & Co. KG |
| Message-ID | <[email protected]> |
Daniel Pixley schrieb:
> I too am new to Gtkmm and am working on doing this same thing. Here is
> where I am at: I am using Glademm to generate the basic GUI outline. I
> used a 'Dialog Box' (in the Glade tools) to create my popup dialog
> window. The window is Modal, since the user needs to take care of the
> popup dialog before anything else happens.
>
> An interesting problem I had with Glade is that it is supposed to allow
> you to create the outline of a signal. A _glade file is created that
> creates virtual functions to represent your signals. The actual class
> you use for the signals is inherited from the _glade file. The entire
> philosophy behind Glade is that the programmer doesn't touch the _glade
> files, but only the files inherited from the _glade files. But with the
> 'Dialog' windows created in Glade (basically this allows you to
> customize your input window with text entries and such), the signals do
> not get created in the _glade files. I had to break the Glade
> philosophy by manually inserting the callbacks. This fixed the problem,
> but still breaks the Glade philosophy.
??? not very clear ??? I assume you have problems with glademm, the C++
code generating backend of glade.
I also assume that you report the fact that glademm does not write
virtual callbacks into the foo_glade.h file? Did you hit the create code
button again? I never heard of glademm not generating callbacks in the
_glade class (it does not create them for you in the user class by design).
> quick_dialog *quick_dialog = new class quick_dialog();
> quick_dialog->run();
> int result = quick_dialog->run();
> //do somemthing (get contents of input)
why don't you set the visibilty of the text box to public and use
quick_dialog->text1->get_buffer()->get_text()
?
> My problem at this point is writing a function for saving what is in the
> text entry box when the user clicks the OK button (this is separate than
> what happens in the above switch statement The above switch statement
> will have a getInput() function that will return the contents of input
> to the main program. So, the above switch statement is inside the main
> program, which creates a quick_dialog object. The quick_dialog object
> has a signal for the cancel and ok buttons when pressed. This is
> described below. After the Ok button is clicked, and input is stored,
> the above switch statement needs to get the contents of input.) I have
> this so far for:
>
> void quick_dialog::on_quick_okbutton1_clicked()
> {
> input = *quick_input->get_text();
> }
>
> Where 'input' is a const gchar*. I get an error saying that the
> compiler cannot convert a ustring to a gchar, however. I'm not sure why
> I am getting this error since get_text() is supposed to return a pointer
> to a gchar, not a ustring. How do I use get_text() to store what is in
> an entry into a local variable?
TextBuffer::get_text returns a ustring.
>
> This post is probably a bit confusing, and I apologize for this. I may
> also be taking a more difficult route to this problem. If anyone can
> post some insight, particularly to my problem of returning the result of
> get_text() to a local variable, please reply.
It is. If some issues still exist, retry
Yours
Christof
[glademm maintainer]
PS: I CC the glademm list. Please remove gnomemm-list on reply.