Re: Change the behaviour of a button



David Rosal wrote:
Ok. Then I wanted to be able to stop the file removing with the same
button, so I wanted it to have the label "Stop" and the "Stop" gtk icon
inside.

I know how to change the callbacks with g_signal_block() and
g_signal_unblock(), but I don't know which is the best way to change the
label and icon inside the button. It should be such that the old
"Remove" label and icon could be reused, because I want the "Stop"
button to change into "Remove" again.

I'm sure there's a "right way" but if you're in a hurry you can do something I've used successfully. Use a table to lay out your objects, and pack two buttons into the same cell. Hide one. When you need to show the Stop button, hide the Remove button and show the Stop button. It works very well for me.

Regards,
Chad



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