Re: Cairo and gtkmm

2005-10-20 Thread John Taber

Murray Cumming wrote:

I remember some talk a while ago about Cairo and gtkmm.  Does anybody
know the status of this?  Will the cairo API be exposed in gtkmm
anytime soon?  Is there a timeframe for this sort of thing.



There isn't much to expose. I think there are 2 or 3 functions, such as
one to provide a cairo surface on which you can use cairo functions.
That will be wrapped faster if someone provides a patch.

An at some point we need to bless a cairo C++ API, if the C API is not
incredibly easy. I haven't looked at it yet and, and usual, I hope someone
else does it.



I've got Cairo working fine in c++, albeit another toolkit - I couldn't 
figure out the cairo surface hook in gtkmm, so we need a better gtkmm 
programmer to chip in here - but you're right, it shouldn't be too hard. 
 But it should get top priority - what is needed is a good example 
(either in the sample programs or in the tutorial).

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


Re: best way to use multiple windows

2005-07-18 Thread John Taber
Well, it is heap vs stack - I am not sure which is really better for 
normal gui applications.  But I have always created my dialogs as 
pointers - it just seems more traditional c++.


MyPopupDialog *dlg = new MyPopupDialog(...) {
//set dialog to modal (but it can sometimes get hidden by other
// dialog which is annoying
// set up dialog display here
// let okay/cancel buttons set return variable flag and hide dialog
onokaybutton() {
returnFlag = 1;
dlg-hide();
}
// if flag true can have code engine or main dialog still read
// values from popup dlg here
delete dlg;

I find it is not too difficult to match the delete with the new.


Armin Burgmeier wrote:

Hi,

my approach to this is to derive such windows from Gtk::Dialog and to
add two buttons with Gtk::RESPONSE_OK and Gtk::RESPONSE_CANCEL. To show
the dialog, simply do

MyDialog dialog(*this, foo, bar);
if(dialog.run() == Gtk::RESPONSE_OK)
{
  // Take settings into main app
}

Gtk::Dialog::run blocks in a main loop until the user closes the window
by either pressing one of the buttons or closing the window (which fits
perfectly if you want modal windows). After your function returns, the
dialog will be destroyed automatically as it runs out of scope, so you
do not have to worry about memory management.

 - Armin
___
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


Re: best way to use multiple windows

2005-07-18 Thread John Taber

Armin Burgmeier wrote:

John Taber wrote:


Well, it is heap vs stack - I am not sure which is really better for
normal gui applications.  But I have always created my dialogs as
pointers - it just seems more traditional c++.


Isn't that dangerous if exceptions are thrown? Why not let the compiler


Yeah, I think c++ in general is pretty dangerous:)  And I guess that's 
why there is java and C#.  I'm always open to better ideas.  Whatever is 
the fastest, simplest, cleanest.  We've always called all our widgets 
with pointers as well, since we've never really taken the time to figure 
out what the memory hit is, especially if there are a few layers of 
dialogs open as per the original question in the thread and not sure 
what happens if one of the widgets is a 500 mb image.  But your idea of 
the dialog container on stack but widgets on heap would be efficient if 
it doesn't cause other problems - and I guess you're saying gtkmm takes 
care of that.

John




do the dirty work? Remember that just the gtkmm instances like a
Gtk::Dialog are created on the stack, but they create their underlaying
GTK+ objects on the heap. This method seems to be the C++ way for me.

But if you like using dynamically allocated memory here, go on. I just
wanted to add another alternative how to display popup dialogs :)

 - Armin
___
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


Re: glademm

2005-07-08 Thread John Taber
Yeah, I call the whole gtkmm situation Anti-RAD which is okay if you 
do not have any time pressure or much GUI but unproductive/uncompetitive 
if you are in a commercial environment with a lot of GUI.  Check out 
Anjuta 2 with the glade plug-in - it is headed in the right direction, 
but seems a ways off for production use.


btw I've used all these toolkits.  Qt and FLTK have their advantages but 
are only what I call Semi-RAD.  Delphi and VisualStudio.Net are indeed 
very RAD but have their own limitations (no MVC separation, Windows 
only, not the nice layout manager).  Like many things Apple, XCode seems 
the way programming ought to be - but sadly it's only for Apple.


Of course real programmers say they are just as productive in vi but, 
in actuality, the overall resulting low productivity is why more and 
more coding is being offshored to low cost areas.  Until we have a 
gtkmm, with an enhanced Anjuta 2, with some UML like capabilities, with 
gtkmm wrapped gtk basic extras (like gtkhtml or mozembed), and with the 
nice documentation of XFC, well, pick your poison.



Foster, Gareth wrote:
It's an ordeal. You got to figure, if glademm hasn't been 


included in FC4 extras, there

must be a reason for that. The glademm project seems dead. 


I'm trying to

rally a few good men to give it a jump start. I can't 


imagine I'm the only

one left using glademm, and I can't do any gui programming 


without a gui

builder, and I insist in doing it in C++. If I can't get it 


to compile,

I'll have to move to qt or fltk. 







no your not the only one I'm the same




The question to ask yourself is, is libglademm relly that bad? I used to
work with Delphi, where code was generated for me and I filled in the stubs,
just like glademm, the slight change of mindset (glademm - libglademm) was
troublesome, but you just have to get stuck in and work the way the rest of
the Gnome community does (where they have good reason of course).

Try not to let sentiments such as well, I always worked that way on
Windows stop you from using gtk/glade.

It's the same story with IDE managed projects and Autotools really. Anyway,
it is from where I am sitting now, hopefully my experience of the transition
will be of value to you.

Gaz
___
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


Re: displaying html

2005-07-05 Thread John Taber

Bob,
thks for the info - no, I'm not having too much luck with gtkmozembedmm. 
 Until I find a way to make it work, I can use gtkhtml - what steps did 
you follow to get this working (I actually started to use gtkhtml but 
got stuck in the wrap functions and then was told gtkmozembed would be 
the better alternative).  Now this would make a good wiki article!

John

Bob Caryl wrote:

John Taber wrote:

