Re: radio_button behavior with toggle_button style ?



Jack Chen wrote:

 --- Olexiy Avramchenko <olexiy irtech cn ua> wrote: > Petr Tomasek
wrote:

On Sat, Jan 10, 2004 at 08:38:09AM +0100, Alain D'EURVEILHER wrote:



Hi,

Is it possible to make a group of toggle button, but behavioring as

the
radiobuttons ??

Here it is... : have for example 3 toggle_button and, pressing one

down
release (up) the other ones...

I've tried to make it, but i didn't know how... If sb have some

clue on
that... ;-)

Thx.

AlaiN.



Ha I know why you want to make that... because it looks better and you
can customize the big buttons. I just did that, and it's easy. Here's
how:

- Set each button to be a toggle button
- Create a global GtkWidget pointer for each of the buttons
- In the callback for the toggle button set the other buttons to go
"unpressed" using their global pointers.
- Here you go!

The trick is to set the pointer to button as a global instead of one
inside main(), so you can change the button's state from within other
callback functions.

Bye

Jack

Ok, Thank you Jack, but I think that the solution given by Soeren, is more simple than yours !! :
"
Create the radio buttons as usual, then use

   gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radio_button), FALSE);

to make the radio buttons draw like regular buttons.
"
Thx anyway ;-)

--

Alain.



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