Can anybody show me how to integrate the gtk suite into a new program?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can anybody show me how to integrate the gtk suite into a new program?
A friend's python program uses the gtk stuff to make a very soft click when the user selects either the right or left mouse button. I know enough python to understand part of what is going on. Can anybody show me how to code a function in C that uses the gtk sound/click stuff so that every time I hit and release a key the click sounds?
Do you know what parts of the python code are using bindings for GTK+?
Kevin Barry
Fewer than 30 lines of my friend's 2500 lines are involved with the button/click handling.
My only use for a graphic would be to include that clicking was either on or off. His program lets the user click all three buttons as well as some miscellany with the lowest keys. No key-clicks on any of the keys; otherwise, my post wouldn't have been necessary.
Basically, I am trying to figure out how much of gtk I need to pull in.
It's still unclear the scope of the requirement. Is this for an existing C program? If so, does it have a GUI? What does the program do? Do you need GTK+ because it's currently the only library you know of to do this with, or is it for a GUI-related reason?
The simple answer is to figure out what GTK+ bindings are used in the python code, find the corresponding C functions in the GTK+ manual, intuit how they go together in C, and change the event being handled from "mouse click" to "key press". This obviously isn't very helpful, but I'm not sure the context of the task.
Kevin Barry
Thanks for your tip. My only non-work-related GUI hacking used an old library--Xaw[?], and before that Xlib. What I want to do is combine my existing daemon with the gnome toolkit to make every pressed key click. This would help the severely deficient keyboards like the Asus-EEE laptops that have hard to kit keys as well as low-end keyboards. And people who are physically disabled and who watch the keyboard and not the display. A click would confirm that I've hit the key.
I just got a new printer working and have the python code that my friend wrote. Now I can see what he did (with the mouse buttons) and translate that into key presses.
Thanks for your tip. My only non-work-related GUI hacking used an old library--Xaw[?], and before that Xlib. What I want to do is combine my existing daemon with the gnome toolkit to make every pressed key click. This would help the severely deficient keyboards like the Asus-EEE laptops that have hard to kit keys as well as low-end keyboards. And people who are physically disabled and who watch the keyboard and not the display. A click would confirm that I've hit the key.
I just got a new printer working and have the python code that my friend wrote. Now I can see what he did (with the mouse buttons) and translate that into key presses.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.