acces to a member of the principal widget

2006-03-27 Thread Jerome Le Saux
Hi,
I looked for  days my error, and I found it ;).

in a menu bar I add item. This item open an gtk_file_chooser_dialog.
In the callback of my main I give as argument the pointer of my mani widget
pWindow.
But how can I access to my list, which is add by a gtk_add_container to my
pWindow widget ?.

{
pWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
...
DirList = gtk_clist_new_with_titles (3, DirTitles);
 g_signal_connect_swapped(G_OBJECT(pMenuItem), activate,
G_CALLBACK(OnFile), (GtkWidget*) pWindow);

gtk_container_add (GTK_CONTAINER (scrolled_window), DirList);

}

void OnFile ( gpointer data )
{
 GtkWidget *pFileSelection;
GtkWidget *pDialog;
GtkWidget *pParent;
gchar *sChemin;
 pParent = GTK_WIDGET(data);

.

// Now I would like to access to my DirList Widget ? //
}

Can you tell me if it exists macros to access to member of the principal
widget ?


Cheers

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


Columns with no cursor on GtkTreeView

2006-03-27 Thread Juan Pablo
Hi list.
I have a GtkTreeView with a lot of columns amd only some of them are
editable. It works fine.
What i want to do is that the cursor doesn't position over some of the
columns (the non editable ones) for practical use reasons.
Is there any property to set this or i have to make a funcion hooked on
cursor movement cheking current position and direction to set the new
destination?

Thanks!

Saludos, Juan Pablo.
__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: acces to a member of the principal widget

2006-03-27 Thread Olexiy Avramchenko
On 3/27/06, Jerome Le Saux [EMAIL PROTECTED] wrote:
 Hi,
 I looked for  days my error, and I found it ;).

 in a menu bar I add item. This item open an gtk_file_chooser_dialog.
 In the callback of my main I give as argument the pointer of my mani widget
 pWindow.
 But how can I access to my list, which is add by a gtk_add_container to my
 pWindow widget ?.

 {
 pWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 ...
 DirList = gtk_clist_new_with_titles (3, DirTitles);
  g_signal_connect_swapped(G_OBJECT(pMenuItem), activate,
 G_CALLBACK(OnFile), (GtkWidget*) pWindow);
 
 gtk_container_add (GTK_CONTAINER (scrolled_window), DirList);

 }

 void OnFile ( gpointer data )
 {
  GtkWidget *pFileSelection;
 GtkWidget *pDialog;
 GtkWidget *pParent;
 gchar *sChemin;
  pParent = GTK_WIDGET(data);

 .

 // Now I would like to access to my DirList Widget ? //
 }

 Can you tell me if it exists macros to access to member of the principal
 widget ?

Hello,
You'd better connect with g_signal_connect() like:

g_signal_connect (pMenuItem, activate, G_CALLBACK (OnFile), pWindow);

and change the OnFile callback like:

static void
OnFile (GtkMenuItem *menu_item, GtkWidget *window)
{
/* ... */
}

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

About gtk text view

2006-03-27 Thread Jose Hevia
Hello,
I'm making a program that displays a text view, and  I cant find the
right keywords to find the solution on the archives:

I need to know when the gtk_text_view window changes size(the user
force that with the mouse), so I can redraw the screen. But seems the
configure_event is deactivated for child windows(those that are not
the main one), so I use the expose event that is far from perfect.

gtk_text_view is very SLOW, I know why, I'm receiving expose event for
each line I write in the text buffer. I know by default all widgets
are double buffered, so I need to disconnect screen updating while
writing, when I have finished use something like gtk_widget_show.
The problem, I don't know how: :-)

Does someone know the solution of any of these two problems ?
  
 Jose Hevia
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Callbacks and widgets

2006-03-27 Thread David Necas (Yeti)
On Tue, Mar 28, 2006 at 09:38:20AM +0200, Gonzalo Aguilar Delgado wrote:
 
 Because receiver callback is getting only the receiver widget,

In addition, the callback gets an arbitrary pointer passed
as user_data to g_signal_connect().  A pointer can be used
to pass anything.

This is a very frequently asked question, search the
archives for discussion...

Yeti


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


