开发者

How to set in glade an action for a button?

开发者 https://www.devze.com 2022-12-31 04:08 出处:网络
I\'m using glade to designa a interface for my program written in C but I have some problem with the buttons.

I'm using glade to designa a interface for my program written in C but I have some problem with the buttons.

Can someone explain me how to set in glade an action for a button?

I mean, I wrote a function in my code but I don't know how to associate it to the graphic... I set i the Signal box the GtkButton activate and I chose "on_button_activate" and in "user开发者_如何学Python data" I put the name of my function but when I compile it this is the terminal answer:

chris@chris-laptop:~/Scrivania$ ./provaGrafica 

(provaGrafica:3139): Gtk-WARNING **: Could not lookup object funzione_esporta on signal activate of object button4

(provaGrafica:3139): Gtk-WARNING **: Could not find signal handler 'on_button4_activate'
chris@chris-laptop:~/Scrivania$

and obviously the button does not work


In Glade, select your button, then under the 'General' tab go to 'Related Action' and choose an action from the list if it is already there otherwise select 'New' to create one.

Normally you would set 'Use Action Appearance' to 'Yes'.

The created action, by default would be at the toplevel. Select it and modify the attributes accordingly to your needs and setup a signal handler (Signals tab) for which you will have to connect to in your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消