Re: Background picture + label



Hi,

    I 'm a newbie in gtk too.Sorry for I can't tackle your problem.
    I just want to display jpeg files,but I don't know how to,and would you like to help me ?
    I have the jpeg-6b library,and I have build the gimp src file successfully.
    
    can you give me a hint about this? Thanks a lot
    

Best regards 
Zou    


----- Original Message ----- 
From: <raphy7002 caramail com>
To: <gtk-list gnome org>
Sent: Saturday, May 26, 2001 2:56 AM
Subject: Background picture + label


Hello,

I'm newbie in gtk and I've actually one big
problem in gtk.

I'm using jpeg pictures in background of some
of my GTK windows.
And I would like to display GTk labels above 
these background pictures. 
To do that I'm using a Gtk resource file to change the 
color and the font of my labels, after that I display my
label.
When I use my application I have my window with the
background 
picture and the label but as soon as I move the window the
label
disappear. Why ?

Is there any solution for it ?

I send you a part of my program and the gtk resource file.


GTK resource file
*****************

style "choix_skin"
{
fg[NORMAL] = {0.7, 0.6, 0.3}
fg[ACTIVE] = {0.7, 0.6, 0.3}
fg[SELECTED] = {0.7, 0.6, 0.3}
font = "-adobe-helvetica-bold-o-normal--*-130-*-*-*-*-*-*"
}

widget "*label_choix_skin" style "choix_skin"



Part of my program
******************

void choix_theme(GtkWidget *widget, gpointer data)
{
 GdkImlibImage *main_image;
 GdkPixmap *main_picture;
 GdkBitmap *main_picture_mask;
 GtkWidget *logo;
 GtkWidget *fixed1, *texte1;
 GtkWidget *button1;

 gtk_sess *sess = (gtk_sess *)data;

 main_image=gdk_imlib_load_image("./Art44.jpg");
 gdk_imlib_render(main_image, 220, 110);
 main_picture = gdk_imlib_move_image(main_image);
 main_picture_mask = gdk_imlib_move_mask(main_image);
 logo = gtk_pixmap_new(main_picture, main_picture_mask);

 // sess->pref is the window where I display the background
picture and the label
 sess->pref = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 gtk_widget_set_usize(sess->pref, 220, 110);
 gtk_window_set_policy(GTK_WINDOW(sess->pref), FALSE,
FALSE, FALSE);
 gtk_widget_show(sess->pref);

 fixed1 = gtk_fixed_new (); 
 gtk_widget_ref (fixed1);
 gtk_widget_show (fixed1);
 gtk_container_add(GTK_CONTAINER(sess->pref), fixed1); 
 gtk_fixed_put(GTK_FIXED(fixed1), logo, 0, 0);
 gtk_widget_show(logo);

 texte1 = gtk_label_new ("Choix de la Skin du Player:");
 gtk_widget_set_name(texte1, "label_choix_skin");
 gtk_widget_show (texte1);
 gtk_fixed_put (GTK_FIXED (fixed1), texte1, 25, 12);

 // concerning the button there is no problem , when I move
the window
it doesn't disappear (I think it's normal, but why is it
different for the label ?) 
 button1 = gtk_button_new_with_label(VALIDER);
 gtk_widget_set_usize (button1, 50, 25);
 gtk_widget_set_style (button1, style[GREEN]);
 gtk_widget_show (button1);
 gtk_fixed_put (GTK_FIXED (fixed1), button1, 45, 75);
 gtk_signal_connect(GTK_OBJECT(button1), "clicked",
GTK_SIGNAL_FUNC(change_theme), (gpointer) sess);
 
 
 Thanks a lot for your help, because there is certainly one
solution for my problem.

Raph
_________________________________________________________
Le journal des abonnés Caramail - http://www.carazine.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]