glade3使用回调函数

假设要给window的destroy信号连接一个名为on_window_destroy的回调函数。

直接在glade3中的“操作句柄”设置回调函数“on_window_destroy”,若通过

gcc -o 目标程序名 源文件名.c `pkg-config --cflags --libs libglade-2.0`

编译可以通过,但运行是会发生

Gtk-WARNING **: Could not find signal handler '回调函数名称'

这样的错误。

需要使用

gcc -o 目标程序名 源文件名.c `pkg-config --cflags --libs libglade-2.0` -export-dynamic

来编译才可以正确执行。

点击“帮助”——“关于”菜单时弹出“关于”对话框,就是利用对菜单的activate设置回调函数来实现的。如下图:

  • Share/Bookmark

Previous Next

10 Comments (+add yours?)

  1. 阿邙
    七 19, 2010 @ 08:04:06

    ChromePlus 1.4.0.0 ChromePlus 1.4.0.0 Windows 7 Windows 7

    高深了很多哇

    给评论打分: Thumb up 0 Thumb down 0

    回复

  2. 丕子
    七 18, 2010 @ 21:35:03

    Firefox 3.6.6 Firefox 3.6.6 Windows XP Windows XP

    windows编程 最近很少用

    给评论打分: Thumb up 0 Thumb down 0

    回复

    • 婉秋
      七 18, 2010 @ 21:46:22

      Firefox 3.6.6 Firefox 3.6.6 Ubuntu 10.04 Ubuntu 10.04

      这不是Windows,是Linux~~~ :lol:

      给评论打分: Thumb up 0 Thumb down 0

      回复

  3. 天天天蓝
    七 18, 2010 @ 20:21:59

    Google Chrome 6.0.408.1 Google Chrome 6.0.408.1 Windows XP Windows XP

    女孩子对枯燥的代码感兴趣的不多啊,这个程序界面很像DELPHI开发的记事本,以前我们还做过

    给评论打分: Thumb up 0 Thumb down 0

    回复

    • 婉秋
      七 18, 2010 @ 20:43:28

      Firefox 3.6.6 Firefox 3.6.6 Ubuntu 10.04 Ubuntu 10.04

      呵呵,我也是想做一个记事本。
      Delphi我一个朋友她专业有学习,是可视化的……不太了解,只是翻了翻她的课本而已

      给评论打分: Thumb up 0 Thumb down 0

      回复

  4. 扯远了
    七 18, 2010 @ 19:32:00

    Google Chrome 6.0.466.0 Google Chrome 6.0.466.0 Windows 7 Windows 7

    最近老在做技术啊 8-O

    给评论打分: Thumb up 0 Thumb down 0

    回复

    • 婉秋
      七 18, 2010 @ 20:00:00

      Firefox 3.6.6 Firefox 3.6.6 Ubuntu 10.04 Ubuntu 10.04

      虽然我也不知道做这些有什么用,总比闲着要好吧。
      有些同学没有回家在实验室过暑假呢,想必他们开学后技术一定蛮厉害的了。
      既然没有去实验室也不能落后太多了,多少掌握点什么比较好

      给评论打分: Thumb up 0 Thumb down 0

      回复

  5. Feng
    七 18, 2010 @ 17:06:00

    Firefox 3.6.6 Firefox 3.6.6 Mac OS X 10.6 Mac OS X 10.6

    越来越高级了,坐个板凳吧 :-|

    给评论打分: Thumb up 0 Thumb down 0

    回复

    • 婉秋
      七 18, 2010 @ 20:00:30

      Firefox 3.6.6 Firefox 3.6.6 Ubuntu 10.04 Ubuntu 10.04

      嘿嘿

      给评论打分: Thumb up 0 Thumb down 0

      回复

  6. A.shun
    七 18, 2010 @ 16:55:30

    Opera 10.70 Opera 10.70 Windows XP Windows XP

    偶是来坐沙发的 :oops:

    给评论打分: Thumb up 0 Thumb down 0

    回复

Leave a Reply

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:

Switch to our mobile site