[Gtk-sharp-list] label

Christian Hoff christian_hoff at gmx.net
Fri Sep 5 10:32:04 EDT 2008


Is this so difficult?

namespace LabelTest
{
    public class MainWnd : Gtk.Window
    {
       
        public MainWnd () : base ("test")
        {
            Gtk.Label lbl = new Gtk.Label ("Hello");
            lbl.SetAlignment (1f, 0.5f);
            this.Add (lbl);
            this.Resize (200, 200);
            this.ShowAll ();
        }

        protected override void OnHidden () {
            Gtk.Application.Quit ();
            base.OnHidden ();
        }

        public static void Main (string[] args) {
            Gtk.Application.Init ();
            new MainWnd ();
            Gtk.Application.Run ();
        }
    }
}

Darwin Reynoso schrieb:
> i'm trying to justify a label. here are two screenshots of my little
> test program. thanks
>
> On Fri, Sep 5, 2008 at 8:17 AM, Christian Hoff <christian_hoff at gmx.net> wrote:
>   
>> Of how to set the background color of a label?
>> label.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (200, 0, 0));
>>
>> Darwin Reynoso schrieb:
>>     
>>> can you please post an example.
>>>
>>> On Fri, Sep 5, 2008 at 2:03 AM, Christian Hoff <christian_hoff at gmx.net>
>>> wrote:
>>>
>>>       
>>>> label.SetAlignment works for me; I'm sure your label is just as big as
>>>> the
>>>> text in it. Maybe you should modify the background color or let it
>>>> display a
>>>> border to see how large it actually is.
>>>>
>>>> Darwin Reynoso schrieb:
>>>>
>>>>         
>>>>> yes, but it doesn't work. I really don't know how to do it
>>>>>
>>>>> On Thu, Sep 4, 2008 at 12:04 PM, Chris Howie <cdhowie at gmail.com> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> On Thu, Sep 4, 2008 at 11:17 AM, Darwin Reynoso <monouser at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Here is my code but it doesn't work
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> Is the label packed with "fill" turned on?
>>>>>>
>>>>>> --
>>>>>> Chris Howie
>>>>>> http://www.chrishowie.com
>>>>>> http://en.wikipedia.org/wiki/User:Crazycomputers
>>>>>>
>>>>>>
>>>>>>             



More information about the Gtk-sharp-list mailing list