When I try to compile the gtkmozembedmm package, I get an error of not 
finding gtkmozembed - is it looking for the gtk program version?  Has 
anyone got this working in gtkmm and can help me with what 
dependencies were required and any special steps?  thks.

John

 


snip

Hey John,

Yeah, gtkmozembemm is the C++ wrapper for gtkmozembed.  And yes, you 
must have the gtk version installed.  As you can see from the string of 
posts I made about gtkmozembedmm, I never got it to work, even when I 
did have gtkmozembed installed properly.  Its --cflags pkg-config 
results always pointed at a file that did not exist:



Running pkg-config --cflags gtkmozembedmm at the command line specifies
-I/opt/gnome/include/gtkmozembedmm-0.1 as it's first pre-processor
instruction.  Examination of the /opt/gnome/include/gtkmozembedmm-0.1
directory reveals that in the gtkmozembedmm subdirectory there is NO
gtkmozembedmm.h file, but rather another directory called private that
contains a file called gtkmozembedmm_p.h



My attempts to figure out to where it should point were feckless, as 
were my attempts to get any answers to this particular question from 
anyone on the list.  I ended up using GtkHTML instead.


I hope you end up having better luck than I did.

Bob Caryl



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


Re: displaying html

2005-07-03 Thread John Taber
When I try to compile the gtkmozembedmm package, I get an error of not finding 
gtkmozembed - is it looking for the gtk program version?  Has anyone got this 
working in gtkmm and can help me with what dependencies were required and any 
special steps?  thks.
John

On Monday 06 June 2005 09:09 am, Bob Caryl wrote:
 Alan wrote:
  One downloads gtkmozembedmm from here:
  http://ftp.linux.org.uk/mirrors/ftp.gnome.org/sources/gtkmozembedmm/1.4/
  (linked from the gtkmm website), and if you do 'make docs' it will
  generate documentation for you. gtkmozembedmm is a Gtkmm wrapper of
  the gtkmozembed C library.
 
  Alan.
 
  Foster, Gareth wrote:
 Ok, fair enough.  I have also tried to find documentation on mozembed
 with no palpable success.  Can you point me at that
 information?  I hate
 to sound like a whiner, but I spent a lot of time over last
 weekend, and
 all day yesterday looking for information on how to implement both
 solutions to little avail.
 
 I think you use the C widget, and there is a special call that lets you
  use an instance of it within the GTKmm framework (i.e hands it over to
  GTKmm to manage), unless somebody did a pucker mm wrapper since I tried
  it, it works well once you get it going anyway.
 
 Google for wrap C widget gtk or something? I have a sneaking feeling
  there are mozembed docs, I think they might be on the Mozilla site,
  along with the download and some rant about GTK+ hackers not wanting to
  use C++ and the history behind the widget :)
 
 Sorry I couldn't be more specific, hopefully you can narrow your google
  work down a bit with this - or just wait until somebody posts who used
  this more recently.
 
 Cheers mate,
 
 Gaz
 ___
 gtkmm-list mailing list
 gtkmm-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtkmm-list

 Hey everyone,

 Since I didn't have gtkmozembedmm installed at all, I took Alan's advice
 and downloaded the gtkmozembedmm-1.4.0 package and installed it.  All
 went without incident.  The docs and examples made it pretty clear as to
 what should happen and how to use gtkmozembedmm.

 However, I have encountered a strange problem:

 In my makefile, I am using `pkg-config --cflags gtkmozembedmm` and
 `pkg-config --libs gtkmozembedmm` in my compile and link lines
 respectively.  I get the following compiler complaint when I try to
 compile my test case:

 /opt/gnome/include/gtkmozembedmm-0.1/gtkmozembedmm.h:1:41:
 gtkmozembedmm/gtkmozembedmm.h: No such file or directory

 Running pkg-config --cflags gtkmozembedmm at the command line specifies
 -I/opt/gnome/include/gtkmozembedmm-0.1 as it's first pre-processor
 instruction.  Examination of the /opt/gnome/include/gtkmozembedmm-0.1
 directory reveals that in the gtkmozembedmm subdirectory there is NO
 gtkmozembedmm.h file, but rather another directory called private that
 contains a file called gtkmozembedmm_p.h

 Any clue as to what I may have missed here?

 Bob
 ___
 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


Re: gtkmm and gcc 4.0

2005-06-26 Thread John Taber
Thks for the info.  So, it sounds like my idea of waiting a bit before 
switching to 4.0 is a good one (unless one wants to do a lot of 
recompiling of gtkmm, dependencies, etc which in my case, I did not do 
and do not want to tackle right now).


As far as the dependencies go, I still think it is something that should 
be addressed. To some degree, Debian does this (it lists dependencies 
and goes thru somewhat a testing process, Ubuntu goes a step further by 
using a 6 mo cycle of packages somewhat tested to work together).  To me 
the best process would be to have a development studio or bundle so 
that every gtkmm version is tested with a known set of dependant 
libraries, ie gtkmm 2.8.0 might ship listed with gtk 2.8.1 and glib 
2.8.0 whatever.  Then if upgrades go wrong, there is a benchmark to fall 
back to.  In the current gtk 2.6.x series we have seen some changes go 
in, then get reverted out - did that affect the stability of gtkmm? 
Probably not, but it could.  Personally, that's the reason I would 
prefer static builds of gtkmm and our resulting programs, and though GPL 
licensing might be a problem, with disk space so cheap and available, 
who cares if the studio takes up 100 mb - let the compiler and program 
sort out only including what's needed.   Any agreement?


Roger Leigh wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris Vine [EMAIL PROTECTED] writes:



On Sunday 26 June 2005 12:15, Christian von Kietzell wrote:


Am Sonntag, den 26.06.2005, 04:45 -0600 schrieb John Taber:


My experiences trying out gcc 4.0 vs 3.3.5 with gtkmm 2.6.1
1) some dialog classes compile as 1/2 the size
2) most classes have the same nasty looking warning on shared libraries
3) linking has the warning that gtkmm wants to use libstdc++ so.5
instead of libstdc++ so.6 (running gcc 4.0.1 Debian unstable)
4) one of my key programs segfaults with 4.0 - runs fine with 3.3.5
(have not tracked down why yet)