Re: The printing work has been merged

2006-03-27 Thread Yevgen Muntyan

Hey,

First of all, I implemented some printing in my application,
and it works!

I have a question about generating postscript. Using
copy/paste method I implemented postscript print backend,
and it's working fine. While generated postscript is just
a bunch of page images due to cairo problems, the GtkPrint*
stuff works fine. So, shouldn't PDF backend be really a
File backend which can write PDF or PS? Or maybe just
separate PS  backend, in addition to PDF?

Best regards,
Yevgen

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


The printing work has been merged

2006-03-27 Thread Tor Lillqvist
Matthias Clasen writes:
  For cvs cairo, it should be turned on by default.

Er, what *cvs* cairo? ;)

I've been too lazy to install git, are there nightly snapshot tarballs
anywhere?

--tml

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


Re: The printing work has been merged

2006-03-27 Thread Jean Bréfort
Le lundi 27 mars 2006 à 02:08 -0600, Yevgen Muntyan a écrit :
 Hey,
 
 First of all, I implemented some printing in my application,
 and it works!
 
 I have a question about generating postscript. Using
 copy/paste method I implemented postscript print backend,
 and it's working fine. While generated postscript is just
 a bunch of page images due to cairo problems, the GtkPrint*
 stuff works fine. So, shouldn't PDF backend be really a
 File backend which can write PDF or PS? Or maybe just
 separate PS  backend, in addition to PDF?

An what about an EPS backend? I feel it might be useful for many people
(not only myself).

Cheers,
Jean

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


Re: The printing work has been merged

2006-03-27 Thread Yevgen Muntyan

Jean Bréfort wrote:


An what about an EPS backend? I feel it might be useful for many people
(not only myself).
 


I believe it would be an easy option of PS backend (or whoever
would print postscript), EPS is just PS without some header, right?

Regards,
Yevgen

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


Re: The printing work has been merged

2006-03-27 Thread Ross Burton
On Mon, 2006-03-27 at 04:57 -0600, Yevgen Muntyan wrote:
 I believe it would be an easy option of PS backend (or whoever
 would print postscript), EPS is just PS without some header, right?

As I understand it EPS is a subset of PostScript.  Pure PostScript can
do anything, such as create new pages, be a web server, etc.
Encapsulated PostScript is designed for embedding in other documents, so
it more like SVG in that respect: lots of the functionality isn't
supported, EPS files have more explicit bounding boxes, etc.

Ross
-- 
Ross Burton mail: [EMAIL PROTECTED]
  jabber: [EMAIL PROTECTED]
 www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF



signature.asc
Description: This is a digitally signed message part
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Building problems on mac intel

2006-03-27 Thread Anders Carlsson
 Hello,

 I am attempting to build gtk+ on the new macbook pro (mac os x 10.4.5
 intel).


Hi Lillian,

I've committed the relevant fixes so everything should (hopefully) build now.

Anders

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


Re: The printing work has been merged

2006-03-27 Thread Matthias Clasen
On 3/27/06, Tor Lillqvist [EMAIL PROTECTED] wrote:
 Matthias Clasen writes:
   For cvs cairo, it should be turned on by default.

 Er, what *cvs* cairo? ;)

 I've been too lazy to install git, are there nightly snapshot tarballs
 anywhere?


Hah, good point. Me too. I'm hoping that cairo 1.2 is near now...
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


gnome_client and project ridley

2006-03-27 Thread Jani Monoses

Hello

there's a gnome bug [1] concerning the possible replacement of 
GnomeClient as part of Project Ridley.

The libgnome page in the wiki [2] has the following interesting
bit:

'But my view is that GNOME should drop XSMP entirely and just have a 
startup programs folder and dbus services. -hp'


what is the current thinking on this matter? The bug has a more 
ambitious goal than just replacing the gnome client API from what I see
as it covers saving widgets and windows status not just application 
parameters traditionally (?) saved as part of the session.


Right now there are quite a few gnome apps which of the Gnome APIs only 
use gnome_client, but get linked to all the libraries because of this 
dependency.


thanks
Jani

[1] http://bugzilla.gnome.org/show_bug.cgi?id=79285
[2] http://live.gnome.org/LibgnomeMustDie

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


