Re: gtk_label_parse_uline() in Gtk 1.2.0
- From: Owen Taylor <otaylor redhat com>
- To: Shaw Terwilliger <sterwill postman abisource com>
- Cc: gtk-list redhat com
- Subject: Re: gtk_label_parse_uline() in Gtk 1.2.0
- Date: 27 Mar 1999 20:27:30 -0500
Shaw Terwilliger <sterwill@postman.abisource.com> writes:
> I'm manually calling gtk_label_parse_uline() in the course
> of construction menu items with accelerators. When calling
> this function, I'm passing in a string with an underscore
> inserted before the character I want to bind. Everything
> works great, except for my Most Recently Used menu items.
> For example, I might pass in "_1 /tmp/my_file.abw", but
> the function continues past the first underscore and builds
> a string with the "f" in "file" underlined also.
>
> The way the loop is constructed, the return value (the character
> code of the underlined character) is only set the first time.
> Should this function continue to underline subsequent
> occurrences of characters following underscores, or simply
> copy the string verbatim (which seems to be the right
> thing to do, since only one value is returned).
>
> It's a very simple fix to the loop.
If you convert _ in the file names to __, then GTK_
will display single genuine underscores. That will
then work if you switch to putting the 1 afterwords...
I was thinking of parse_underline() as a function that
converts a string with underlining embedded into
separate pattern/string, and as a side-effect returns
the accelerator key.
The argument could be made either way though, I'd admit.
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]