Ted's Blog

Happy coding

GtkRadioButton示例

Ted posted @ 2008年9月11日 01:12 in gtk with tags gtk , 4897 阅读

#include<gtk/gtk.h>

GtkWidget *window,*hbox,*button1,*button2,*button3;
void toggled(GtkWidget *widget, gpointer data)
{
    if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
    {
        g_print ("%s\n", data);
    }
}
void destroy(GtkWidget *widget, gpointer data)
{
    gtk_main_quit();
}

int main(int argc,char** argv)
{
    gtk_init(&argc,&argv);

    window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(window),"Radio button");
    gtk_container_set_border_width(GTK_CONTAINER(window),3);
    g_signal_connect(window,"destroy",G_CALLBACK(gtk_main_quit),0);

    hbox=gtk_hbox_new(TRUE,3);
    /* 单选按钮的创建 */

    button1=gtk_radio_button_new_with_label(NULL,"orange");
    g_signal_connect(G_OBJECT(button1),"toggled",G_CALLBACK(toggled),"orange");
    /* 每创建一个单选按钮时,都必须调用一次gtk_radio_button_get_group,否则出错*/
    button2=gtk_radio_button_new_with_label(gtk_radio_button_get_group(GTK_RADIO_BUTTON(button1)),"apple");
    g_signal_connect(G_OBJECT(button2),"toggled",G_CALLBACK(toggled),"apple");
    button3=gtk_radio_button_new_with_label(gtk_radio_button_get_group(GTK_RADIO_BUTTON(button1)),"banana");
    g_signal_connect(G_OBJECT(button3),"toggled",G_CALLBACK(toggled),"banana");
    /* 设置第三个按钮为激活状态 */
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button3),TRUE);

    /* 将单选按钮添加到hbox内 */
    gtk_box_pack_start(GTK_BOX(hbox),button1,TRUE,TRUE,3);
    gtk_box_pack_start(GTK_BOX(hbox),button2,TRUE,TRUE,3);
    gtk_box_pack_start(GTK_BOX(hbox),button3,TRUE,TRUE,3);

    gtk_container_add(GTK_CONTAINER(window),hbox);
    gtk_widget_show_all(window);
    gtk_main();
    return 0;
}

Avatar_small
babysitting services 说:
2019年9月10日 20:25

This site offers you the most perfect part time frame maid you will be interested in. Someone who will be trustworthy and nobody can keep the home sparkling cleanse. You can purchase them which includes a simple check out our webpage. All all of our maids will be well-trained, expert, and efficient professionals, just for you to relax as you move work is done by best dwelling maids around Dubai. Our recent customers currently have shared and continue to keep share customer feedback and reviews that are positive for all of our maids. Hence, leave a worry so that you can us and center on what’s essential to you actually while most people clean the home and deal with the house work.

Avatar_small
buy dissertation onl 说:
2020年5月27日 21:02

When Recycling and creativity both work together, it gives the better result. The old barrens are use in the innovative way for the storage. They explains the simple tricks to utilize the old un used things. it is a great idea to recycle the products.

Avatar_small
Robinjack 说:
2020年12月07日 23:46

If you ever get the opportunity to engage in a date with a Polish man or woman, be ready for amazement by the elegance, excitement and fun your Polish date will bring to the evening. dating app hk

Avatar_small
Robinjack 说:
2020年12月21日 20:32

My friend sent me here and I thought I’d say hi, great blog. book desk

Avatar_small
UMAIR 说:
2021年2月13日 14:57

Karnataka State Board of Secondary Education has finally announced the release date for Karnataka SSLC HallKar 10th Hall Ticket 2021 Tickets 2021. A huge number of students who had registered for the class 10 examinations can download their hall ticket right now.

Avatar_small
ETHENS 说:
2021年2月15日 23:01

I adore your wp web template, wherever would you obtain it through? https://usmanbukhari.com/

Avatar_small
UMAIR 说:
2021年2月17日 14:37