Re: The printing work has been merged

2006-03-27 Thread Alexander Larsson
On Mon, 2006-03-27 at 12:57 +0100, Ross Burton wrote:
 On Mon, 2006-03-27 at 04:57 -0600, Yevgen Muntyan wrote:
  I believe it would be an easy option of PS backend (or whoever
  would print postscript), EPS is just PS without some header, right?
 
 As I understand it EPS is a subset of PostScript.  Pure PostScript can
 do anything, such as create new pages, be a web server, etc.
 Encapsulated PostScript is designed for embedding in other documents, so
 it more like SVG in that respect: lots of the functionality isn't
 supported, EPS files have more explicit bounding boxes, etc.

A specific issue in this case is that i don't think EPS files can
contain multiple pages. This means its not really possible to create EPS
files in the print backend. EPS files are more meant to be used for
clipart-style images.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander LarssonRed Hat, Inc 
   [EMAIL PROTECTED][EMAIL PROTECTED] 
He's a hate-fuelled neurotic boxer on the edge. She's a transdimensional 
bisexual Hell's Angel living on borrowed time. They fight crime! 

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


Re: The printing work has been merged

2006-03-27 Thread Yevgen Muntyan

Alexander Larsson wrote:

On Mon, 2006-03-27 at 02:08 -0600, Yevgen Muntyan wrote:


Hey,

First of all, I implemented some printing in my application,
and it works!



Cool! Did you like the API?


I followed print-editor.c, so I subclassed GtkPrintOperation and
I do stuff in begin-print and draw-page methods; it works fine.
But, I do not understand how can a library provide printing.
It seems inappropriate for a text widget to create a GtkPrintOperation
object; and it seems natural (maybe after gnomeprint?) to delegate
the real job to some PrintJob object which could be sent to a printer,
or used inside of PrintOperation methods. E.g. it feels just wrong
that drawing happens in the method of an object which also shows Print
dialog. I looked at GtkPrintJob, but it seems to be rather internal
auxiliary class not intended for using in application code.
Maybe it's just my misunderstanding, but documentation is not very
clear ;)

From the other hand, this straight prepare-and-print way is awesome.
I love how it's easy to print a text document.

In any case, it would be really cool if you wrote some five-steps
printing howto or a rough description of what doing what.


Do we want to expose a write-to-ps to everyone? PDFs are a well known
way to send pre-rendered page layouts as files, but postscript is much
less widely known. 


Well, in our department network consisting of linux machines, xerox
postscript printers, and lpr, postscript is widely known. I personally
need postscript much more than pdf here, since I can create postscript
file, ssh to some department machine, and send the file to print using
lpr. If I have pdf, I use wonderful acrobat reader to print file to PS,
and so on.

And well, postscript is not something ancient and forgotten. People
dealing with TeX know about postscript. postscript is much less widely
known is rather like MS Word format is very well known.


Technically it would be easy to make the pdf backend be a general
backend that had a pdf or ps setting in the advanced tab. I'm just not
sure if exposing that is a good idea. Opinions?


I believe it should be a well-visible option in the dialog, like a combo
with PS and PDF in the list. It's really a I press Print and choose
Print to PS thing, not something set once and forgotten forever (of
course dialog must remember last choice).

Best regards,
Yevgen
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Input methods

2006-03-27 Thread Danilo Šegan
On Thursday at 18:30, Simos Xenitellis wrote:

 This works ok for most languages now, though there is some work to synch
 the table from upstream http://bugzilla.gnome.org/show_bug.cgi?id=321896

Not really.  X Compose files allow a compose sequence to return a
string of UTF-8 characters, while internal Gtk+ compose handling
doesn't allow that.  This is problematic for when you don't have
precomposed accented letters in Unicode/ISO 10646, so you must use
decomposed form.


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


Re: The printing work has been merged

