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



>>>>> "Havoc" == Havoc Pennington <rhpennin@midway.uchicago.edu> writes:

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

I was thinking that very thing when I wrote the code.  One day I might
want a little pixmap next to the label say.  Oh, well.  I will burn
that bridge when I come to it.

Havoc> If you're paranoid like me, you could get yourself a handle to
Havoc> the label at time of menu creation (either your way or by
Havoc> creating the label manually), then stuffing a pointer to the

You are of course right about that.  When I start to wrap the
functionality that I am fiddling with inside an API, I will probably
do that.  At the moment, all that would happen is that I would pollute
my application data space.

Havoc> label into a struct somewhere or using set_data to store it on
Havoc> the menuitem. Then your breakage-prone code is right next to
Havoc> where you'd break it and you won't forget.

Der...  I hadn't thought of using the set data functionality.  It has
only been staring me right in the face, how am I supposed to know it
is there. :-)

Thanks.

- Dave

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS dpu s-:+ a C++$ ULS++$ P+++$>++++ L++>+++$ E+>++ W N++ !o K w++$ O !M-
!V(-) PS+ PE- Y+ PGP !t-- 5++ X R tv b+ DI+++ D G e++ h--- r+++ y++++
------END GEEK CODE BLOCK------



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