Skip to content

Instantly share code, notes, and snippets.

@ngnguyen1
Created July 9, 2012 19:15
Show Gist options
  • Save ngnguyen1/3078316 to your computer and use it in GitHub Desktop.
Save ngnguyen1/3078316 to your computer and use it in GitHub Desktop.
note
- create new repository named repositoryname
- Then, on client, create new forder named repositoryname
- move to the folder and initialize git by command: git init
- create new file README
- add new file or folder by git add foldername(filename)
- git commit -m 'The first commit' to comment for file or folder
- create new connection to git server by command: "git remote add connection_name https://github.com/username/repositoryname.git" or [email protected]:username/repositoryname.git
- then push on git server by command: git push -u connection_name master
- if get error Permission denied(publickey), you can:
- check that you are connecting to correct server by command: ssh -vT [email protected]
- Don't connect to "[email protected]"
- make sure you have a key and ssh using it. by command: "ssh-add -l", if it does not print anything, you need to add your key to SSH by running command: "ssh-add path/to/key ." Example, ssh-add ~/.ssh/rsa-file
The first step
-install package: libgtk2.0-dev
To compile GTK+ application, we have a handy tool called is pkg-config. The pkg-config program retrieves infomation about package from special metadata file.
pkg-config --cflags gtk+-2.0 will list show all necessary include file for GTK+ programming.
pkg-config --lib gtk+-2.0 will list show all the necessary library.
The first line: gtk_init(&argc, &argv) will initiate the GTK+ library. This line will call function gtk_init(gint *argc, char **argv). This sets up a few things for us such as the default visual and color map and then proceeds to call gdk_init(gint *argc, gchar ***argv). This function initializes the library for use, sets up default signal handlers, and checks the arguments passed to your application on the command line.
About hbox (horizontal box) and vbox (vertical box).
gtk_hbox_new (gint homogeneous,
gint spacing)
The homogeneous argument to gtk_hbox_new (the same for gtk_vbox_new) control whether is object in the box has the same size.
window = gtk_window_new (GTK_WINDOW_TOPLEVL). The GTK_WINDOW_TOPLEVEL argument specifies that we want the window to undergo window manager decoration and placement.
The gtk_widget_show() function lets GTK know that we are done setting the attributes of this widget, and that it can display it
gtk_window_set_title(GtkWindow*, const gchar*) is function will set a window title.
gtk_window_set_default_size(GtkWindow*, gint width, gint height) is functions set size of the window.
There are two ways to create a button. You can use the gtk_button_new_with_label() to create a button with a label, or you can use the gtk_button_new () to create a blank button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment