gtk labels
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > gtk labels




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    gtk labels  
ranger


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-29-07 06:21 AM

'm in the process of making a frontend for one of my programs. I want
to use a label to print updates to the user. When environmental
variables change, I alert the user, but I use g_print and output it to
the command line. I want to know how to print this output to a label
instead.

I've heard that one way of doing it is by using gtk_label_set_text(),
but I'm unsure how to direct the output of g_print to the label.

A short example would be great.

Thanks.






[ Post a follow-up to this message ]



    Re: gtk labels  
James Antill


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-30-07 12:16 AM

On Sat, 28 Apr 2007 21:03:31 -0700, ranger wrote:

> 'm in the process of making a frontend for one of my programs. I want to
> use a label to print updates to the user. When environmental variables
> change, I alert the user, but I use g_print and output it to the command
> line. I want to know how to print this output to a label instead.
>
> I've heard that one way of doing it is by using gtk_label_set_text(),
> but I'm unsure how to direct the output of g_print to the label.

g_print isn't what you should be using, although you could hack it using
g_set_print_handler:

http://www.gtk.org/api/2.6/glib/gli...ns.html#g-print
http://www.gtk.org/api/2.6/glib/gli...hand
ler

...the best thing to do is start using g_strdup_printf:

http://www.gtk.org/api/2.6/glib/gli...-printf


...and then either setting the output to a label or the console.

--
James Antill -- james@and.org
http://www.and.org/and-httpd/ -- $2,000 security guarantee
http://www.and.org/vstr/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:36 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register