2006-03-27 Thread Alexander Larsson
On Mon, 2006-03-27 at 12:47 -0600, Yevgen Muntyan wrote:
 Alexander Larsson wrote:
  On Mon, 2006-03-27 at 02:08 -0600, Yevgen Muntyan wrote:
  
 Hey,
 
 First of all, I implemented some printing in my application,
 and it works!
  
  
  Cool! Did you like the API?
 
 I followed print-editor.c, so I subclassed GtkPrintOperation and
 I do stuff in begin-print and draw-page methods; it works fine.
 But, I do not understand how can a library provide printing.
 It seems inappropriate for a text widget to create a GtkPrintOperation
 object; and it seems natural (maybe after gnomeprint?) to delegate
 the real job to some PrintJob object which could be sent to a printer,
 or used inside of PrintOperation methods. E.g. it feels just wrong
 that drawing happens in the method of an object which also shows Print
 dialog. I looked at GtkPrintJob, but it seems to be rather internal
 auxiliary class not intended for using in application code.
 Maybe it's just my misunderstanding, but documentation is not very
 clear ;)

While its possible to subclass GtkPrintOperation (that was very much in
the design) I don't expect that to be the main way apps will use it. I
think the main way will be to create a non-subclassed PrintOperation
object and connecting to the draw_page signal on it. If some object want
to provide printing i think the best way is to make it have an method
that can render itself to a cairo_t.

GtkPrintJob is an internal object in the unix printing implementation.
It is not used in for instance the Win32 port.

 In any case, it would be really cool if you wrote some five-steps
 printing howto or a rough description of what doing what.

I need to write full API docs of course, but I also want to write some
sort of tutorial. Actually I intend to present this on guadec, so the
paper for Guadec will probably be some form of tutorial.

  Do we want to expose a write-to-ps to everyone? PDFs are a well known
  way to send pre-rendered page layouts as files, but postscript is much
  less widely known. 
 
 Well, in our department network consisting of linux machines, xerox
 postscript printers, and lpr, postscript is widely known. I personally
 need postscript much more than pdf here, since I can create postscript
 file, ssh to some department machine, and send the file to print using
 lpr. If I have pdf, I use wonderful acrobat reader to print file to PS,
 and so on.

While I have personally printed to ps and scp:d it to another machine to
print I think that is a sort of fringe usecase, and more of a hint of
how broken the unix print system is. Maybe we should support it, but far
more important is to obsolete this workaround so that not only people
like us can manage to print on remote printers. :)

 And well, postscript is not something ancient and forgotten. People
 dealing with TeX know about postscript. postscript is much less widely
 known is rather like MS Word format is very well known.

Both TeX and MS Word are stuff that end users care about, but postscript
is less so. Its more of a necessary evil that users of TeX are forced to
know about the details of postscript, as its really just an
implementation detail in the unix printing system. In reality people
will be forced to work with postscript files, so we should have some
form of support for it, but the imho goal should be to move away from
users having to know about this stuff.

  Technically it would be easy to make the pdf backend be a general
  backend that had a pdf or ps setting in the advanced tab. I'm just not
  sure if exposing that is a good idea. Opinions?
 
 I believe it should be a well-visible option in the dialog, like a combo
 with PS and PDF in the list. It's really a I press Print and choose
 Print to PS thing, not something set once and forgotten forever (of
 course dialog must remember last choice).

I don't quite agree with well visible, but this sounds like a
generally good thing, as long as we default to PDF, because that is
really a much more viable format for passing pre-rendered files between
different machines and platforms.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander LarssonRed Hat, Inc 
   [EMAIL PROTECTED][EMAIL PROTECTED] 
He's a one-legged coffee-fuelled paramedic with a mysterious suitcase 
handcuffed to his arm. She's a time-travelling insomniac mermaid on the trail 
of a serial killer. They fight crime! 

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


GTK+ Mac Precompiled binaries?

2006-03-27 Thread John Craig
Hello,

I visited the page for Gtk Mac OS X because GTK was listed as a
prerequisite for a Mac program I'd like to try.  I have yet to compile
a program in the shell on a Mac, and I was hoping to find some
precompiled binarys that I could just install.  Any chance such a
thing exists somewhere, or if not, that offereing some precompiled
binaries for download might be considered?

Thank You,
-john
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: improvement of font selection

2006-03-27 Thread Behdad Esfahbod
On Mon, 27 Mar 2006, Kenichi Handa wrote:

 Unfortunately, AFAIK, fonts.conf doesn't allow per-script
 (or per-language) settings, and we can't say some font is
 broken or not without specifying a script or language.

