Re: images inside labels
- From: "devel" <devel oberonwireless com>
- To: "GTK" <gtk-app-devel-list gnome org>
- Subject: Re: images inside labels
- Date: Mon, 30 Jan 2006 14:30:51 -0500
Well, I have tried placing an image and a label inside an hbox, but no such
luck. For some reason, the notebook's tab label is not showing the hbox. Its
not showing anything, not even the page number. Very certain I am packing
what and where I need to. Little stumped. Thanks.
gtk_box_pack_start(GTK_BOX (hbox), icon, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_notebook_append_page(GTK_NOTEBOOK (notebook), scroll, hbox);
Travis
----- Original Message -----
From: "devel" <devel oberonwireless com>
To: "Tristan Van Berkom" <tvb gnome org>
Cc: "GTK" <gtk-app-devel-list gnome org>
Sent: Monday, January 30, 2006 11:52 AM
Subject: Re: images inside labels
To answer your question, the latter of what you mentioned. I just need a
small icon/image next to a one-word blurb on the tab. So the 1st idea you
mentioned sounds reasonable enough.
Good thing I'm not a betting man, eh?
Thanks
Travis
----- Original Message -----
From: "Tristan Van Berkom" <tvb gnome org>
To: "devel" <devel oberonwireless com>
Cc: "GTK" <gtk-app-devel-list gnome org>
Sent: Monday, January 30, 2006 12:56 PM
Subject: Re: images inside labels
devel wrote:
I have a gtknotebook that I would like to put small images inside the
tab labels. I've looked around, but haven't seen how to do that. I am
willing to bet that it can't be done, but I'll just ask as a last
resort. Thanks.
Hmmm how much you wanna bet ?
heh, so do you want images as a background of the label
or do you want images beside the labels in the notebook ?
You can:
o Create a hbox and add an Image and a Label to it, then call
gtk_notebook_set_tab_label (if thats what the function is called)
with the hbox as an argument (you can use anything as a tab-label).
o If you want the label to draw onto an image, you'll have to dig
a little deeper; you need to use the theme engine to associate
a graphic file with the background of the label (or its parent
widget), you could do this via a gtkrc file also but I think
you'll want it to be theme independant.
This func: gtk_widget_modify_style () should be a good lead on
how to do that :)
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]