Re: Question about defining own signals

2005-04-16 Thread Murray Cumming
On Sat, 2005-04-16 at 16:03 +0200, Matthias Kaeppler wrote:
 Hello,
 
 I want my gtkmm widget to have own signals.
 Now I thought it'd be better to use the Glib::SignalProxy templates 
 instead of raw sigc signals,

No, there's no reason to do that. They are for wrapping glib signals.
Please see the libsigc++ documentation, or the gtkmm book, about how to
do this.

-- 
Murray Cumming
[EMAIL PROTECTED]
www.murrayc.com
www.openismus.com

___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


No way of removing elements from a ComboBox?

2005-04-16 Thread Matthias Kaeppler
Hello,
since the ComboBox classes don't define any function for clearing them 
or removing single elements, I searched on the web, and found this post:

quote
We should add a method for this to GtkComboBoxText in gtkmm 2.5/2.6, so
that this is not necessary. I think I already added a TODO to the .hg
file.
But you don't _need_ this now. Remember that GtkComboBoxText is just a
convenience class, so that you don't need to define the GtkTreeModel and
assign a model column to a cell renderer. Likewise, functions such as
gtk_combo_box_remove_text() are just convenience functions.
/quote
I am adding entries to a combobox quite often in my program. Does that 
means there is no limit on how many entries can be added? How is this 
handled? Can it overflow or so?

--
Matthias Kaeppler
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: Displaying simple HTML in gtkmm app (got it!)

2005-04-16 Thread John Taber
On Friday 15 April 2005 09:46, [EMAIL PROTECTED] wrote:
 OK, so I got it working now.  It's pretty much a hack job, but it'll get me
 by for now.

Erik,
thks for the post - using gtkhtml will be really useful for some of us.  I'm 
trying to get this working in a small demo program but struggling:
1) which libs did you include when you compiled?
2) still not sure how you combined the simple c program under gtkmm - could 
you post the complete code listing (or email it).  thks


 I've declared a class gtkhtml, which is a sub class of Gtk::ScrolledWindow.


 In this code module, I just include the simple.c source code file like so:
 extern C
 {
 # include simple.c
 };

 And make sure to either remove or commnet out the int main( int argc,
 char** argv) code

 Below is the class' CTOR:

 gtkhtml::gtkhtml( void )

  : ScrolledWindow()

 {
  // Set properties
  g_object_set( G_OBJECT( gtk_html_context_get () ), debug_painting,
 FALSE, NULL);

  // Create the document
  document = html_document_new();

  g_signal_connect( G_OBJECT( document ), request_url, G_CALLBACK(
 url_requested ), NULL );
  g_signal_connect( G_OBJECT( document ), link_clicked, G_CALLBACK(
 link_clicked ),  NULL );

  // And the view
  view = html_view_new();
  html_view_set_document( HTML_VIEW( view ), document );

  g_signal_connect( G_OBJECT( view ), request_object, G_CALLBACK(
 request_object ), NULL );

  // ScrolledWindow that's hosting is already created.

  // Now wrap and add the Gtkhtml widget to the ScrolledWindow
  Gtk::Widget*   GtkmmView = Glib::wrap( view );

  add( *GtkmmView );
  GtkmmView-show();
 }

 And finally, is the LoadFile method, where you can load a file from local
 disk and display it in the ScrolledWindow.

 void gtkhtml::LoadFile( char* Filename )
 {
  load_file( Filename );
 }


 The only other thing is that I had to hack the
 /usr/include/gtkhtml-2.0/libgtkhtml/css/cssstylesheet.h header file, 'cause
 the structure below had a field called 'class', which g++ didn't like, so I
 renamed it '_class':

 struct _CssTail {
  CssTailType type;

  union {
   struct {
HtmlAtom att;
CssAttrMatch match;
CssAttrVal val;
   } attr_sel;
   struct {
HtmlAtom id;
   } id_sel;
   struct {
HtmlAtom _class;
   } class_sel;
   struct {
HtmlAtom name;
   } pseudo_sel;
  } t;
 };

 ___
 gtkmm-list mailing list
 gtkmm-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtkmm-list
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list