I keep hearing this (this is the third time in the past couple of
months), but I don't believe it's true.  For example, I just
hacked a tiny fonts.conf to change font selection for Arabic and
Persian.

Before:

[EMAIL PROTECTED] ~]$ fc-match :lang=fa
roya.ttf: Roya Regular
[EMAIL PROTECTED] ~]$ fc-match :lang=ar
roya.ttf: Roya Regular

After adding this to ~/.fonts.conf:

?xml version=1.0?
!DOCTYPE fontconfig SYSTEM fonts.dtd
fontconfig
match
test name=lang
stringar/string
/test
edit name=family mode=prepend binding=same
stringHoma/string
/edit
/match
/fontconfig

[EMAIL PROTECTED] ~]$ fc-match :lang=fa
roya.ttf: Roya Regular
[EMAIL PROTECTED] ~]$ fc-match :lang=ar
homa.ttf: Homa Regular



So, you have per-language configuration.  Per-script may be a bit
harder.  It may be worth adding script support to fontconfig.
Anyway, combining the language test with rejectfont allows for
per-language blacklisting.

--behdad
http://behdad.org/

Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill
-- Dan Bern, New American Language
___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


Re: improvement of font selection

2006-03-27 Thread Kenichi Handa
In article [EMAIL PROTECTED], Behdad Esfahbod [EMAIL PROTECTED] writes:

 On Mon, 27 Mar 2006, Kenichi Handa wrote:
 Unfortunately, AFAIK, fonts.conf doesn't allow per-script
 (or per-language) settings, and we can't say some font is
 broken or not without specifying a script or language.

 I keep hearing this (this is the third time in the past couple of
 months), but I don't believe it's true.  For example, I just
 hacked a tiny fonts.conf to change font selection for Arabic and
 Persian.

Ah!  You are right.  I was short sight.  I was only thinking
about adding fonts in this kind of parts.

!--
  Serif faces
 --
alias
familyBitstream Vera Serif/family
familyTimes New Roman/family
[...]
/alias

So, I tried this setting to prefer lklug to freeserif for
sinhara.

match
test name=lang
stringsi/string
/test
edit name=family mode=prepend binding=same
stringlklug/string
/edit
/match