Some problems are to be expected. In order to use GCC 4.0 all C++
libraries will have to be compiled using GCC 4.0, as 4.0 and 3.3.x are
using different ABI versions. Debian hasn't made the transition yet.


Are you sure about this?  They use different libstdc++ libraries but my 
understanding was the the C++ ABI was not broken between

gcc-3.3/3.4/4.0.



Changing libstdc++ does break the ABI.  Debian is currently using GCC
3.3 with libstdc++5.  We will, in a few weeks, switch to GCC 4.0 and
libstdc++6.  At this point all the C++ libraries will need to be
rebuilt, and these problems will go away.  It's not possible to use
multiple versions of libstdc++ in one program, so linking a library
built against libstdc++5 with a program built with GCC 4.x is going to
be dodgy.


Regards,
Roger

- -- 
Roger Leigh

Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
Debian GNU/Linuxhttp://www.debian.org/
GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 http://mailcrypt.sourceforge.net/

iD8DBQFCvp/UVcFcaSW/uEgRAjVhAKDvfK8/Hn4UzPHt+LkUQUIfBYGE/ACgyHyC
peeQhT6i+EwLwb7VXJ8Xt3Q=
=OLKb
-END PGP SIGNATURE-
___
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


Callback to parent dialog

2005-06-23 Thread John Taber

I've tried the following but it's not right. Can someone help out - thks.

Gtk::GtkWidget* toplevel = gtk_widget_get_toplevel(this);
if (GTK_WIDGET_TOPLEVEL (toplevel)) {
  toplevel-editDialog(data);
}

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


Re: Callback to parent dialog

2005-06-23 Thread John Taber
Still having some trouble (btw GtkWidget needs to be Gtk::Widget) - it 
doesn't like this, etc.  Wondering if it would be easier to just pass 
in a void pointer and then typecast it?


Nalin Singal wrote:

Maybe you need to do something like this:

GtkWidget* toplevel = gtk_widget_get_toplevel(this);
if(GTK_WIDGET_TOPLEVEL(toplevel)) {
  Gtk::GtkWidget* wrappedTL = wrap(topLevel, t/f);
  wrappedTL-editDialogWHATEVER);
}

There is a slight difference between gtk and gtkmm.
gtk objects can't be directly converted to gtkmm or
vice-versa. You need to call the wrap function to go
one way and gobj() function if you want to go the
other way.

-Nalin

--- John Taber [EMAIL PROTECTED] wrote:



I've tried the following but it's not right. Can
someone help out - thks.

Gtk::GtkWidget* toplevel =
gtk_widget_get_toplevel(this);
if (GTK_WIDGET_TOPLEVEL (toplevel)) {
  toplevel-editDialog(data);
}


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







__
How much free photo storage do you get? Store your friends 'n family snaps for 
FREE with Yahoo! Photos http://in.photos.yahoo.com



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


Re: Callback to parent dialog

2005-06-23 Thread John Taber
Thanks for info but I think I found an easier way by simply writing a 
small interface class to call back to the owner class.  Seems to work okay.


Nalin Singal wrote:

If you are writing this code in a Gtk::something class
or a class derived from one then you need to replace
this with this-gobj(). And GtkWidget is correct.
Gtk::Widget is a Gtkmm object which is actually a
class wrapped around the underlying GtkWidget.
gtk_widget_toplevel() returns a GtkWidget* NOT a
Gtk::Widget*.  Also gtk_widget_toplevel() takes a
GtkWidget* not a Gtk::Widget*. This is the reason for
replacing this. As someone else pointed out you are
mixing Gtk+ code and Gtkmm code (or C code and C++
code).
-Nalin

--- John Taber [EMAIL PROTECTED] wrote:



Still having some trouble (btw GtkWidget needs to be
Gtk::Widget) - it 
doesn't like this, etc.  Wondering if it would be
easier to just pass 
in a void pointer and then typecast it?


Nalin Singal wrote:


Maybe you need to do something like this:

GtkWidget* toplevel =


gtk_widget_get_toplevel(this);


if(GTK_WIDGET_TOPLEVEL(toplevel)) {
 Gtk::GtkWidget* wrappedTL = wrap(topLevel, t/f);
 wrappedTL-editDialogWHATEVER);
}

There is a slight difference between gtk and


gtkmm.


gtk objects can't be directly converted to gtkmm


or


vice-versa. You need to call the wrap function to


go


one way and gobj() function if you want to go the
other way.

-Nalin

--- John Taber [EMAIL PROTECTED] wrote:




I've tried the following but it's not right. Can
someone help out - thks.

Gtk::GtkWidget* toplevel =
gtk_widget_get_toplevel(this);
if (GTK_WIDGET_TOPLEVEL (toplevel)) {
 toplevel-editDialog(data);
}


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











__


How much free photo storage do you get? Store your


friends 'n family snaps for FREE with Yahoo! Photos
http://in.photos.yahoo.com











__
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com



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


weird behavior with TreeModel

2005-06-22 Thread John Taber

Has anyone else had problems with TreeModel?
1) If I try to append rows after using TreeModel.clear(), it segfaults.
2) If I try to define a column as reorderable - it does not compile but 
if I put it in a loop thru all the columns it compiles okay.
3) I'm getting weird behavior when using a table refresh function 
(setListToDisplay) - sometimes the view does not load the data, some 
times I get a glibmm memory error.


I'm running gtkmm 2.6.1 with gtk 2.6.4 with gcc 3.3.5 on debian sid

Here's excerpt of what I've been using - anything wrong in what I'm doing?

in .h file:
virtual void menuTreeOnClicked(const Gtk::TreeModel::Path path,
Gtk::TreeViewColumn* column);
//-- menu tree --
class ModelColumns : public Gtk::TreeModel::ColumnRecord {
public:
ModelColumns() {
add(id);
add(name);
}
Gtk::TreeModelColumnintid;
Gtk::TreeModelColumnstd::stringname;
};
ModelColumns menuColumns;
Gtk::ScrolledWindow menuWindow;
Gtk::TreeView menuTreeView;
Glib::RefPtrGtk::ListStore menuTreeModel;

