gnomemm r1686 - in libglademm/trunk: . examples/basic_from_buffer
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1686 - in libglademm/trunk: . examples/basic_from_buffer
- Date: Tue, 19 Aug 2008 11:31:48 +0000 (UTC)
Author: murrayc
Date: Tue Aug 19 11:31:47 2008
New Revision: 1686
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1686&view=rev
Log:
2008-08-19 Murray Cumming <murrayc murrayc com>
* configure.in:
* examples/basic_from_buffer/Makefile.am:
* examples/basic_from_buffer/basic_from_buffer.cc:
Added an example using create_from_buffer().
Added:
libglademm/trunk/examples/basic_from_buffer/basic_from_buffer.cc
- copied, changed from r1685, /libglademm/trunk/examples/basic_from_buffer/basic.cc
Removed:
libglademm/trunk/examples/basic_from_buffer/basic.cc
Modified:
libglademm/trunk/ChangeLog
libglademm/trunk/configure.in
libglademm/trunk/examples/basic_from_buffer/Makefile.am
Modified: libglademm/trunk/configure.in
==============================================================================
--- libglademm/trunk/configure.in (original)
+++ libglademm/trunk/configure.in Tue Aug 19 11:31:47 2008
@@ -220,6 +220,7 @@
examples/Makefile
examples/basic/Makefile
+ examples/basic_from_buffer/Makefile
examples/derived/Makefile
examples/menus/Makefile
examples/variablesmap/Makefile
Modified: libglademm/trunk/examples/basic_from_buffer/Makefile.am
==============================================================================
--- libglademm/trunk/examples/basic_from_buffer/Makefile.am (original)
+++ libglademm/trunk/examples/basic_from_buffer/Makefile.am Tue Aug 19 11:31:47 2008
@@ -1,6 +1,6 @@
include $(top_srcdir)/examples/Makefile.am_fragment
#Build the executable, but don't install it.
-noinst_PROGRAMS = basic
-basic_SOURCES = basic_from_buffer.cc
+noinst_PROGRAMS = basic_from_buffer
+basic_from_buffer_SOURCES = basic_from_buffer.cc
Copied: libglademm/trunk/examples/basic_from_buffer/basic_from_buffer.cc (from r1685, /libglademm/trunk/examples/basic_from_buffer/basic.cc)
==============================================================================
--- /libglademm/trunk/examples/basic_from_buffer/basic.cc (original)
+++ libglademm/trunk/examples/basic_from_buffer/basic_from_buffer.cc Tue Aug 19 11:31:47 2008
@@ -2,6 +2,82 @@
#include <gtkmm.h>
#include <iostream>
+const gchar buffer[] =
+ "<?xml version=\"1.0\" standalone=\"no\"?> <!--*- mode: xml -*-->"
+ "<!DOCTYPE glade-interface SYSTEM \"http://glade.gnome.org/glade-2.0.dtd\">"
+ ""
+ "<glade-interface>"
+ ""
+ "<widget class=\"GtkDialog\" id=\"DialogBasic\">"
+ " <property name=\"title\" translatable=\"yes\">basic libglademm example</property>"
+ " <property name=\"type\">GTK_WINDOW_TOPLEVEL</property>"
+ " <property name=\"window_position\">GTK_WIN_POS_NONE</property>"
+ " <property name=\"modal\">False</property>"
+ " <property name=\"resizable\">True</property>"
+ " <property name=\"destroy_with_parent\">False</property>"
+ " <property name=\"has_separator\">True</property>"
+ ""
+ " <child internal-child=\"vbox\">"
+ " <widget class=\"GtkVBox\" id=\"dialog-vbox2\">"
+ " <property name=\"border_width\">2</property>"
+ " <property name=\"visible\">True</property>"
+ " <property name=\"homogeneous\">False</property>"
+ " <property name=\"spacing\">0</property>"
+ ""
+ " <child internal-child=\"action_area\">"
+ " <widget class=\"GtkHButtonBox\" id=\"dialog-action_area2\">"
+ " <property name=\"border_width\">5</property>"
+ " <property name=\"visible\">True</property>"
+ " <property name=\"layout_style\">GTK_BUTTONBOX_END</property>"
+ " <property name=\"spacing\">10</property>"
+ ""
+ " <child>"
+ " <widget class=\"GtkButton\" id=\"quit_button\">"
+ " <property name=\"visible\">True</property>"
+ " <property name=\"can_default\">True</property>"
+ " <property name=\"can_focus\">True</property>"
+ " <property name=\"label\">gtk-quit</property>"
+ " <property name=\"use_stock\">True</property>"
+ " <property name=\"relief\">GTK_RELIEF_NORMAL</property>"
+ " <property name=\"response_id\">0</property>"
+ " </widget>"
+ " </child>"
+ " </widget>"
+ " <packing>"
+ " <property name=\"padding\">0</property>"
+ " <property name=\"expand\">False</property>"
+ " <property name=\"fill\">True</property>"
+ " <property name=\"pack_type\">GTK_PACK_END</property>"
+ " </packing>"
+ " </child>"
+ ""
+ " <child>"
+ " <widget class=\"GtkLabel\" id=\"label1\">"
+ " <property name=\"visible\">True</property>"
+ " <property name=\"label\" translatable=\"yes\">This is a basic libglademm example</property>"
+ " <property name=\"use_underline\">False</property>"
+ " <property name=\"use_markup\">False</property>"
+ " <property name=\"justify\">GTK_JUSTIFY_LEFT</property>"
+ " <property name=\"wrap\">False</property>"
+ " <property name=\"selectable\">False</property>"
+ " <property name=\"xalign\">0.5</property>"
+ " <property name=\"yalign\">0.5</property>"
+ " <property name=\"xpad\">0</property>"
+ " <property name=\"ypad\">0</property>"
+ " </widget>"
+ " <packing>"
+ " <property name=\"padding\">0</property>"
+ " <property name=\"expand\">False</property>"
+ " <property name=\"fill\">False</property>"
+ " </packing>"
+ " </child>"
+ " </widget>"
+ " </child>"
+ "</widget>"
+ ""
+ "</glade-interface>";
+
+
Gtk::Dialog* pDialog = 0;
void on_button_clicked()
@@ -19,7 +95,7 @@
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- refXml = Gnome::Glade::Xml::create("basic.glade");
+ refXml = Gnome::Glade::Xml::create_from_buffer(buffer, sizeof(buffer));
}
catch(const Gnome::Glade::XmlError& ex)
{
@@ -28,7 +104,7 @@
}
#else
std::auto_ptr<Gnome::Glade::XmlError> error;
- refXml = Gnome::Glade::Xml::create("basic.glade", "", "", error);
+ refXml = Gnome::Glade::Xml::create_from_buffer(buffer, sizeof(buffer), "", "", error);
if(error.get())
{
std::cerr << error->what() << std::endl;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]