Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Looking For Help With Glade
spiroth10
post Jul 29 2004, 11:40 PM
Post #1


Grub-er
**

Group: Members
Posts: 32
Joined: 21-February 04
Member No.: 2,431



well, my linux isnt working now, but I need help anyway. I can build the progs and everything, but one small thing: how do you call a function when a button is pressed???

its very different from any of the other RADs Ive used... I designed an interface, but I cant figure out how to do an if() statement (Im using c, not c++... not a c++ fan really) to call what happens when a button is pressed, making it virtually useless for me... sad.gif

in last (windows) rad (the only free one ive found), its something like if(hwndCtl_Nameoffunction){}
where name of function you put button1 or whatever else. Im pretty sure its similar, and once i get it, I can easily develop applications using it.
Go to the top of the page
 
+Quote Post
Hemant
post Jul 30 2004, 04:35 AM
Post #2


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



It is really simple..
There are two approaches for doing GTK programming using glade.
1.Start glade...create the interface.And connect the callbacks(just a loose call..you will have to write the whole function by hand).For creating callbacks for a button.add button to your interface.and then in the property window look for tab called "signal".and click on the ellipsis button for getting an event for the button click.the event is called "clicked".now a optional callback will be associated with that event.just save the glade file..and click on the "build" button.
So all the sources will be created for you.Now look for a file called callbacks.c and there your callback will be defined.you can write your code there.this code will be executed when the button will be clicked.
2.The other way is almost same till creating the interface.But don't click the build button.Just save the project as a .glade file.Now open a main.c file...use libglade file for adding the .glade file.for details of this procedure...checkout /usr/share/gtk-doc/libglade.
This method is considered more powerful and most of the huge gnome projects are created using this method only.


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 04:04 AM