in .cpp file
//-- menu tree  -
menuTreeModel = Gtk::ListStore::create(menuColumns);
menuTreeView.set_model(menuTreeModel);
//Gtk::TreeModel::Row row = *(menuTreeModel-append());
//row[menuColumns.id] = 0;
//row[menuColumns.name] = ;
menuTreeView.append_column(ID, menuColumns.id);
//(menuColumns.id).set_reorderable();
menuTreeView.append_column(Name, menuColumns.name);
for(int i=0;i2;i++) {
Gtk::TreeView::Column* mColumn = menuTreeView.get_column(i);
mColumn-set_reorderable();
}
menuWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
menuWindow.add(menuTreeView);
menuTreeView.signal_row_activated().connect(sigc::mem_fun(*this,
  LanduseListDialog::menuTreeOnClicked) );
.
void LanduseListDialog::setListToDisplay(std::vectorData*data) {
if (data.empty()) {return;}
//menuTreeModel.clear();
Gtk::TreeModel::Row row;
for (uint i=0;idata.size();i++) {
row = *(menuTreeModel-append());
row[menuColumns.id] = data[i]-getid();
row[menuColumns.name] = data[i]-getname();
}
}


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


Callback to parent dialog

2005-06-22 Thread John Taber

I've tried the following but it's not right. Can someone help out - thks.

Gtk::GtkWidget* toplevel = gtk_widget_get_toplevel(this);
if (GTK_WIDGET_TOPLEVEL (toplevel)) {
  toplevel-editDialog(data);
}


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


Re: weird behavior with TreeModel

2005-06-22 Thread John Taber

Thanks very much for the clear explanations.  It all makes sense now.

Nalin Singal wrote:

Sorry for breaking up the reply.

Regarding the reorderable columns. When you do
menuColumns.id.set_reorderable(), you are trying to
set the column in the treeModel as reoderable. But
actually the column in the treeView is the one which
should be reorderable. Remember there are two
different sets of columns - one in the treemodel and
one in the treeview which are backed up by the
treemodel columns. So the columns in the treeview are
the ones which can be reordered and not the ones in
the treemodel because reordering is just a view thing.
So as you are doing the for loop, get the column you
want to set as reorderable from the treeview and call
set_reorderable on it.

Hope this helps :)

-Nalin


--- John Taber [EMAIL PROTECTED] wrote:



Has anyone else had problems with TreeModel?
1) If I try to append rows after using
TreeModel.clear(), it segfaults.
2) If I try to define a column as reorderable - it
does not compile but 
if I put it in a loop thru all the columns it

compiles okay.
3) I'm getting weird behavior when using a table
refresh function 
(setListToDisplay) - sometimes the view does not
load the data, some 
times I get a glibmm memory error.


I'm running gtkmm 2.6.1 with gtk 2.6.4 with gcc
3.3.5 on debian sid

Here's excerpt of what I've been using - anything
wrong in what I'm doing?

in .h file:
virtual void menuTreeOnClicked(const
Gtk::TreeModel::Path path,
Gtk::TreeViewColumn* column);
//-- menu tree --
class ModelColumns : public
Gtk::TreeModel::ColumnRecord {
public:
ModelColumns() {
add(id);
add(name);
}
Gtk::TreeModelColumnintid;
Gtk::TreeModelColumnstd::stringname;
};
ModelColumns menuColumns;
Gtk::ScrolledWindow menuWindow;
Gtk::TreeView menuTreeView;
Glib::RefPtrGtk::ListStore menuTreeModel;

in .cpp file
//-- menu tree 
-

menuTreeModel =
Gtk::ListStore::create(menuColumns);
menuTreeView.set_model(menuTreeModel);
//Gtk::TreeModel::Row row =
*(menuTreeModel-append());
//row[menuColumns.id] = 0;
//row[menuColumns.name] = ;
menuTreeView.append_column(ID,
menuColumns.id);
//(menuColumns.id).set_reorderable();
menuTreeView.append_column(Name,
menuColumns.name);
for(int i=0;i2;i++) {
Gtk::TreeView::Column* mColumn =
menuTreeView.get_column(i);
mColumn-set_reorderable();
}
menuWindow.set_policy(Gtk::POLICY_AUTOMATIC,
Gtk::POLICY_AUTOMATIC);
menuWindow.add(menuTreeView);
   



menuTreeView.signal_row_activated().connect(sigc::mem_fun(*this,


  LanduseListDialog::menuTreeOnClicked) );
.
void



LanduseListDialog::setListToDisplay(std::vectorData*data)


{
if (data.empty()) {return;}
//menuTreeModel.clear();
Gtk::TreeModel::Row row;
for (uint i=0;idata.size();i++) {
row = *(menuTreeModel-append());
row[menuColumns.id] = data[i]-getid();
row[menuColumns.name] = data[i]-getname();
}
}


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







__
How much free photo storage do you get? Store your friends 'n family snaps for 
FREE with Yahoo! Photos http://in.photos.yahoo.com



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


gcc 4.0 and gtkmm

2005-06-17 Thread John Taber

Has anyone tried to use gcc 4.0 with gtkmm ?  Experiences?

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


Re: Using (or not using) sigc::mem_fun with the G_CALLBACK macro

2005-06-16 Thread John Taber
Paul,
thks for the code outline.  I have also been struggling with using a gtk 
widget in my gtkmm code.  Unless there is another demo somewhere that I have 
not seen, maybe this code could be cleaned up a bit with comments, etc to 
have a nice clear demo of a gtk widget being wrapped and instantiated and 
having it's signal picked up by a  gtkmm slot function.  This would be really 
useful and also make a great addition to the gtkmm tutorial.  
John

