xmlSetProp checkbox/"Run in terminal" menueditor support
Joshua Cummings
jrac at tsn.cc
Mon Mar 1 13:08:21 CET 2004
On Mon, 2004-03-01 at 04:46, Jean-François Wauthy wrote:
> xmlSetProp takes a const xmlChar * as third argument and you send a
> gboolean so casting is needed.
> or you can do :
>
> <code>
> gboolean in_terminal;
>
> in_terminal = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox));
> if(in_terminal)
> xmlSetProp(node, "term", "true");
> </code>
"term" doesn't even show up using this method.
I tried:
if(in_terminal == TRUE){
xmlSetProp(node, "term", "yes");
}
else{
xmlSetProp(node, "term", "no");
}
but that results in term="no" all the time.
The following suggested by Danny does the same thing.
gboolean in_terminal;
in_terminal = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox));
xmlSetProp(node, "term", in_terminal ? "yes" : "no");
gtk_toggle_button_get_active is supposed to return TRUE if the checkbox
is raised and FALSE otherwise. I just need this TRUE/FALSE status turned
into a yes or no for term="".
This part has become one big brick wall for me. I'm now just taking
stabs in the dark based upon docs and other code. Sorry if I'm coming
off as completely clueless, but this is really my first venture in to
the whole libxml/checkbox mixture etc. and xfce code in general.
As soon as I can get this sorted out I can do a cleanup and submit a
patch.
--
Joshua Cummings
More information about the Xfce4-dev
mailing list