Then, fc-match surely returns lklug for :lang=si.  But when
I open a Sinhala file with gedit, it seems that gedit (or
pango; I don't know) prefer freeserif over lklug.  The file
contains this character sequence (hello in Sinhara):

  U+0D86 U+0DBA U+0DD4 U+0DB6 U+0DDD U+0DC0 U+0DB1 U+0DCA

The fonts selected are these (I got this information by
adding printf() in pango/modules/indic/indic-fc.c).

  U+0D86 - LKLUG
  U+0DBA U+0DD4 U+0DB6 - FreeSerif
  U+0DDD - LKLUG
  U+0DC0 U+0DB1 U+0DCA - FreeSerif

lklug contains all corresponding glyphs, but glyphs for
U+0D86 and U+0DDD are missing in freeserif.  Of course the
resulting rendering is incorrect.

---
Kenichi Handa
[EMAIL PROTECTED]
___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


evaluating GTK+ for embedded system design

2006-03-27 Thread peter . greve

Hello,

I am actually planning the GUI for an embedded system driven by a PowerPC.
So GTK++ is one of the options I can go with. I like the GIMP tool, so GTK
should be a good choise.
But I have no feeling concerning resources, CPU load and library size
needed to run a GTK app in the embedded world.
Maybe someone can give me some rough ideas or experiences.

Is GTK a tool for desktop computers only or does is also fit into the
embedded world?
What is the size of all libraries needed to run GTK ?
Do I really need the whole GIMP to run GTK as I red somewhere? (that sounds
very large)
Do I need a lot of CPU power to run a GTK GUI ?
Is there a spezialied version for the embedded world? What is about GTK+
on DirectFB ?
Does GTK needs the X-Window system? Can I go with Tiny-X?
We have to handle a lot of large images on the GUI (1280x1024, 24bit). Is
there a bottleneck in GTK or X11 to handle these data so I should avoid
these tools?

Is there a visualizing tool to help to design the GUI and the underlying
dialogs?

Is there a way to adapt a special graphics processor (coming with an
appropriate API) to an GTK application ?
Do I need to write something like a driver for that graphics processor to
connect to the GTK app? (I red something about GDK)
How can I support special features of that graphics processor like alpha
blending and text anti aliasing? Are these features already supported by
GTK ?

I hope the list of questions is not too long. But any information is
helpful for me to find the right GUI toolkit for my project.
Thank's in advance

Peter

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


GtkTreeView cell_data_func requesting non-visible cells.

2006-03-27 Thread Murray Cumming
Am I right in thinking that GtkTreeView shouldn't call the cell_data
callback for cells that aren't visible?

The attached test case shows it being called for every row (even if only
a few are visible in the GtkScrolledWindow), and then called again for
the visible rows. This is not so nice when I must retrieve the data (in
my custom model) from a database.

-- 
Murray Cumming
[EMAIL PROTECTED]
www.murrayc.com
www.openismus.com
#include gtk/gtk.h

enum
{
  COL_TEST = 0,
  NUM_COLS
} ;

static GtkTreeModel *
create_and_fill_model (void)
{
  GtkTreeStore  *treestore;
  GtkTreeIterchild;
  unsigned long i = 0;

  treestore = gtk_tree_store_new(NUM_COLS,
 G_TYPE_ULONG);

  /* Append a second top level row, and fill it with some data */
  for(i = 0; i  1000; ++i)
  {
gtk_tree_store_append(treestore, child, NULL);
gtk_tree_store_set(treestore, child,
 COL_TEST, i,
 -1);
  }

  return GTK_TREE_MODEL(treestore);
}

void
on_cell_data_func (GtkTreeViewColumn *col,
GtkCellRenderer   *renderer,
GtkTreeModel  *model,
GtkTreeIter   *iter,
gpointer   user_data)
{
  gchar  buf[64];
  gulong test = 0;

  gtk_tree_model_get(model, iter, COL_TEST, test , -1);

  printf(debug: test=%d\n, test);

  g_snprintf(buf, sizeof(buf), test: %d, test);

  g_object_set(renderer, text, buf, NULL);
}


static GtkWidget *
create_view_and_model (void)
{
  GtkTreeViewColumn   *col;
  GtkCellRenderer *renderer;
  GtkWidget   *view;
  GtkTreeModel*model;

  view = gtk_tree_view_new();

  /* --- Column --- */

  col = gtk_tree_view_column_new();

  gtk_tree_view_column_set_title(col, Age);

  /* pack tree view column into tree view */
  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

  renderer = gtk_cell_renderer_text_new();

  /* pack cell renderer into tree view column */
  gtk_tree_view_column_pack_start(col, renderer, TRUE);

  /* connect a cell data function */
  gtk_tree_view_column_set_cell_data_func(col, renderer, on_cell_data_func, NULL, NULL);


  model = create_and_fill_model();

  gtk_tree_view_set_model(GTK_TREE_VIEW(view), model);

  g_object_unref(model); /* destroy model automatically with view */

  gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(view)),
  GTK_SELECTION_NONE);

  return view;
}


int
main (int argc, char **argv)
{
  GtkWidget *window;
  GtkWidget *view;
  GtkWidget *scrolledwindow;

  gtk_init(argc, argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  g_signal_connect(window, delete_event, gtk_main_quit, NULL); /* dirty */

  view = create_view_and_model();

  scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
  gtk_container_add(GTK_CONTAINER(scrolledwindow), view);

  gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);
  gtk_container_add(GTK_CONTAINER(window), scrolledwindow);

  gtk_widget_show_all(window);

  gtk_main();

  return 0;
}

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


Re: GtkTreeView cell_data_func requesting non-visible cells.

2006-03-27 Thread Murray Cumming
On Mon, 2006-03-27 at 17:05 +0200, Murray Cumming wrote:
 Am I right in thinking that GtkTreeView shouldn't call the cell_data
 callback for cells that aren't visible?
 
 The attached test case shows it being called for every row (even if only
 a few are visible in the GtkScrolledWindow), and then called again for
 the visible rows. This is not so nice when I must retrieve the data (in
 my custom model) from a database.