On Thursday 16 June 2005 05:50 am, Paul Davis wrote:
 On Thu, 2005-06-16 at 06:08 -0500, Bob Caryl wrote:
  Murray Cumming wrote:
  And if you must provided a C function pointer, you'll need to provide a
  pointer to a static method (or global function) and the state
  information as user_data. See the various SignalProxy classes, for
  instance, in TreeSelection.
 
  In other words, the way I've done it (separate executable invoked via
  fork, execv) is the only thread safe way to do this until GtkHTML has a
  C++ wrapper.

 what are you thinking? this has nothing to do with threads. it doesn't
 even have a *lot* to do with language, except for the fact that you
 can't use a non-static C++ member function as a C callback. if you
 really want to use C++ objects with GTK widgets, then do this:

   class Foo {
 public:
  static gint my_c_proxy_for_bar (arglist...);
  gint my_handler_for_bar (otherarglist...);
 };

   gint
 Foo::my_c_proxy_for_bar (..., gptr user_data, ...)
 {
   return reinterpret_castFoo*(user_data)-my_handler_for_bar
 (relevant_args...);
   }

   gint
   Foo::my_handler_for_bar (otherarglist...)
   {
   }

 and then somewhere, connect

   gtk_signal_connect (widget, signal, , SomePtrToFoo);

 I have done this a lot with the GtkCanvas widget which has never been
 wrapped for C++ (and never will be; we're migrating to GNOME::Canvas
 ASAP)

 --p


 ___
 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


What is gtkmm default font and size?

2005-06-07 Thread John Taber
When a gtkmm program (and any gtk program for that matter) runs under Gnome, 
the fonts are nice, but when it is run under KDE, the fonts are terrible - 
what font and size does gtkmm default to?  I would assume this is best 
addressed from the user settings (in KDE the Control Center allows user to 
select font and size for various types).  
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


how do I catch double clicks

2005-06-03 Thread John Taber
How do I catch a mouse double click?  I couldn't find any class documentation 
on GdkEventButton and the associated event-type enums  and 
event-type==GDK_MOUSE_DOUBLE_PRESS did not work.  thks.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


menu popup as real tiny

2005-06-01 Thread John Taber
I've created a simple menu popup over an eventbox just like the tutorial but 
when I right-click the menu appears as a tiny 1 mm box even though it has a 
menuitem with a label of Resize.  Could it be related to the eventbox 
containing an image ?  Anyone experienced this or have ideas how to fix ?   
thks.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: displaying html

2005-05-31 Thread John Taber
Not that I know - it is a real missing component.  However, about a month ago 
someone posted some comments about how he wrapped the C version of gtkhtml - 
you might search for it Displaying simple HTML... - I just have not had the 
time to work with the code pieces - maybe it can be turned into a 
well-documented how-to.  gtkhtml handles basic html - it is used by 
Evolution.  The other approach is to use mozembed - probably a more complete 
browser but that too needs to be wrapped and requires all the mozilla libs to 
be included.  
John

On Tuesday 31 May 2005 09:04 am, Bob Caryl wrote:
 Even I have not found anything as yet, I was wondering if gtkmm had
 wrapped anything for displaying html?

 Thanks,
 Bob Caryl
 ___
 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


Re: std::function ?

2005-05-11 Thread John Taber
Thks for keeping us abreast.  Gtkmm is all about C++ and to me, the C++ 
committee is totally missing the big picture, which limits gtkmm.  Whether 
it's the language, or the toolkit, or the ide, I don't see any progress here 
that's going to speed up our production 1.1x much less 3x with less bugs 
while maintaining decent performance, but that's what we really need and have 
to be headed towards.  The C++ committee has not advanced any significant 
ease of use improvements in the last 8 years or so since STL was adopted, 
meanwhile java, c#, python, ruby, XUL, Objective C are all moving forward.

In the link, Sutter asks what if there were different flavors of string -  duh 
guess what, every toolkit now has it's own string class now because the C++ 
group hasn't modernized to accomodate UTF-8.  so now we have string, 
std::string, ustring(Gtkmm), Qstring(Qt), FxString(Fox).   At least 
Walter Bright's D is much more progressive, too bad it doesn't seem to be 
totally backward compatible.

Maybe we should be working towards gtkdd  - it would be moving forward, not 
maintaining status quo.  
John

