Re: [gtkmm] Passing widgets



On Thu, 2004-07-08 at 16:02 +0550, Linuxteam wrote:
> Hi,
> 
> I want to know how do I pass a GtkEntry widget on click of a button. I have a
> callback function on click of a button. In that function, I want to access the
> text of a GtkEntry widget.
> My code is:
> 
> ------------------------------------------------------------
> void window1::on_okbutton_clicked(GtkEntry *entry1)
> {
>     g_print(entry1.get_text());
> }
> ------------------------------------------------------------

I would suggest do use "->" instead of "." cause entry1 is a pointer.
The following pice of code might work better:
<not tested>
    void window1::on_okbutton_clicked(GtkEntry *entry1)
    {
      g_print(entry1->get_text());
    }
</not tested>

regards, Clemens

-- 
Clemens Auer <c_auer a1 net>




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