Re: Hex Numbers in GtkEntry.

2004-02-25 Thread Muthiah Annamalai
Hello Friends,

Quoting Tom Froysland [EMAIL PROTECTED]
Subject: Hex numbers

How is it possible to make a (text) box to get or show a hexadesimal number?
-- 

The way I do it is to use sscanf  sprintf and get/set the hexadecimal numbers
that we get respectively.

//getting an hexdecimal from the gtk_entry.
const gchar *data;
int hex_value;

data=gtk_entry_get_text(GTK_ENTRY(text_box)); 
sscanf(data,%X,hex_value); //Ive not done the error checking part.


//setting an hexdecimal to the gtk_entry.
gchar data=(gchar *)g_malloc(sizeof(gchar)*MAX_SIZE);
int hex_value;

sprintf(data,%X,hex_value); //Assume hex_value has been set somehow.
gtk_entry_set_text(GTK_ENTRY(text_box),data); 



$0.02
Cheers
Muthu.








-
This mail sent through IMP(http://www.nitt.edu)
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Hex Numbers in GtkEntry.

2004-02-25 Thread Billy O'Connor
Muthiah Annamalai [EMAIL PROTECTED] writes:

 sprintf(data,%X,hex_value); //Assume hex_value has been set somehow.
^ Oops.
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list