Jump to content

array of buttons with GTK and c

- - - - -

  • Please log in to reply
1 reply to this topic

#1
restin84

restin84

    Learning Programmer

  • Members
  • PipPipPip
  • 53 posts
I am coding a program for an assignment in a course in c programming. We need to create a graphical interface using GTK. I need an array of 5 buttons and when each button is clicked it will run system("./some program done this semester");

I am not sure how to set up the array. I have a handle on most of the code but it is hard to find any tutorials on arrays of buttons/gtk/c

Just a little info on how to declare/use an array of buttons would be helpful.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I would start by just dealing with a single button:
GtkButton
Linux Headquarters: GtkButton – Basic Button Widget

Then, once you're comfortable with that, realize that an array of buttons could be either a literal (gktbutton*)[5] or it could be something more like this: Guitar Tuner
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users