[Gtk-sharp-list] [GTK#] Display problem

Fonzetto Michaël michael.fonzetto at gmail.com
Thu Oct 13 02:55:04 EDT 2005


Hello,

I have spent much time around this problem : I use a main VBox that includes
some HBoxes.
In one Hbox (the one I think that causes problems) I attached 4 images and 1
Label. I want to display one Image at a time and the label content changes
every time the image changes. So the first time I use the myWindow.ShowAll()
method and I call a method that selects the right image to display. Then, I
display the image by : Hiding the 3 images I don't use and Show the image I
want to be displayed (the label content changes as well). But I have display
refresh problems the program keeps executing (Writing to Console continues)
but the display is freezed.

Thank you very much for your help

Code of widgets' creation :
// Main VBox
vBoxPrinc = new VBox();
// Création des HBox
hBoxImages = new HBox();
hBoxMessages = new HBox();
hBoxInfos = new HBox();

// Création des objets
// Images
imageD = new Gtk.Image("./D.jpg");
imageP = new Gtk.Image("./P.jpg");
imageHomme = new Gtk.Image("./homme.png");
imageCommande = new Gtk.Image("./commande.png");
imageOK = new Gtk.Image("./OK.png");
imageStop = new Gtk.Image("./stop.png");
// Labels
labelMessage = new Label();
Style styleLabelMessage = new Style();
styleLabelMessage = labelMessage.Style.Copy();
styleLabelMessage.FontDesc.Size = 20000;
labelMessage.Style = styleLabelMessage;
labelDateHeure = new Label();
// Entry
entryBadge = new Entry();
entryBadge.NoShowAll = true;
entryBadge.MaxLength = 11;
entryBadge.TextInserted += new TextInsertedHandler (EntryBadgeTextInserted);

// Remplissage des box
hBoxImages.PackStart(imageD,false,false,0);
hBoxImages.PackStart(hBoxVide,true,true,0);
hBoxImages.PackStart(imageP,false,false,0);

hBoxMessages.PackStart(imageHomme,true,true,0);
hBoxMessages.PackStart(imageCommande,true,true,0);
hBoxMessages.PackStart(imageOK,true,true,0);
hBoxMessages.PackStart(imageStop,true,true,0);
hBoxMessages.PackStart(labelMessage,true,false,0);

hBoxInfos.PackStart(entryBadge,false,false,0);
hBoxInfos.PackStart(labelDateHeure);

vBoxPrinc.PackStart(hBoxImages,false,true,0);
vBoxPrinc.PackStart(hBoxMessages,true,true,0);
vBoxPrinc.PackStart(hBoxInfos,false,true,0);

// Ajout du widget vBoxPrinc à la fenêtre
this.Add(vBoxPrinc);

Code for display:
switch(result)
{
// Affichage icône commande
case -2:
break;
// Affichage icône homme
case -1:
imageCommande.Visible = false;
imageOK.Visible = false;
imageStop.Visible = false;
imageHomme.Visible = true;
Console.WriteLine("Homme");
break;
// Affichage icône OK
case 0:
break;
// Affichage icône Problème
default:
imageCommande.Visible = false;
imageOK.Visible = false;
imageHomme.Visible = false;
imageStop.Visible = true;
Console.WriteLine("Stop");
break;
}
labelMessage.Text = message;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20051013/6989e727/attachment.html


More information about the Gtk-sharp-list mailing list