[Glade-users] (no subject)
- From: scharles ee ucl ac uk (Simon Charles)
- Subject: [Glade-users] (no subject)
- Date: Wed, 19 Nov 2003 18:40:55 +0000
--=====================_3520512==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Any idea why this doesn't work (the lookup_widget lines give a warning '
assignment from incompatible pointer type' when it is compiled using -Wall
-ansi. I thought a pointer to ANY object in a window could be passed to
lookup_widget()?
void
on_button4_s4a_prev_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG_GUI_EVENTS
fprintf(stdout,"GUI button event \"button4_s4a_prev_clicked \"
received. %s %d\n", __FILE__, __LINE__);
#endif
GtkNotebook *notebook;
notebook=lookup_widget(GTK_WIDGET(main_window), "notebook");
gtk_notebook_set_current_page(notebook, 4);
}
Same thing happens with this one:
void
on_entry_bedplane_type_plane_1_changed (GtkEditable *editable,
gpointer user_data)
{
#ifdef DEBUG_GUI_EVENTS_TXT_ENTRY
fprintf(stdout,"GUI text entry event
\"entry_bedplane_type_plane_1_changed\" received. %s %d\n", __FILE__,
__LINE__);
#endif
GtkSpinButton *spinbutton_bedplane_height_plane_1;
GtkSpinButton *spinbutton_bedplane_betax_plane_1;
GtkSpinButton *spinbutton_bedplane_betay_plane_1;
GtkSpinButton *spinbutton_bedplane_gating_plane_1;
GtkWidget *entry_bedplane_type_plane_1;
entry_bedplane_type_plane_1=lookup_widget(GTK_WIDGET(editable),
"entry_bedplane_type_plane_1");
gchar
*sTmp=gtk_entry_get_text(GTK_ENTRY(entry_bedplane_type_plane_1));
spinbutton_bedplane_height_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_height_plane_1");
spinbutton_bedplane_betax_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_betax_plane_1");
spinbutton_bedplane_betay_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_betay_plane_1");
spinbutton_bedplane_gating_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_gating_plane_1");
if((strcmp(sTmp, BED_PLANE_MODE_ALLOWED_1))==0)
{
gtk_spin_button_set_value(spinbutton_bedplane_height_plane_1,
BED_PLANE_DEFAULT_HEIGHT_1);
gtk_spin_button_set_value(spinbutton_bedplane_betax_plane_1,
BED_PLANE_DEFAULT_BETAX_1);
gtk_spin_button_set_value(spinbutton_bedplane_betay_plane_1,
BED_PLANE_DEFAULT_BETAY_1);
gtk_spin_button_set_value(spinbutton_bedplane_gating_plane_1,
BED_PLANE_DEFAULT_GATEPC_1);
gpdBetaX[1]=BED_PLANE_DEFAULT_BETAX_1;
gpdBetaY[1]=BED_PLANE_DEFAULT_BETAY_1;
gpdFracHeight[1]=BED_PLANE_DEFAULT_HEIGHT_1;
gpdGatePc[1]=BED_PLANE_DEFAULT_GATEPC_1;
}
else if((strcmp(sTmp, BED_PLANE_MODE_ALLOWED_2))==0)
{
gtk_spin_button_set_value(spinbutton_bedplane_height_plane_1,
BED_PLANE_DEFAULT_HEIGHT_1);
gtk_spin_button_set_value(spinbutton_bedplane_betax_plane_1,
BED_PLANE_DEFAULT_BETAX_1);
gtk_spin_button_set_value(spinbutton_bedplane_betay_plane_1,
BED_PLANE_DEFAULT_BETAY_1);
gtk_spin_button_set_value(spinbutton_bedplane_gating_plane_1,
BED_PLANE_DEFAULT_GATEPC_1);
etc .....
}
This one, and all other where the widget being looked for is of type
GtkWidget, works fine.
void
on_radiobutton_params_usefile_nomod_toggled
(GtkToggleButton *togglebutton,
gpointer user_data)
{
#ifdef DEBUG_GUI_EVENTS
fprintf(stdout,"GUI button event
\"radiobutton_params_usefile_nomod_toggled\" received. %s %d\n", __FILE__,
__LINE__);
#endif
GtkWidget *entry_params_file_in;
GtkWidget *button_paramsfile_in_browse;
GtkWidget *entry_scene_wireframe_file;
GtkWidget *button_scene_wireframe_browse;
giMode=0;
entry_params_file_in=lookup_widget(GTK_WIDGET(togglebutton),
"entry_params_file_in");
gtk_widget_set_sensitive(entry_params_file_in, TRUE);
button_paramsfile_in_browse=lookup_widget(GTK_WIDGET(togglebutton),
"button_paramsfile_in_browse");
gtk_widget_set_sensitive(button_paramsfile_in_browse, TRUE);
entry_scene_wireframe_file=lookup_widget(GTK_WIDGET(togglebutton),
"entry_scene_wireframe_file");
gtk_widget_set_sensitive(entry_scene_wireframe_file, FALSE);
button_scene_wireframe_browse=lookup_widget(GTK_WIDGET(togglebutton),
"button_scene_wireframe_browse");
gtk_widget_set_sensitive(button_scene_wireframe_browse, FALSE);
}
Sorry about the long message.....
Also, on a slightly stranger note, for loops don't seem to execute anywhere
in my project code....!?
Thanks,
Simon
----------------------------------
Simon Charles BEng MRes MIEE
This e-mail and any files transmitted with it are confidential (and may
contain privileged information) to the ordinary user of the e-mail address
to which it was addressed. The e-mail must not be copied, disclosed or
distributed without the prior authorization of the sender.
Please notify the sender and destroy this e-mail immediately if you are not
the intended recipient.
Please also note that while precautions have been taken to try to ensure
that this e-mail has been swept for viruses, no responsibility is accepted
for any damage or loss caused in respect of any viruses transmitted by the
e-mail. Please ensure your own checks are carried out before any
attachments are opened.
--=====================_3520512==.ALT
Content-Type: text/html; charset="us-ascii"
<html>
<body>
<br><br>
<x-sigsep><p></x-sigsep>
Any idea why this doesn't work (the lookup_widget lines give a warning '
assignment from incompatible pointer type' when it is compiled using
-Wall -ansi. I thought a pointer to ANY object in a window could be
passed to lookup_widget()?<br><br>
void<br>
on_button4_s4a_prev_clicked
(GtkButton *button,<br>
gpointer user_data)<br>
{<br>
#ifdef DEBUG_GUI_EVENTS<br>
<x-tab> </x-tab>fprintf(stdout,"GUI
button event \"button4_s4a_prev_clicked \" received. %s
%d\n", __FILE__, __LINE__);<br>
#endif<br><br>
<x-tab> </x-tab>GtkNotebook
*notebook;<br>
<x-tab> </x-tab>notebook=lookup_widget(GTK_WIDGET(main_window),
"notebook");<br>
<x-tab> </x-tab>gtk_notebook_set_current_page(notebook,
4);<br>
}<br><br>
<br>
Same thing happens with this one:<br><br>
void<br>
on_entry_bedplane_type_plane_1_changed
(GtkEditable *editable,<br>
gpointer user_data)<br>
{<br>
#ifdef DEBUG_GUI_EVENTS_TXT_ENTRY<br>
<x-tab> </x-tab>fprintf(stdout,"GUI
text entry event \"entry_bedplane_type_plane_1_changed\"
received. %s %d\n", __FILE__, __LINE__);<br>
#endif<br><br>
<x-tab> </x-tab>GtkSpinButton
*spinbutton_bedplane_height_plane_1;<br>
<x-tab> </x-tab>GtkSpinButton
*spinbutton_bedplane_betax_plane_1;<br>
<x-tab> </x-tab>GtkSpinButton
*spinbutton_bedplane_betay_plane_1;<br>
<x-tab> </x-tab>GtkSpinButton
*spinbutton_bedplane_gating_plane_1;<br>
<x-tab> </x-tab>GtkWidget
*entry_bedplane_type_plane_1;<br><br>
<x-tab> </x-tab>entry_bedplane_type_plane_1=lookup_widget(GTK_WIDGET(editable),
"entry_bedplane_type_plane_1");<br>
<x-tab> </x-tab>gchar
*sTmp=gtk_entry_get_text(GTK_ENTRY(entry_bedplane_type_plane_1));<br>
<x-tab> </x-tab>spinbutton_bedplane_height_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_height_plane_1");<br>
<x-tab> </x-tab>spinbutton_bedplane_betax_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_betax_plane_1");<br>
<x-tab> </x-tab>spinbutton_bedplane_betay_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_betay_plane_1");<br>
<x-tab> </x-tab>spinbutton_bedplane_gating_plane_1=lookup_widget(GTK_WIDGET(entry_bedplane_type_plane_1),
"spinbutton_bedplane_gating_plane_1");<br><br>
<x-tab> </x-tab>if((strcmp(sTmp,
BED_PLANE_MODE_ALLOWED_1))==0)<br>
<x-tab> </x-tab>{<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_height_plane_1,
BED_PLANE_DEFAULT_HEIGHT_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_betax_plane_1,
BED_PLANE_DEFAULT_BETAX_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_betay_plane_1,
BED_PLANE_DEFAULT_BETAY_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_gating_plane_1,
BED_PLANE_DEFAULT_GATEPC_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gpdBetaX[1]=BED_PLANE_DEFAULT_BETAX_1;<br>
<x-tab> </x-tab><x-tab> </x-tab>gpdBetaY[1]=BED_PLANE_DEFAULT_BETAY_1;<br>
<x-tab> </x-tab><x-tab> </x-tab>gpdFracHeight[1]=BED_PLANE_DEFAULT_HEIGHT_1;<br>
<x-tab> </x-tab><x-tab> </x-tab>gpdGatePc[1]=BED_PLANE_DEFAULT_GATEPC_1;<br>
<x-tab> </x-tab>}<br>
<x-tab> </x-tab>else
if((strcmp(sTmp, BED_PLANE_MODE_ALLOWED_2))==0)<br>
<x-tab> </x-tab>{<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_height_plane_1,
BED_PLANE_DEFAULT_HEIGHT_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_betax_plane_1,
BED_PLANE_DEFAULT_BETAX_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_betay_plane_1,
BED_PLANE_DEFAULT_BETAY_1);
<br>
<x-tab> </x-tab><x-tab> </x-tab>gtk_spin_button_set_value(spinbutton_bedplane_gating_plane_1,
BED_PLANE_DEFAULT_GATEPC_1);
<br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>etc
.....<br>
}<br><br>
This one, and all other where the widget being looked for is of type
GtkWidget, works fine.<br><br>
void<br>
on_radiobutton_params_usefile_nomod_toggled<br>
(GtkToggleButton *togglebutton,<br>
gpointer user_data)<br>
{<br>
#ifdef DEBUG_GUI_EVENTS<br>
<x-tab> </x-tab>fprintf(stdout,"GUI
button event \"radiobutton_params_usefile_nomod_toggled\"
received. %s %d\n", __FILE__, __LINE__);<br>
#endif<br><br>
<x-tab> </x-tab>GtkWidget
*entry_params_file_in;<br>
<x-tab> </x-tab>GtkWidget
*button_paramsfile_in_browse;<br>
<x-tab> </x-tab>GtkWidget
*entry_scene_wireframe_file;<br>
<x-tab> </x-tab>GtkWidget
*button_scene_wireframe_browse;<br><br>
<x-tab> </x-tab>giMode=0;<x-tab> </x-tab><br>
<x-tab> </x-tab>entry_params_file_in=lookup_widget(GTK_WIDGET(togglebutton),
"entry_params_file_in");<br>
<x-tab> </x-tab>gtk_widget_set_sensitive(entry_params_file_in,
TRUE);<br>
<x-tab> </x-tab>button_paramsfile_in_browse=lookup_widget(GTK_WIDGET(togglebutton),
"button_paramsfile_in_browse");<br>
<x-tab> </x-tab>gtk_widget_set_sensitive(button_paramsfile_in_browse,
TRUE);<br>
<x-tab> </x-tab>entry_scene_wireframe_file=lookup_widget(GTK_WIDGET(togglebutton),
"entry_scene_wireframe_file");<br>
<x-tab> </x-tab>gtk_widget_set_sensitive(entry_scene_wireframe_file,
FALSE);<br>
<x-tab> </x-tab>button_scene_wireframe_browse=lookup_widget(GTK_WIDGET(togglebutton),
"button_scene_wireframe_browse");<br>
<x-tab> </x-tab>gtk_widget_set_sensitive(button_scene_wireframe_browse,
FALSE);<br>
}<br><br>
Sorry about the long message.....<br><br>
Also, on a slightly stranger note, for loops don't seem to execute
anywhere in my project code....!?<br><br>
Thanks,<br><br>
Simon<br><br>
----------------------------------<br><br>
<font face="Futura Lt BT">Simon Charles BEng MRes MIEE<br>
<x-tab> </x-tab><br>
</font><font face="Futura Lt BT" color="#808080">This e-mail and any
files transmitted with it are confidential (and may contain
privileged information) to the ordinary user of the e-mail address
to which it was addressed. The e-mail must not be copied, disclosed or
distributed without the prior authorization of the sender. <br><br>
Please notify the sender and destroy this e-mail immediately if you are
not the intended recipient.<br><br>
Please also note that while precautions have been taken to try to ensure
that this e-mail has been swept for viruses, no responsibility is
accepted for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are
carried out before any attachments are opened.<br>
</font>
</body>
</html>
--=====================_3520512==.ALT--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]