Answering myself, this can be fixed by calling
gtk_tree_view_set_fixed_height_mode(), which in turn needs us to call
gtk_tree_view_column_set_sizing() on each GtkTreeViewColumn.

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

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


Re: evaluating GTK+ for embedded system design

2006-03-27 Thread Tristan Van Berkom

[EMAIL PROTECTED] wrote:

Hello,

I am actually planning the GUI for an embedded system driven by a PowerPC.
So GTK++ is one of the options I can go with. I like the GIMP tool, so GTK
should be a good choise.
But I have no feeling concerning resources, CPU load and library size
needed to run a GTK app in the embedded world.
Maybe someone can give me some rough ideas or experiences.

Is GTK a tool for desktop computers only or does is also fit into the
embedded world?


GTK+ is taylored for the desktop, but that has given me little or
no trouble fitting it in to an embedded environment.

For example... if you're developing full-out colorfull GUIs on
a fixed resolution you might want to work with GtkFixed instead of
variable size placement containers.

I've found this particularly usefull where the graphist will taylor make
the graphic for every single button  background by hand (i.e. the
graphist doesnt want to hear about scaled graphics nonsence... he wants
his button to fit with his background at position x,y).


What is the size of all libraries needed to run GTK ?


I'm not sure... are you using straight-up libc or uClibc or
somthing else ?


Do I really need the whole GIMP to run GTK as I red somewhere? (that sounds
very large)


Umm, no ? ... to run GTK+ you only need GTK+


Do I need a lot of CPU power to run a GTK GUI ?
Is there a spezialied version for the embedded world? What is about GTK+
on DirectFB ?


I dont know if there's a stable version of DirectFB that works with
modern versions of GTK+, if so I'd like to try it out ;-)


Does GTK needs the X-Window system? Can I go with Tiny-X?


Yes for now, and yes (GTK+ with X backend needs an xlib implementation).

although I believe people are working on another backend implementation
for OS X (since you are targeting a Mac right ?).


We have to handle a lot of large images on the GUI (1280x1024, 24bit). Is
there a bottleneck in GTK or X11 to handle these data so I should avoid
these tools?


When you are working with X, you have to keep the round-trips in mind...
and the difference between server and client memory, for example if you
want to animate some frames... loading them as GdkPixmaps first will
be a performance gain.


Is there a visualizing tool to help to design the GUI and the underlying
dialogs?


There is glade, we find it very powerfull since it allows us to
update the look'n'feel of our device simply by updating the graphics
files, the glade xml GUI layout and the gtkrc theme file (no code).


Is there a way to adapt a special graphics processor (coming with an
appropriate API) to an GTK application ?


I dont see that in the scope of a GUI toolkit, this belongs in the
backend (i.e. the drm kernel modules, the dri etc).


Do I need to write something like a driver for that graphics processor to
connect to the GTK app? (I red something about GDK)
How can I support special features of that graphics processor like alpha
blending and text anti aliasing? Are these features already supported by
GTK ?


AFAIK HW acceleration is not used for alphablending using your
typical client-side rendering routines (GdkPixbuf), you'll probably
want to throw in a little GtkGLExt OpenGL sugar on top for that.
(also take a look at what the Xgl people are doing).

(/me is completely clueless when it comes to font rendering in
Cairo too).

Cheers,
  -Tristan
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: evaluating GTK+ for embedded system design

2006-03-27 Thread Tristan Van Berkom

Tristan Van Berkom wrote:

[EMAIL PROTECTED] wrote:


Hello,



Oh yeah, I forgot to say that you should search the list
(either this list or gtk-app-devel-list@gnome.org), since
alot was said on this subject not too long ago.

Cheers,
   -Tristan
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: evaluating GTK+ for embedded system design

2006-03-27 Thread Sven Neumann
Hi,

Tristan Van Berkom [EMAIL PROTECTED] writes:

 I dont know if there's a stable version of DirectFB that works with
 modern versions of GTK+, if so I'd like to try it out ;-)

