Skip to content

Instantly share code, notes, and snippets.

View carlos-jenkins's full-sized avatar

Carlos Jenkins carlos-jenkins

View GitHub Profile
@carlos-jenkins
carlos-jenkins / app.py
Created February 10, 2014 20:03
Example to set to a Gtk application a custom theme.
# -*- coding:utf-8 -*-
#
# Copyright (C) 2013 Carlos Jenkins <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@carlos-jenkins
carlos-jenkins / vg.c
Created February 7, 2014 23:17
Valgrind test program to demostrate memory access violation, memory leak or double free problems in a C program.
#include <stdlib.h>
#include <stdio.h>
// Compile with:
// gcc -std=c99 -g -Wall -O0 -o vg vg.c
// Run with:
// valgrind --leak-check=full ./vg [1|2|3]
int read_and_write(int* buff, int size, int seed)
{
@carlos-jenkins
carlos-jenkins / app.py
Created February 6, 2014 20:31
How to programatically add new menu items to menu item in PyGObject.
"""
Hierarchy is:
- GtkMenuBar
- GtkMenuItem
- GtkMenu
- GtkMenuItem
- GtkImageMenuItem
- GtkCheckMenuItem
- GtkRadioMenuItem
- GtkSeparatorMenuItem
@carlos-jenkins
carlos-jenkins / gui.glade
Created May 10, 2013 15:45
Conditional CellRenderer visibility to display different models in a TreeView.
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkTreeStore" id="treestore">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name catalog_num -->
<column type="gchararray"/>
<!-- column-name comment -->
@carlos-jenkins
carlos-jenkins / gui.glade
Last active June 29, 2021 08:33
My PyGObject template files for simple applications.
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window">
<property name="can_focus">False</property>
<property name="border_width">10</property>
<property name="title" translatable="yes">Ejemplo PyGtk</property>
<property name="window_position">center-always</property>
<property name="default_width">400</property>
<property name="default_height">300</property>
@carlos-jenkins
carlos-jenkins / loading.glade
Last active April 5, 2020 15:38
Simple example to use Gtk.ProgressBar with Python 2.7 and PyGObject.
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="wait">
<property name="can_focus">False</property>
<property name="border_width">10</property>
<property name="type">popup</property>
<property name="title" translatable="yes">Please wait...</property>
<property name="modal">True</property>
<property name="window_position">center-always</property>