[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
bad coding?
- From: Richard Tew <RMT38 student canterbury ac nz>
- To: gtk-app-devel-list redhat com
- Subject: bad coding?
- Date: Thu, 03 Jun 1999 13:08:24 +1200 (NEW ZEALAND STANDARD TIME)
I am working on a program that brings up a window with two entry widgets
and when a button is pressed and its callback called, the contents of the
two widgets needs to be fetched and the window closed.
I have two questions I would appreciate answers for :)
1) The callback is called with the widget the signal was connected to
(the button), to close the window I do:
gtk_widget_destroy (GTK_WIDGET (button -> parent -> parent));
(knowing that the button is in a table thats in a window)
Is there a better way to close the window?
2) Before the window is destroyed/closed, I search through the list of
widgets contained in the table and as I encounter a entry widget I nick
its value.
Is there a better way to get the values contained in entry widgets
somewhere in the same table?
I know I could just allocate a structure and pass everything I might need
in callbacks, but I kind of like the way I can:
gtk_signal_connect_object (button, "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
window);
for when the cancel button in the table is pressed.
Anyway, any suggestions? :)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]