I consider most you will know at this point that there is a simple method to alter PDFs. You should simply visitaltopdftoppt.com and transfer the archive you need to alter. The site will wrap up.

Avatar_small
Robinjack 说:
2021年2月17日 21:46

I am interested in looking for more of such topics and would like to have further information. Hope to see the next blog soon. event management

Avatar_small
UMAIR 说:
2021年2月20日 16:33

Though you make some VERY fascinating points, you're going to have to do more than bring up a few things that may be different than what we've already heard. What are trying to say here http://zareenimam.com/

Avatar_small
amelia 说:
2021年3月13日 00:05

Amazing online journal. I delighted in perusing your articles. This is really an incredible read for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome!  Buy DMT

Avatar_small
amelia 说:
2021年3月15日 00:24

I am exceptionally cheerful to find your post as it will get to be on top in my gathering of most loved sites to visit.  wholesale sunglasses vendor

Avatar_small
seomoz 说:
2021年3月18日 02:47

Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. digital advertising companies

Avatar_small
amelia 说:
2021年3月18日 20:34

Pleasant post mate, keep up the colossal work, simply imparted this to my friendz  handbags and wallets wholesale

Avatar_small
amelia 说:
2021年3月18日 20:35

I can't envision concentrating sufficiently long to research; considerably less compose this sort of article. You've beaten yourself with this material. This is incredible substance.  wholesale fashion accessories by the dozen

Avatar_small
seomoz 说:
2021年3月24日 19:52

You will find dissertation online sites via internet settle purchase not surprisingly well-known while in the web pages. https://www.youtube.com/watch?v=Qq8d5GZoy90

Avatar_small
seomoz 说:
2021年3月30日 01:19

You have beaten yourself this time, and I appreciate you and hopping for some more informative posts in future. Thank you for sharing great information to us. togel online

Avatar_small
seomoz 说:
2021年4月02日 03:26

You have beaten yourself this time, and I appreciate you and hopping for some more informative posts in future. Thank you for sharing great information to us. 먹튀검증커뮤니티

Avatar_small
amelia 说:
2021年4月02日 18:45

The post is written in very a good manner and it contains many useful information for me. Catering canterbury

Avatar_small
maxbet 说:
2021年4月07日 18:23

Not sure about this text. It seems to be all right, but something is missing

Avatar_small
amelia 说:
2021年4月10日 06:33

I would like to say that this blog really convinced me to do it! Thanks, very good post. รีวิวUFA365

Avatar_small
amelia 说:
2021年4月11日 03:54

Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. รีวิวufa800

Avatar_small
chalsea 说:
2021年4月15日 01:47

Much obliged such a great amount for this data. I need to tell you I agree on a few of the focuses you make here and others may require some further audit, however I can see your perspective.  Z strain mushrooms

Avatar_small
chalsea 说:
2021年4月22日 04:11

This is an awesome motivating article.I am practically satisfied with your great work.You put truly exceptionally supportive data. Keep it up. Continue blogging. Hoping to perusing your next post.  Network System Design

Avatar_small
chalsea 说:
2021年4月24日 04:07

I am upbeat to locate your recognized method for composing the post. Presently you make it simple for me to comprehend and execute the idea. Much obliged to you for the post.  카지노사이트

Avatar_small
chalsea 说:
2021年5月04日 00:51

This one is great. keep doing awesome!.. website Tap

Avatar_small
amelia 说:
2021年5月22日 04:13

Positive site, where did u concoct the data on this posting? I'm satisfied I found it however, sick be inquiring soon to discover what extra posts you incorporate.  https aka ms remoteconnect

Avatar_small
meeting room booking 说:
2021年5月26日 13:23

Hello there I am so excited I found your web site, I really found you by error, while I was looking on Aol for something else, Nonetheless I am here now and would just like to say thank you for a tremendous post and a all round entertaining blog (I also love the theme/design), I don’t have time to look over it all at the moment but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the great job.

Avatar_small
ch 说:
2021年5月29日 18:06

