[9131] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Modifying the text of a single item in a menu.

daemon@ATHENA.MIT.EDU (Havoc Pennington)
Fri Oct 9 12:10:49 1998

Date: Fri, 9 Oct 1998 11:02:33 -0500 (CDT)
From: Havoc Pennington <rhpennin@midway.uchicago.edu>
To: gtk-list@redhat.com
In-Reply-To: <m367dt7qxc.fsf@term1.dccs.com.au>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


On 10 Oct 1998, Dave Cole wrote:
> 
> The code I am using to traverse and update the menu looks like:
> 

Looks like it ought to work (as you say). The worry I have about it is
that you might someday change what's in the button, and then the code will
silently become a horrible bug, with no compiler warnings.

If you're paranoid like me, you could get yourself a handle to the label
at time of menu creation (either your way or by creating the label
manually), then stuffing a pointer to the label into a struct somewhere or
using set_data to store it on the menuitem. Then your breakage-prone code
is right next to where you'd break it and you won't forget.

I'm paranoid though. ;-)

Havoc


-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post