The DirectFB port has been merged into the CVS repository of GTK+ and
the next stable GTK+ release is likely to have support for DirectFB
0.9.21 or newer.

 Do I need to write something like a driver for that graphics
 processor to connect to the GTK app? (I red something about GDK)
 How can I support special features of that graphics processor like
 alpha blending and text anti aliasing? Are these features already
 supported by GTK ?

GTK+ already uses the GPU if the backend allows it. You can make even
better use of your graphics processor by writing some backend specific
code (using for example the DirectFB API) for critical parts.


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


Re: evaluating GTK+ for embedded system design

2006-03-27 Thread Michael L Torrie
On Mon, 2006-03-27 at 11:18 +0200, [EMAIL PROTECTED]
wrote:
 Hello,
 
 I am actually planning the GUI for an embedded system driven by a PowerPC.
 So GTK++ is one of the options I can go with. I like the GIMP tool, so GTK
 should be a good choise.
 But I have no feeling concerning resources, CPU load and library size
 needed to run a GTK app in the embedded world.
 Maybe someone can give me some rough ideas or experiences.
 
 Is GTK a tool for desktop computers only or does is also fit into the
 embedded world?

The GPE project (http://gpe.handhelds.org/ ) has done a lot of work
making GTK fit well into an embedded environment.  They are targeting
mainly PDAs, but their work will probably adapt well to your needs. They
use the Kdrive X server (very tiny) and uLibc usually.  A window manager
named matchbox is also used to make apps work well on a small PDA
screen.  Sounds like this doesn't really affect you though, so any light
window manager may work for you.

 What is the size of all libraries needed to run GTK ?

Back when I had a Zaurus and was using GPE, the x server itself was
quite small, with the X and gtk libraries just being a few megabytes.

 Do I really need the whole GIMP to run GTK as I red somewhere? (that sounds
 very large)

No GTK is just a toolkit that GIMP is built out of.

 Do I need a lot of CPU power to run a GTK GUI ?

No.

Michael


 Is there a spezialied version for the embedded world? What is about GTK+
 on DirectFB ?
 Does GTK needs the X-Window system? Can I go with Tiny-X?
 We have to handle a lot of large images on the GUI (1280x1024, 24bit). Is
 there a bottleneck in GTK or X11 to handle these data so I should avoid
 these tools?
 
 Is there a visualizing tool to help to design the GUI and the underlying
 dialogs?
 
 Is there a way to adapt a special graphics processor (coming with an
 appropriate API) to an GTK application ?
 Do I need to write something like a driver for that graphics processor to
 connect to the GTK app? (I red something about GDK)
 How can I support special features of that graphics processor like alpha
 blending and text anti aliasing? Are these features already supported by
 GTK ?
 
 I hope the list of questions is not too long. But any information is
 helpful for me to find the right GUI toolkit for my project.
 Thank's in advance
 
 Peter
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

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


Re: Difference between Gnome2.12 and 2.14 in Gtk Drawing Area

2006-03-27 Thread hua zhang

hi all,


I am runing /bin/gnome-perfmeter in JDS,  it crash, dose anyone meet 
this problem in Gnome2.14?
Seems the problem is because there is some change in Gtk Drawing Area 
in GTK+ in 2.14.


Anyone give some comments?

Thanks,
Henry


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


Progressbar in a statusbar?

2006-03-27 Thread Mario Ospelt

Hello,

Actually I would like to know if it is possible to create a progressbar 
in a statusbar. Can a statusbar be divided into several parts, so that 
in each part different information can be shown (and in one of them e.g. 
a progressbar). Or do I have to use a HBox and create several statusbars 
in each of the boxes?


Thanks
Mario
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Progressbar in a statusbar?

2006-03-27 Thread A. Pagaltzis
Hi Mario,

* Mario Ospelt [EMAIL PROTECTED] [2006-03-27 15:30]:
Can a statusbar be divided into several parts, so that in each
part different information can be shown (and in one of them e.g.
a progressbar). Or do I have to use a HBox and create several
statusbars in each of the boxes?

if you check the docs, you will find that GtkStatusbar *is* a
GtkHBox. So you can simply pack widgets into it using the GtkHBox
interface. Be aware that you can only pack them into it to the
right of the status text label widget, though.

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list