Re: Displaying domain objects with GtkTreeView

2011-12-02 Thread Rafał Krupiński
2011/12/1 David Nečas y...@physics.muni.cz:
 What are you talking about?  You can pass any GObject-derived type as
 the column type (not that it matters much, the net result is the same as
 passing G_TYPE_OBJECT).  You get back the objects that you stored there.

 If you store objects of different classes to the same column and want to
 know the precise type use RTTI: type macros such as MY_IS_FOO(),
 G_TYPE_FROM_INSTANCE(), g_type_is_a(), etc.

Hi
I rather meant to use my object as a model for a whole, multi-column
row, somehow binding fields or properties to columns.

Regards
-- 
Pozdrawiam / Best Regards
Rafal Krupinski
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Displaying domain objects with GtkTreeView

2011-12-02 Thread David Nečas
On Fri, Dec 02, 2011 at 03:55:51PM +0100, Rafał Krupiński wrote:
 I rather meant to use my object as a model for a whole, multi-column
 row, somehow binding fields or properties to columns.

It makes no sense (to me anyway) to imagine one object as multiple
*model* columns.

But it is easy to create an arbitrary M:N mapping between model rows and
view rows using the cell data functions, see
gtk_cell_layout_set_cell_data_func() which is probably the binding you
are looking for.

Yeti

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Displaying domain objects with GtkTreeView

2011-12-02 Thread Edheldil
On 12/02/2011 04:01 PM, David Nečas wrote:
 On Fri, Dec 02, 2011 at 03:55:51PM +0100, Rafał Krupiński wrote:
 I rather meant to use my object as a model for a whole, multi-column
 row, somehow binding fields or properties to columns.
 It makes no sense (to me anyway) to imagine one object as multiple
 *model* columns.

Might be that what you look for, Rafal, is  model.set_modify_func () -
it allows him
to synthesize model columns on the fly, from e.g. objects in the real
model column.

The modify func then can look st. like this:

def modify_func (model, iter, col_num, attrs):
obj = model.get_value (iter, 0)
col = attrs[col_num]

try:
return getattr (obj, col)
except:
return ''

For some performance penalty.

Cheers,
Edheldil


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Can I develop gtk app in Mac OS X ?

2011-12-02 Thread Gabriele Greco


  Here is a starting point to install GTK on OSX:
 
  http://live.gnome.org/GTK%2B/OSX/

 And  It can running separately from X in OSX?


YES, the build documentation I pointed to is for the native (Quartz)
version of GTK, that works quite well (still has some minor bugs here and
there).

You can also bundle GTK libraries inside an OSX .app with the
gtk-mac-bundler.


The X11 version of GTK can be easily installed from fink or macports, but
it needs an X11 server running on your machine and it's not friendly at all
if you want to create an application you want to share with someone.

-- 
Bye,
 Gabry
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Embedding OpenGL into GTK apps

2011-12-02 Thread Dénes Almási
On Wed, Nov 30, 2011 at 11:27 PM, Bernhard Schuster 
schuster.bernh...@googlemail.com wrote:

 2011/11/30 Almási Dénes denes.alm...@gmail.com:
  Hi,
 
  I would need some clarification on embedding an opengl canvas into a GTK
  3.0 application. Is it possible? And if so, how? This is a necessary
  component for my thesis at university.
 
  GtkGlExt (surprisingly - quite out of support) does not seem to work. I
  even tried to link against it with gtk 2.0, but it doesn't work either.
 
  
  Nasty things like this are written to stdout:
  (process:9338): Gdk-CRITICAL **: IA__gdk_x11_display_get_xdisplay:
  assertion `GDK_IS_DISPLAY (display)' failed
 
  (process:9338): GdkGLExt-WARNING **: Window system doesn't support
  OpenGL.
  
 
  I am using Arch linux with GNOME 3, [base], [community] and [extra]
  repos enabled only, latest nvidia graphics card with proprietary
  drivers. I am using gtkmm in C++11, but I couldn't achieve anything even
  in plain gtk, and if a solution exists in gtk, I think it would be
  portable to gtkmm.
 
  Thanks,
  Dennis
 
  P.S.: An equally good solution would be to draw gtk inside an opengl
  canvas, that way my whole application would be drawn in opengl. Is that
  possible?

 I asked this question a while ago at stackoverflow (at that time I
 were not aware of this mailinglist):

 http://stackoverflow.com/questions/3815806/gtk-and-opengl-bindings

 Regards


 Bernhard


Hi,

Thank you, I will give GtkGlArea a try as soon as I have some time.
Unfortunately Cairo is not an option for me as I have to be really fast.

I'll report back later!

Dennis
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Can I develop gtk app in Mac OS X ?

2011-12-02 Thread Miroslav Rajcic

Here is a starting point to install GTK on OSX:

http://live.gnome.org/GTK%2B/OSX/



And  It can running separately from X in OSX?


Not yet.


Actually you can run it separately from X server, like an ordinary 
application, when using Quartz backend.
What you need is is to check GTK-OSX project, see more info here: 
http://www.gtk.org/download/macos.php


Basically, you need to build GTK with jhbuild scripts and bundle the GTK 
libraries with your program.


Regards,
 Miroslav 
___

gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list