Skip to content

Instantly share code, notes, and snippets.

View zedtux's full-sized avatar

Guillaume Hain zedtux

View GitHub Profile
@zedtux
zedtux / .gitconfig
Created January 22, 2013 10:30
That gist -- after having added to your ~/.gitconfig file as described -- will show a warning message if you have more than 1 stash. That help me to not forgot them and be lost later.
[alias]
st = "!git_stash_check; git status"
@zedtux
zedtux / main.cpp
Last active January 2, 2016 23:59
Créer simplement une interface GTK en C++ - main.cpp
//~ Pour accéder au std::cerr
#include <iostream>
//~ Dépendances GTKmm
#include <gtkmm/main.h>
#include <libglademm.h>
int main( int argc, char * argv[] )
{
//~Pointeur sur le fichier glade
@zedtux
zedtux / hello.h
Created January 12, 2014 02:41
Créer simplement une interface GTK en C++ - hello.h
#ifndef HELLO_H
#define HELLO_H
#include <iostream>
#include <gtkmm.h>
#include <libglademm.h>
//~ Déclaration de la class de notre objet Hello, héritant de Gtk::Window
class Hello : public Gtk::Window
{
@zedtux
zedtux / hello.cpp
Created January 12, 2014 02:42
Créer simplement une interface GTK en C++ - hello.cpp
#include “hello.h”
//~ Ici notre constructeur un peu particulier.
Hello::Hello(BaseObjectType* cobject, const Glib::RefPtr& refGlade)
: Gtk::Window(cobject),
RefXmlGlade(refGlade)
{
}
Hello::~Hello()
@zedtux
zedtux / main.cpp
Created January 12, 2014 02:43
Créer simplement une interface GTK en C++ - Mise a jour du main.cpp
//~ Créer un pointeur windowHello sur l’élément window1 du fichier glade
RefXmlGlade->get_widget_derived(“window1″, windowHello);
if( windowHello )
{
//~ Ici la fenêtre est dessiné par GTK, et fonctionnelle.
kit.run(*windowHello);
//~ La ligne précédente est bloquante. Le curseur d’execution arrive
//~ ici qu’une fois la fenêtre détruite par GTK.
//~ Donc on libère la mémoire
@zedtux
zedtux / hello.h
Created January 12, 2014 02:43
Créer simplement une interface GTK en C++ - Mise a jour du hello.h
#ifndef HELLO_H
#define HELLO_H
#include <iostream>
#include <gtkmm.h>
#include <libglademm.h>
class Hello : public Gtk::Window
{
public:
@zedtux
zedtux / hello.cpp
Created January 12, 2014 02:44
Créer simplement une interface GTK en C++ - Mise a jour du hello.cpp
#include “hello.h”
Hello::Hello(BaseObjectType* cobject, const Glib::RefPtr& refGlade)
: Gtk::Window(cobject),
m_refXmlGlade(refGlade),
m_buttonQuit(0)
{
//~ On pointe, dans le fichier glade, sur le bouton “button1″
m_refXmlGlade->get_widget(“button1″, m_buttonQuit);
if ( m_buttonQuit )
@zedtux
zedtux / hello.cpp
Last active January 2, 2016 23:59
Créer simplement une interface GTK en C++ - Mise a jour du hello.cpp 2
#include “hello.h”
//~ Ici j’ai ajouté le bouton, le label et la boite de text en initialization à 0
Hello::Hello(BaseObjectType* cobject, const Glib::RefPtr& refGlade)
: Gtk::Window(cobject),
m_refXmlGlade(refGlade),
m_buttonQuit(0),
m_buttonApply(0),
m_entryName(0),
m_labelName(0)
@zedtux
zedtux / Makefile
Created January 12, 2014 12:05
Continuous Integration en C++ avec Hudson - Makefile
CC=g++
CFLAGS=-ansi -pedantic -Wall -c -W
OTHERCFLAGS=
LDFLAGS=
OBJ=classa.o classb.o main.o
INSTALL=/usr/bin/install -c
BINDIR=/usr/local/bin
EXEC=appName
@zedtux
zedtux / main.cpp
Created January 12, 2014 17:10
C++: Créer des logs - Créer un premier log !
#include
// include log4cxx header files.
#include "log4cxx/logger.h"
#include "log4cxx/basicconfigurator.h"
#include "log4cxx/propertyconfigurator.h"
#include "log4cxx/helpers/exception.h"
using namespace log4cxx;
using namespace log4cxx::helpers;