On Wednesday 11 May 2005 07:47 am, Foster, Gareth wrote:
 I came across this today [ http://www.codeproject.com/cpp/FastDelegate.asp
 ], I know there were discussions about GTKmm, libsigc++ and boost, does the
 following now mean that the discussion will need to gather momentum (if it
 hasn't already)?


 There are many implementations of this scheme, including several here at
 CodeProject. They vary in their complexity, their syntax (especially, how
 similar their syntax is to C#), and in their generality. The definitive
 implementation is boost::function. Recently, it was adopted into the next
 version of the C++ standard [Sutter1]. Expect its use to become widespread.

 [Sutter1] http://www.cuj.com/documents/s=8464/cujcexp0308sutter/

 Gaz


 **
 * http  -   http://planetearthworm.com/  *
 * mail home -  [EMAIL PROTECTED] *
 * mail work -[EMAIL PROTECTED]   *
 **
 ___
 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


Re: Cross-Platform GUI

2005-05-09 Thread John Taber
I've looked into this extensively and one of these days will finish up my blog 
writeup on it.  For now:

There are plusses and minuses for each - make a list of the most important 
things you need and see how they compare.  

Fltk - pretty simple to use.  Nice small, static compiles.  Dialogs are easy 
to code but not the best looking.  There is no layout manager, just a awkward 
resizable command.  Awkward, static callbacks instead of signal, slots.  No 
major backers or major projects using it.  Most examples and documentation 
are C style.  I never really understood Fluid as a dialog editor.  

wxWidgets - didn't explore too much after looking at code - I guess if you are 
coming from Visual C++ it might look more familar.  I've read some comments 
against it, other comments that say it works great - I believe Audacity uses 
it.   Seems to be a viable option.

There's also Fox toolkit - seems to have excellent Ruby bindings.  No Mac 
support.  Seemed pretty ugly.  Supported mostly by 1 person (though he is 
very responsive).  No dialog editor.

Gtkmm - gtk is being backed by most major Linux players (Red Hat, Novell, 
Sun  )  And of course Gnome, XFCE, all the Gtk apps.  Gtkmm is very c++ 
like.  Uses the excellent libsigc for signal/slots.  Has a very good layout 
manager.  Confusing library dependencies but uses Pkg-Config to make 
compiling easy.  Use XFC documentation, it's much better.  (XFC is a great 
library too, but only for Linux).  Gtk apps certainly being used on Windows.  
Mac ?? not too sure - maybe others can comment.  

Depending on your situation - you might want to look at Qt - it's a good, easy 
to use toolkit.  Very cross-platform, excellent documentation.  Good looking.  
Very C++ oriented.  The moc signal stuff is non C++ but works well.  Moc 
causes Qt to be slow to compile.  Well supported.  As someone who has to sign 
the checks, I think it is way too expensive for our use but it's your call.  

Don't forget java  SWT - the advances of gcj may bring native compilation of 
Swing.  And the next version is supposed to support native widgets.  

Bottom Line:  We chose gtkmm based mostly on the industry support for gtk, the 
free license, the layout manager abilities, the availability of glade (though 
we're not using it yet), and libsigc.  If XFC becomes cross-platform we will  
strongly consider it (both use mostly the same gtk wrapper commands).  

hope this helps.
John

On Sunday 08 May 2005 08:56 pm, Fabian Arocena wrote:
 Hi everybody,

 I''ve explored a bit about Cross-Platform GUI and have found 3 options
 that are quite attractive:

 - GTKmm
 - wx Widgets
 - FLTK

 Has anybody worked with some of these ? Is one of them better than the
 others ?

 Thanks,
 Fabian.
 ___
 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


Re: vers 2.6 in Fedora?

2005-05-08 Thread John Taber
I'm ready to try Fedora 4 test 2 - you say they are built but not signed and 
pushed - I do not know what that means but if they are available on your 
website somewhere, it would be much easier than trying to build them myself.  
thks.

On Sunday 08 May 2005 10:53 am, Denis Leroy wrote:
 John Taber wrote:
  I cannot seem to find Fedora 3 or 4 pkgs for gtkmm 2.6.x ?  Do they
  exist? thks.
  ___
  gtkmm-list mailing list
  gtkmm-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtkmm-list

 They are in Fedora Extras, but will only be available for FC4 (because
 FC3's version of Gnome is too old).

 I pushed updates for 2.6.x recently and the RPMs have been built but
 haven't been signed and pushed yet. If you really need them now, you can
 checkout the spec files from CVS and build them yourself (see
 http://fedoraproject.org./wiki/Extras for instructions).

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


suspending signal events

2005-05-05 Thread John Taber
What is the best way to suspend signal events in a combobox while clearing and 
reloading the combobox? thks.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Bug with ComboBoxText.clear()

2005-05-03 Thread John Taber
There is a major bug with the clear() method in ComboBoxText - after it is 
called, no text appears and blank lines for each entry appear in the drop 
down.  Meanwhile, is there a workaround to empty the combobox and refill it ?  
I didn't see a remove item method.  Attached is a sample program that 
illustrates the problem.

#ifndef TEST_DIALOG_H
#define TEST_DIALOG_H

#include gtkmm/main.h
#include gtkmm/window.h
#include gtkmm/box.h
#include gtkmm/button.h
#include gtkmm/comboboxtext.h

class TestDialog : public Gtk::Window {
public:
TestDialog();
virtual ~TestDialog();
protected:
//Signal handlers:
virtual void testButtonOnClicked();
  
Gtk::VBox vbox;
Gtk::Button testButton;
Gtk::ComboBoxText testComboBox;
};
#endif

TestDialog::TestDialog() {
set_size_request(300, 300);
set_title(Test Dialog);
testButton.set_label(Test);
testButton.signal_clicked().connect(sigc::mem_fun(*this, 
TestDialog::testButtonOnClicked) );
vbox.pack_start(testButton, Gtk::PACK_SHRINK);
testComboBox.append_text(combotext1);
testComboBox.append_text(combotext2);
vbox.pack_start(testComboBox, Gtk::PACK_SHRINK);
add(vbox);
show_all_children();
}
TestDialog::~TestDialog() { }
void TestDialog::testButtonOnClicked() {
//testComboBox.clear();
testComboBox.append_text(combotext3);
testComboBox.append_text(combotext4);
testComboBox.set_active(0);
}
// main -
int main(int argc, char *argv[]) {
 Gtk::Main kit(argc, argv);
TestDialog test;
Gtk::Main::run(test);
return 0;
}

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


Re: Bug with ComboBoxText.clear()

2005-05-03 Thread John Taber
Yes, I'm running version 2.4.  What would you recommend?
1) upgrade to 2.6 - Are there Fedora pkgs for 2.6 now ?  If not, I would have 
to switch to Ubuntu which has 2.6.1 (something I planned to do but wasn't 
planning on doing it right now)
2) not use clear() - but is there a workaround to empty the combobox?  
John

On Tuesday 03 May 2005 10:23, Murray Cumming wrote:
 On Tue, 2005-05-03 at 10:07 -0600, John Taber wrote:
  There is a major bug with the clear() method in ComboBoxText - after it
  is called, no text appears and blank lines for each entry appear in the
  drop down.

 What version of gtkmm are you using. Gtk::ComboBoxText::clear() was
 added in 2.6. Maybe you are calling the base Gtk::CellLayout::clear()
 method which does something completely different. If I'd know I would
 have given it a different method name.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


on-show equivalent

2005-04-29 Thread John Taber
Is there a gtk::window method such as on-show that allows an event to occur 
when the window first appears?  thks.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: Backward compatibility

2005-04-28 Thread John Taber
We appreciate the new releases.  But based on several other posts here, I 
think a web page that shows a more detailed listing of all the g* lib 
requirements for each gtkmm release would be most helpful - with a bunch of 
gtk and gtkmm releases, and different availability on different distros, it 
is getting difficult to make sure we have a matching lib set.  I'm even 
having trouble figuring out what to apt-get on a machine right now.  

On Thursday 28 April 2005 06:18, Murray Cumming wrote:
 On Thu, 2005-04-28 at 09:05 -0300, Alfredo Kojima wrote:
  :) The problem is that even decent distros will not have 2.4 if
 
  they're not reasonably recent and I need to support them, since
  they're often common in many companies...

 That's life. Use whatever version your target platform has, or can
 install, and encourage the use of distros that manage this properly.

 We can't do time travel for you. And we won't stop releasing new
 features just because you want to use them too much.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


rgb number scheme

2005-04-25 Thread John Taber
gtkmm uses the gdk color  r_g_b numbering scheme that goes from 0-65535 
instead of the more normal 0-255.  Can anyone explain what the 65535 is based 
on.   I'm guess we have to divide all our color numbers and use 
set_rgb_p(...) - I'm wondering why there isn't a set_rgb method for using the 
normal 0-255 range.  
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: problem with custom menu

2005-04-24 Thread John Taber
I finally figured this out - the former menu append methods have been 
deprecated in the gtk api, replaced by using the attach and the submenu 
methods.  I'm willing to do a brief how-to writeup on this but where or what 
format should this be posted?  This would be a good candidate for a wiki page 
if we had one.  
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


problem with custom menu

2005-04-22 Thread John Taber
I'm having a problem with the newer way to use a custom menu - can someone 
help out - thanks.

fileMenu = new Gtk::Menu();
openMenuItem = new Gtk::MenuItem(Open);
fileMenu-attach(*openMenuItem,0,0,0,0);
fileMenuItem = new Gtk::MenuItem(File, fileMenu);
menubar = new Gtk::MenuBar();
menubar-append(*fileMenuItem);
mainBox.pack_start(*menubar, Gtk::PACK_SHRINK);

: Gtk-CRITICAL **: file gtkmenu.c: line 3836 (gtk_menu_attach): assertion 
`left_attach  right_attach' failed
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: problem with custom menu

2005-04-22 Thread John Taber
Huh?  I'm simply trying to build a simple menu and ::attach with the table 
coordinates is exactly what is in the gtkmm API documentation (under 
widgets/menu) and what compiles (menu-append will not compile for me). I 
don't want to use actions for several reasons related to what other widgets I 
want on a toolbar and besides, simple menus should be just as little coding 
as using all the action statements and xml descriptions.  I got the feeling 
that the ::attach with table coordinates was new in 2.4 but I am not trying 
to debate that - I simply cannot attach/append, whatever, sub items to my 
file menu and there are no examples with attach so I would appreciate any 
help trying to get this to work.  Yes, it should not be difficult, I am not 
trying to do anything strange here.  
John



On Friday 22 April 2005 10:31, Murray Cumming wrote:
 On Fri, 2005-04-22 at 10:19 -0600, John Taber wrote:
  You are right, the table coordinates are different - previously you could
  just append the menuitem.

 What is this previously API?

 I didn't even know that this Menu::attach() method existed. What are you
 actually trying to do? I'm sure there's a less painful way.

This is what I have now tried:
  fileMenu = new Gtk::Menu();
  newMenuItem = new Gtk::MenuItem(New);
  fileMenu-attach(*newMenuItem,0,1,0,1);
  openMenuItem = new Gtk::MenuItem(Open);
  fileMenu-attach(*openMenuItem,0,1,0,2);
  fileMenuItem = new Gtk::MenuItem(File, fileMenu);
  menubar = new Gtk::MenuBar();
  menubar-append(*fileMenuItem);
  ..
  show_all_children();
 
  File shows on the menubar but when clicked, the New or Open
  menuitems do not show.  Since I don't understand the table idea, I guess
  this is where the problem is (do the coordinates mean to the left or
  right of the calling menu, to the top or bottom ? ).  Btw - what is the
  best way to check versions on my installed gtk, gtkmm, glib (one
  machine is Fedora, one is ubuntu debian). thks.
 
  On Friday 22 April 2005 09:36, Murray Cumming wrote:
   On Fri, 2005-04-22 at 09:38 -0600, John Taber wrote:
Thanks for suggestion - it eliminated the error but my menuitems are
still not showing
  
   Are you calling show()?
  
 (to test I added a second one at 0,1,0,2).  I have read the
documentation but I cannot understand what the table is supposed to
do and maybe that is where my problem is.  btw other gtk
documentation I have showed a far simpler way - was this a change in
gtk? or in gtkmm? and is the old api eliminated just not deprecated? 
thanks
  
   You'll have to show us what you mean.
  
John
   
On Friday 22 April 2005 06:24, Murray Cumming wrote:
 On Fri, 2005-04-22 at 05:41 -0600, John Taber wrote:
  I'm having a problem with the newer way to use a custom menu -
  can someone help out - thanks.
 
  fileMenu = new Gtk::Menu();
  openMenuItem = new Gtk::MenuItem(Open);
  fileMenu-attach(*openMenuItem,0,0,0,0);

 Table (and Menu, I guess) attach coordinates are a bit odd. Like
 the warning says, you probably want 0, 1, 0, 1. This is hinted at
 in the documentation:
 http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_
1Men u.ht ml#a0

 I guess this should have default values. A patch would be welcome.

 But I personally prefer to use the UIManager anyway.

  fileMenuItem = new Gtk::MenuItem(File, fileMenu);
  menubar = new Gtk::MenuBar();
  menubar-append(*fileMenuItem);
  mainBox.pack_start(*menubar, Gtk::PACK_SHRINK);
 
  : Gtk-CRITICAL **: file gtkmenu.c: line 3836 (gtk_menu_attach):
  : assertion
 
  `left_attach  right_attach' failed
  ___
  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


Re: problem with custom menu

2005-04-22 Thread John Taber
Thanks for suggestion - it eliminated the error but my menuitems are still not 
showing (to test I added a second one at 0,1,0,2).  I have read the 
documentation but I cannot understand what the table is supposed to do and 
maybe that is where my problem is.  btw other gtk documentation I have showed 
a far simpler way - was this a change in gtk? or in gtkmm? and is the old api 
eliminated just not deprecated?  thanks
John

On Friday 22 April 2005 06:24, Murray Cumming wrote:
 On Fri, 2005-04-22 at 05:41 -0600, John Taber wrote:
  I'm having a problem with the newer way to use a custom menu - can
  someone help out - thanks.
 
  fileMenu = new Gtk::Menu();
  openMenuItem = new Gtk::MenuItem(Open);
  fileMenu-attach(*openMenuItem,0,0,0,0);

 Table (and Menu, I guess) attach coordinates are a bit odd. Like the
 warning says, you probably want 0, 1, 0, 1. This is hinted at in the
 documentation:
 http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Menu.ht
ml#a0

 I guess this should have default values. A patch would be welcome.

 But I personally prefer to use the UIManager anyway.

  fileMenuItem = new Gtk::MenuItem(File, fileMenu);
  menubar = new Gtk::MenuBar();
  menubar-append(*fileMenuItem);
  mainBox.pack_start(*menubar, Gtk::PACK_SHRINK);
 
  : Gtk-CRITICAL **: file gtkmenu.c: line 3836 (gtk_menu_attach): assertion
 
  `left_attach  right_attach' failed
  ___
  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


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

2005-04-21 Thread John Taber
On Thursday 21 April 2005 12:11, Murray Cumming wrote:
 You should use gmmproc, like the existing *mm projects. But I think
 gtkmozembedmm is a more sensible way to embed HTML. People are trying to
 move from gtkhtml to gecko.
Except as I read it, mozembed is gpl not lgpl, also it's much bigger since 
it's a whole browser.   Originally I thought gtkhtml offered a simple way to 
display html help and reports, but it now does not seem so and now I'm 
thinking the optimum way is to shell out to user's native browser.  Then they 
are always working in what they are used to and we have the full use of CSS, 
SVG, etc.  But that I guess is OS and window manager specific, maybe quite 
messy?
John
___
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


Re: Displaying simple HTML in gtkmm app

2005-03-24 Thread John Taber
On Wednesday 23 March 2005 23:20, Timothy M. Shead wrote:
 Just as there is the gobj() method for accessing the underlying GTK C
 object for a gtkmm class instance, there are wrap() methods that allow
 you to wrap a gtkmm class instance around an existing C object.

thks, I did see that yesterday as I was searching - but I'm struggling with 
how this goes into code and why I'm looking for an example.  Do I do 
something like:
gtkhtml *cview;
Gtk::Frame *mmview = new Gtk::Frame();
mmview-wrap(cview);
mmview-.. // whatever gtkhtml method 

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


Re: Displaying simple HTML in gtkmm app

2005-03-24 Thread John Taber
On Thursday 24 March 2005 14:09, Murray Cumming wrote:
  thks, I did see that yesterday as I was searching - but I'm struggling
  with how this goes into code and why I'm looking for an example.  Do I do
  something like:
  gtkhtml *cview;
  Gtk::Frame *mmview = new Gtk::Frame();
  mmview-wrap(cview);
  mmview-.. // whatever gtkhtml method

 This is mentioned in th FAQ.

Well, mentioned is the right word. - Glib::wrap() will give you a pointer 
to gtkmm object. It is an overloaded function, so it will give you an 
instance of the appropriate class. 

Sorry, but this doesn't really help me.  Can someone help me out a bit more?  
Thks.  John
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: Displaying simple HTML in gtkmm app

2005-03-23 Thread John Taber
This is a feature I really miss from other toolkits but gtkhtml looks like it 
will do the job.  Are there any examples how to instantiate and use a C gtk 
widget in gtkmm code ?  
thks 
I have no experience with this myself, but you can get to the
underlying C GTK+ widgets via the gobj() member function. So if there
is no wrapper for gtkhtml, you simple use the C API and call gobj() on
your gtkmm container when you need to put the HTML widget inside it.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: TreeModel selected row number

2005-03-22 Thread John Taber
On Tuesday 22 March 2005 03:41, Murray Cumming wrote:
 Yes, I think it's that difficult. But the row number should not be
 useful anyway, because the TreeModel is iterator based. It's the same as
 wanting to get the numerical index of a std::list.

It is actually very useful if the tree is being used as any sort of list box.  
And almost any gui toolkit I think of gives a row index in a list box so I 
would think it is a good candidate for a RFE.  That said, I am used to 
writing index lookups in a std::vector so I can do it that way.  
John
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: TreeModel width

2005-03-22 Thread John Taber
On Tuesday 22 March 2005 03:43, Murray Cumming wrote:
 Gtk::Widget::set_default_width() might do it, on the TreeView or the

thks - I don't see that function listed under Widget in the api documentation 
- should I be looking somewhere else or is it just missing?
John
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


TreeView Signal Problem

2005-03-22 Thread John Taber
Not my day with TreeView:)  The TreeView signals do not appear to be sent - 
the text output does not appear when I click on any of the tree rows.  All my 
button signals work fine.  I tried to follow the tree example - any ideas?

virtual void menuTreeOnClicked(const Gtk::TreeModel::Path path, 
Gtk::TreeViewColumn* column);
.
menuTreeView.signal_row_activated().connect(sigc::mem_fun(*this, 
NewStartupDialog::menuTreeOnClicked) );
..
void NewStartupDialog::menuTreeOnClicked(const Gtk::TreeModel::Path path, 
Gtk::TreeViewColumn*) {
  std::cout  Test Tree Click  std::endl;

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


using svg icons in toolbar

2005-03-19 Thread John Taber
if I want to use svg icons in the menu toolbar instead of the stock icons, 
do I have to create a new Stock icon from the svg file or can I simply set 
the button directly (I did not see a set_icon type of method in Gtk::Action)
John
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: librsvg

2005-03-14 Thread John Taber
Are there any examples of using librsvg in gtkmm to display a svg drawing or 
map ?  
John
-- 
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: librsvg

2005-03-14 Thread John Taber
Are there any examples of using librsvg in gtkmm to display a svg drawing or 
map ?  
John
-- 
___
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list