Re: [gtk-list] basic question



> I somehow feel that this should destroy the first button and all that he has 
> set up for it, (because thats how pointers work.. right) but I see that it 
> doesn't work this way. can someone explain what's happening?  

No, you're wrong: when you do button=gtk_button_new(...), you get the
address in memory of the newly created button. Then you can use that adress
to handle that button. But if you put something else in the pointer, you
only lose the address, and not the object himself.
Imagine you get a friend, you write his phone number on a black board. You
call him, you give him orders, you give him your number. Then you get
another friend, and since you have a small board, you erase your first
friend's number and write it at the same place. But your first friend
still exists, and he still haves you phone number to call you.



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