An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers.  click here

Avatar_small
ch 说:
2021年5月29日 23:39

Much obliged for a superb offer. Your article has demonstrated your diligent work and experience you must this field. Splendid .i cherish it perusing.  Rent a car Novi Sad

Avatar_small
ch 说:
2021年5月31日 23:28

Dignity College of Healthcare online surgical technician training is far superior than other online Surgical Technician programs because it includes the training, exam review and national certification exam for the EKG technician and a comprehensive, but simple tailored program for the Surgical Technician. Register with Confidence and attend a nationally accredited, but affordable program. In just 4 months, you can finish with two certifications (A national certification as an Electrocardiogram Technician and a school certification of completion as a surgical Technician) without a loan on your neck! surgical technician national certification exam

Avatar_small
ch 说:
2021年6月01日 00:35

Dignity College of Healthcare online surgical technician training is far superior than other online Surgical Technician programs because it includes the training, exam review and national certification exam for the EKG technician and a comprehensive, but simple tailored program for the Surgical Technician. Register with Confidence and attend a nationally accredited, but affordable program. In just 4 months, you can finish with two certifications (A national certification as an Electrocardiogram Technician and a school certification of completion as a surgical Technician) without a loan on your neck! surgical technician national certification exam

Avatar_small
ch 说:
2021年6月05日 03:35

I felt exceptionally glad while perusing this site. This was truly exceptionally enlightening site for me. I truly preferred it. This was truly a sincere post. Much obliged!.  Park Magazine NY

Avatar_small
ch 说:
2021年6月05日 05:52

Very useful info. Hope to see more posts soon!. read Check post

Avatar_small
chalsea 说:
2021年6月06日 19:43

I truly thank you for the profitable data on this incredible subject and anticipate more extraordinary posts. Much appreciated for getting a charge out of this magnificence article with me. I am valuing it all that much! Anticipating another extraordinary article. Good fortunes to the creator! All the best!  website

Avatar_small
ch 说:
2021年7月07日 05:39

Great Article it its really informative and innovative keep us posted with new updates. Louisiana Estate Conservation Strategies

Avatar_small
ch 说:
2021年7月19日 06:56

This is an incredible rousing article.I am essentially satisfied with your great work.You put truly exceptionally accommodating data. Keep it up. Continue blogging. Hoping to perusing your next post.  Work Experience Builders

Avatar_small
ch 说:
2021年7月30日 00:21

I read that Post and got it fine and informative. Please share more like that... Religion Bobbleheads

Avatar_small
ch 说:
2021年8月01日 04:45

Much thanks to you for setting aside an ideal opportunity to distribute this data extremely valuable!  Fast PCR

Avatar_small
ch 说:
2021年8月11日 00:04

Hi. I discovered your online journal utilizing msn. This is a to a great degree elegantly composed article. I will make certain to bookmark it and come back to peruse a greater amount of your helpful data. A debt of gratitude is in order for the post. I'll absolutely rebound.  PCR Home Test Kit

Avatar_small
Robinjack 说:
2021年8月22日 22:33

It is appropriate time to make some plans for the future and it is time to be happy. I have read this post and if I could I wish to suggest you some interesting things or advice. Perhaps you could write next articles referring to this article. I wish to read more things about it! room reservation software

Avatar_small
ch 说:
2021年8月29日 23:35

Totally incredible posting! Heaps of valuable data and motivation, both of which we all need!Relay value your work.  Branding

Avatar_small
Robinjack 说:
2021年9月06日 21:17

Impressive document! I personally experienced any learning. I’m hoping to see increased from your site. In my opinion , you can have impressive wisdom and in addition visual acuity. I’m now really contented utilizing this guidance. we buy houses san diego ca

Avatar_small
ch 说:
2021年9月08日 03:06

Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. Termite & Pest Control Services

Avatar_small
ch 说:
2021年9月12日 01:45

Incredible! It sounds great. A debt of gratitude is in order for sharing..  Dermatologist

