[gtk] radio button을 생성한 후.. toggle하면 출력이 두번 나옵니다.

assa의 이미지

radio button을 생성하고, 클릭하면 test()함수가 두번 호출됩니다.

원래 그런가요? 아니면 제가 잘못 코딩한 것인가요?

// packing에 대한 vBox, hBox 생성은 생략하였음.

GtkWidget *button= Make_RadioButton(hBox, "aaa", NULL);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
Make_RadioButton(hBox, "bbb", button);

<Make_RadioButton 함수>
GtkWidget *  Make_RadioButton(GtkWidget *thBox, char *tName, GtkWidget *tRadioButton){
    GtkWidget *radioButton= gtk_radio_button_new_with_label_from_widget((GtkRadioButton *)tRadioButton, tName);

    gtk_box_pack_start(GTK_BOX(thBox), radioButton, true, true, 0);

    gtk_widget_show(radioButton);

    g_signal_connect(radioButton, "toggled",
            G_CALLBACK(test), NULL
            );

    if(tRadioButton == NULL)
        return radioButton;
    else
        return NULL;
}

<test 함수>
void test(){
    g_message("toggled");
}

그리고 추가적인 질문으로, 위의 경우에서 radio button을 따로 변수로 두지 않고, GtkWidget *button 하나의 위젯으로 만들었는데요.

나중에 각각의 radio button을 찾으려면 어떻게 해야 하는지 궁금합니다.

활성화된 위젯 또는 임의의 위젯을 찾는 방법으론 어떤것이 있는지요?