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

Re: Working gtk_widget_destroy around



Rafael Peregrino da Silva wrote:
> 
> Hi ALL!
> 
> I have a dialog box with some entries and once the dialog box is destroyed
> all the pointers to the entries are again unitialized (and so on the
> global variables in whose I saved the entries values are lost). How could
> I workaround this, i.e., how can I keep the values that were saved on the
> global variables? Can you understand what I mean?
> 
> Thanks a lot for the help,
> 
> Rafael (8-)
> 
> rafael@bmt4.kf.TU-Berlin.DE
> Take a look at our site!
> http://privat.schlund.de/bsos/
> ______________________________
> 
> "Unshakable faith is only that
>  which can meet reason face to
>  face in every Human epoch"
> 
>               Allan Kardec
>               (1804-1869)
> ______________________________
> 
> --
>          To unsubscribe: mail gtk-app-devel-list-request@redhat.com with
>                        "unsubscribe" as the Subject.
> 
>         Mailing list concerns should be mailed to <listmaster@redhat.com>

Well, 
if you want to use global variables, you can destroy the dialog but
not the gtk_entrys with the gtk_widget_ref() function.

Before you call your dialog, call gtk_widget_ref() on each of your
gtk_entry. Then when you quit from the dialog, get the text from the
gtk_entrys and the DO a gtk_widget_unref() on each gtk_entry.

I don't think this is a good gtk programing practice(I agree with Carlos
on global variables), but I thing it answer just your question.

Regards
Oliver
-- 
Oliver Schulze L.
oliver@pla.net.py
Asuncion-Paraguay
http://www.pla.net.py/home/oliver/



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