GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 02, 2014 11:38 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: GPIO button in GTK+2.0 GUI
PostPosted: Sat Nov 16, 2013 12:41 am 
Offline

Joined: Thu Nov 14, 2013 4:34 pm
Posts: 3
Anyone know how to access the GPIO pin in a high level language, such as C language, GUI button in GTK+2.0? Im using beaglebone, trying to design button in GTK+ to turn on GPIO, wonder how to assign the g_signal to button?

Thanks.


Top
 Profile  
 
 Post subject: Re: GPIO button in GTK+2.0 GUI
PostPosted: Sat Nov 16, 2013 12:05 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hello,

GPIO would normally be accessed using a library or device driver and you will need to look at the documentation of your particular hardware.

Are you sure that you are using GTK+ v2.0, as this is very old. If you can say what experience you have of GTK and which version you are using I can then point you in the right direction.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GPIO button in GTK+2.0 GUI
PostPosted: Mon Nov 18, 2013 5:23 am 
Offline

Joined: Thu Nov 14, 2013 4:34 pm
Posts: 3
Hi,

Im using gtk+ 2.0. running on Virtual Machine Box, Fedora 17. The GUI displaying properly on VM, just haven't assigned GPIO signal.

However, when running my source code on beaglebone, the GUI keep refreshing (swapping between desktop background and GUI window every second).

Any idea what is going on?


Top
 Profile  
 
 Post subject: Re: GPIO button in GTK+2.0 GUI
PostPosted: Mon Nov 18, 2013 12:01 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Gtk v2.0 is over 10 years old, I expect you are confusing the number with what you use to compile the application. You can get you actual version by entering this command on a terminal.
Code:
pkg-config --modversion gtk+-2.0

I do not know anything about the beaglebone except that it is an ARM based board and since I also do not know what your source code is doing it is impossible to say what your problem is with the odd display.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GPIO button in GTK+2.0 GUI
PostPosted: Wed Nov 20, 2013 3:16 am 
Offline

Joined: Thu Nov 14, 2013 4:34 pm
Posts: 3
Hi,
Thanks for info.

The odd display occurs due to packing table>scroll_window>dialog box.
after removed the scroll window and dialog box it works fine.

Meanwhile, im trying to set text size in GTK+-2.0, but I cant find any example/tutorial, only manage to set text color fg...


Top
 Profile  
 
 Post subject: Re: GPIO button in GTK+2.0 GUI
PostPosted: Thu Nov 21, 2013 9:24 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Which widget are you trying to change the font size in? There are differences in how you do this depending on which one is being used. In a number of cases you would use
Code:
void                gtk_widget_modify_font              (GtkWidget *widget,
                                                         PangoFontDescription *font_desc);
but for some more specialised widget such as GtkTextView you would use more specific functions.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GPIO button in GTK+2.0 GUI
PostPosted: Thu Nov 28, 2013 9:06 pm 
Offline
Familiar Face

Joined: Wed Jul 03, 2013 4:52 am
Posts: 9
One of the ways of accessing GPIO on a BBB
http://derekmolloy.ie/gpios-on-the-beaglebone-black-using-device-tree-overlays/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group