Avatar_small
home cleaning dubai 说:
2021年9月18日 18:29

Hence, start together with the windows’ eyeglass frames and cleanse cloth. Don’t miss out on an inch of your frames and you could use vacuum pressure cleaner in addition to shed all all those nasty debris. Furthermore, employ a dedicated home window cleaner to get experiencing your smudge-free, and streak-free windows 7. And, don’t find themselves using waters; or altogether different, you’ll have got to repeat all the process to shed water bothersome stains. Let all of the cleaners fall off them selves. Additionally, clean a shutters plus curtains and also other curtains.

Avatar_small
Robinjack 说:
2021年9月18日 19:43

The Commodore At Canberra by JBE. Hotline 61006226. Get Discounts, Direct Developer Price, Brochure, Floor Plan & Price List. The Commodore Floor Plan

Avatar_small
Robinjack 说:
2021年10月06日 19:45

Advantageously, the send is in reality the sweetest on this creditable topic. fourth avenue residences showflat

Avatar_small
ch 说:
2021年10月22日 00:40

Fascinating theme for an online journal. I have been scanning the Internet for the sake of entertainment and happened upon your site. Impressive post. Much appreciated a ton for sharing your insight! It is extraordinary to see that a few individuals still invest an exertion into dealing with their sites. I'll make sure to return again genuine soon.  Copy editing

Avatar_small
Robinjack 说:
2021年11月07日 19:50

Hi, which is one of the best hemorrhoids cream to use as an immediate repair for dishevelled under eyes. I do know it is one with out hydra- cortisone in it, or does anyone know of any cheapish beauty cream that works really well. Please help. buy slime

Avatar_small
ch 说:
2021年12月01日 18:38

I've been hunting down some tolerable stuff on the subject and haven't had any fortunes up until this point, You just got another greatest fan!.. Brand Audit

Avatar_small
ch 说:
2021年12月19日 18:47

Exceptionally decent article, I appreciated perusing your post, extremely pleasant offer, I need to twit this to my adherents. Much appreciated!. voyance-tel-avenir.com

Avatar_small
ch 说:
2022年2月28日 00:31

Extraordinary Article it its truly useful and inventive update us as often as possible with new upgrades. its was truly important. much appreciated. easy slotxo

Avatar_small
ch 说:
2022年2月28日 05:29

Great site! I really cherish how it is simple on my eyes it is. I am considering how I may be informed at whatever point another post has been made. I have subscribed to your RSS which may do the trap? Have an incredible day! สล็อต 168 เครดิตฟรี

Avatar_small
ch 说:
2022年3月04日 04:03

I read that Post and got it fine and useful. It would be ideal if you share more like that... สล็อต xo

Avatar_small
amelia 说:
2022年5月08日 03:41

The data you have posted is exceptionally helpful. The destinations you have alluded was great. A debt of gratitude is in order for sharing.. Spring Lawn Service

Avatar_small
amelia 说:
2022年5月19日 00:12

I might want to say this online journal truly persuaded me to do it! Much appreciated, great post. สล็อต888

Avatar_small
amelia 说:
2022年5月19日 19:03

If you don't mind share more like that. Elderly Care South Plainfield, NJ

Avatar_small
amelia 说:
2022年6月16日 04:27

A debt of gratitude is in order for offering this quality data to us. I truly delighted in perusing. Will without a doubt going to impart this URL to my companions. Altitude Sickness

Avatar_small
amelia 说:
2022年6月24日 01:28

Hi. I discovered your online journal utilizing msn. This is a to a great degree elegantly composed article. I will make certain to bookmark it and come back to peruse a greater amount of your helpful data. A debt of gratitude is in order for the post. I'll absolutely rebound. exterior landscape lighting

Avatar_small
amelia 说:
2022年6月26日 01:02

Totally awesome posting! Loads of valuable data and motivation, both of which we all need!Relay welcome your work. Plainfield Virtual Training


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter