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




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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]