LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-14-2011, 06:13 PM   #1
kline
Member
 
Registered: Aug 2008
Location: Seattle
Distribution: Ubuntu
Posts: 79

Rep: Reputation: 0
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?

thanks in advance.
 
Old 08-14-2011, 06:29 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
  1. Do you have a GUI written in GTK+ already?
  2. Do you know C?
  3. Do you know what parts of the python code are using bindings for GTK+?
Kevin Barry
 
Old 08-14-2011, 07:49 PM   #3
kline
Member
 
Registered: Aug 2008
Location: Seattle
Distribution: Ubuntu
Posts: 79

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ta0kira View Post
  1. Do you have a GUI written in GTK+ already?
  2. Do you know C?
  3. 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.
 
Old 08-14-2011, 08:06 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
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
 
Old 08-15-2011, 12:02 PM   #5
kline
Member
 
Registered: Aug 2008
Location: Seattle
Distribution: Ubuntu
Posts: 79

Original Poster
Rep: Reputation: 0
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.
 
Old 08-15-2011, 12:05 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by kline View Post
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.
Maybe search the web for

gtk+ tutorial
.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK library to integrate the cube and other 3D window geometry Kenny_Strawn Programming 6 03-13-2010 01:11 PM
how do i integrate a browser in my program eublade Programming 4 02-11-2008 05:18 AM
mysql integrate syslog-ng program error raiux Programming 2 11-04-2007 05:02 AM
Gtk-Warning but program still works... I close konsole, program closes Laptop2250 Linux - Software 2 11-14-2003 11:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration