Re: Bring a widget to the foreground

2011-01-07 Thread jcupitt
On 7 January 2011 11:33, John Emmas wrote: > Although I can now change the button's label font, the new font seems to be > quite transitory and certain operations seem to reset it.  For example if > (later) I change the label's text (e.g. if it currently says "This message" > and I change it to

Re: Bring a widget to the foreground

2011-01-07 Thread John Emmas
On 2 Jan 2011, at 21:00, jcup...@gmail.com wrote: > On 2 January 2011 15:39, John Emmas wrote: >> To be honest, all I'm trying to do is create a button whose label font can >> be changed on demand. I've managed to achieve it by using an empty button >> with a label on top, except that the lab

Re: Bring a widget to the foreground

2011-01-04 Thread jcupitt
I agree, I was just trying to keep it simple. On Tuesday, 4 January 2011, Jaroslav Šmíd wrote: > Don't do that. Fixed size buffers are evil for string formatting. You better > use g_strdup_printf even though this would lead to reallocations. But much > better then end up with cropped text. > >

Re: Bring a widget to the foreground

2011-01-04 Thread Jaroslav Šmíd
Don't do that. Fixed size buffers are evil for string formatting. You better use g_strdup_printf even though this would lead to reallocations. But much better then end up with cropped text. On 01/02/2011 10:00 PM, jcup...@gmail.com wrote: On 2 January 2011 15:39, John Emmas wrote: To be hone

Re: Bring a widget to the foreground

2011-01-02 Thread John Emmas
Many thanks John, I'll try your suggestion tomorrow. Thanks also, Tadej. That's pretty much how I created the button at my first attempt. It created the button OK but I couldn't find a way to change the font later. :-( John ___ gtk-app-devel-list m

Re: Bring a widget to the foreground

2011-01-02 Thread jcupitt
On 2 January 2011 15:39, John Emmas wrote: > To be honest, all I'm trying to do is create a button whose label font can be > changed on demand.  I've managed to achieve it by using an empty button with > a label on top, except that the label doesn't always stay on top! Ah, OK, yes, there's a mu

Re: Bring a widget to the foreground

2011-01-02 Thread Tadej Borovšak
Hi. > I followed that link but it doesn't look as if it would work for a button.   > I'd need to be able to get the button's label object (if there is one) but I > can't see an obvious way of getting it  :-( How you'll get your hands on GtkLabel object inside button depends on how your butto

Re: Bring a widget to the foreground

2011-01-02 Thread John Emmas
On 2 Jan 2011, at 17:19, Lance Dillon wrote: > > I would use gtk_label_set_attributes(), > http://library.gnome.org/devel/gtk/stable/GtkLabel.html#gtk-label-set-attributes > > That would probably do what you want. > I followed that link but it doesn't look as if it would work for a button.

Re: Bring a widget to the foreground

2011-01-02 Thread Lance Dillon
- Original Message > From: John Emmas > To: gtk-app-devel-list > Sent: Sun, January 2, 2011 10:42:28 AM > Subject: Re: Bring a widget to the foreground > > > On 2 Jan 2011, at 15:39, John Emmas wrote: > > > > > I'm probably being incre

Re: Bring a widget to the foreground

2011-01-02 Thread John Emmas
On 2 Jan 2011, at 15:39, John Emmas wrote: > > I'm probably being incredibly dim but I couldn't find a way to do this with a > standard gtk button. I could change the label's text quite easily but not > its font. Am I missing something very obvious? > Sorry, that's ambiguous now that I re-

Re: Bring a widget to the foreground

2011-01-02 Thread John Emmas
On 2 Jan 2011, at 14:40, jcup...@gmail.com wrote: > > You can just set the alignment on the label to get them to display at > the top of the button. > >> [...] > > GTK does not officially support overlapping widgets. However, you can > sort-of do it by putting groups of widgets into eventboxes

Re: Bring a widget to the foreground

2011-01-02 Thread jcupitt
Hi John, On 2 January 2011 13:17, John Emmas wrote: > As an example, let's say I wanted a button whose label needed to be at the > top of the button, rather than in the centre.  I use either a separate label > or a graphical image to achieve this. You can just set the alignment on the label to