Re: gnome canvas and gtk menu questions
- From: "John (J5) Palmieri" <johnp martianrock com>
- To: John Heidemann <johnh isi edu>
- Cc: gnome-devel-list gnome org
- Subject: Re: gnome canvas and gtk menu questions
- Date: 20 Jun 2003 16:56:31 -0400
On Fri, 2003-06-20 at 16:37, John Heidemann wrote:
> On 20 Jun 2003 14:56:34 EDT, "John (J5) Palmieri" wrote:
> >
> >> >> Any suggestions about how to change the color of a single menu item?
> >> >> Is this a style/theming problem? (I want to control just one menu
> >> >> entry. I'm happy to let theming work for all the other parts of the
> >> >> menu.)
> >> >
> >> > So what color do you want to set it to ? what if the theme uses that
> >> >color for the background ? will a different coloured menu give the user
> >> >the heebie jeebies - given that no other app does this sort of evilness
> >> >;-)
> >>
> >> In general, I would agree with you. But this app has a very specific
> >> reason to do this: when you click on a blob, it represents a process
> >> on your system, and you get a menu that lets you send signals to the
> >> process. That process has a color, keyed to the name of the process.
> >> The menu needs to have visual feedback to indicate that it's working
> >> on the process you want, not something else.
> >>
> >> But don't take my word for it, download the Tcl/Tk lavaps code or RPM
> >> from my web page and try it out.
> >>
> >
> >How about this suggestion. Instead of changing the colors of the menu
> >items, change the icon. You can place icons next to menu items and
> >icons are usualy more eyecatching then coloring the fonts. This allows
> >you to keep the items legible no matter what theme is used. If you also
> >wish to have seperate icons for each menu item you can create a series
> >of colored icons based on the base icon. Or to make things easy (and
> >you're not artisticly inclined) you can use a set of one type of icon,
> >such as translucent colored spheres.
>
> Yes, I've thought about that as an alternative. Two downsides: I'd have to
> generate the icons on the fly, and icons aren't as big as the whole
> menu item.
>
> I'd have to generate icons on the fly because the color is
> algorithmically generated to anywhere in the RGB space. It's not just
> a few discrete colors that for which I can have precomputed icons.
>
> Icons also are pretty small (about as high as the text and square).
> I'd prefer to color the whole width of the menu.
>
> (Of course, what would be really cool would be to match the process to
> its icon in the file system/menu. But doing that without the support
> of the application seems like a non-starter.)
>
> Another option, can I replace the text of the menu with an image?
> That solves the width problem. I'd guess if I have to access
> GTK_BIN(menu_item)->child, I can probably replace it as well, if I
> have to.
gtk_label_set_markup(GtkLabel *label, gchar* str)
Parses str which is marked up with the Pango text markup language,
setting the label's text and attribute list based on the parse results.
gtk_label_set_markup(GTK_BIN(menu_item)->child, "<span
foreground=\"#FF0000\">I am Red</span>");
Try that.
--
J5
> -John Heidemann
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]