Click here to Skip to main content
15,886,823 members
Articles / Desktop Programming / MFC

Embed Python in MFC Dialog

Rate me:
Please Sign up or sign in to vote.
4.85/5 (18 votes)
13 Mar 2010CPOL3 min read 60.2K   3.9K   66  
Demo to show use of Python Interpreter to evaluate methematical expressions
#include <gtk/gtk.h>

#include <Python.h>

static PyObject * main_mod = NULL;	
static PyObject * main_dict = NULL;
static PyObject * obj = NULL;

void
on_helpbutton1_clicked                 (GtkButton       *button,
                                        gpointer         user_data);

void
on_applybutton1_clicked                (GtkButton       *button,
                                        gpointer         user_data);

void
on_okbutton1_clicked                   (GtkButton       *button,
                                        gpointer         user_data);

gboolean
spinbutton_eval_expr                   (GtkWidget       *widget,
                                        GdkEventFocus   *event,
                                        gpointer         user_data);

void
on_Dialog_realize                      (GtkWidget       *widget,
                                        gpointer         user_data);

gboolean
on_Dialog_destroy_event                (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data);


gboolean
spinbutton_key_press_event         (GtkWidget       *widget,
                                        GdkEventKey     *event,
                                        gpointer         user_data);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager Mahindra & Mahindra
India India
Sharjith is a Mechanical Engineer with strong passion for Automobiles, Aircrafts and Software development.

Comments and Discussions