RE: Missing stock icons on win32

2007-03-21 Thread Ian Puleston
This works for me:

 

/* Get Icons shown on buttons */

settings = gtk_settings_get_default();

gtk_settings_set_long_property(settings, "gtk-button-images", TRUE,
"main");

 

Ian

 

  _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of G.Slomp - Dynamicc Welding b.v.
Sent: Friday, March 16, 2007 4:02 AM
To: gtkmm-list@gnome.org; gtk-list@gnome.org
Subject: Re: Missing stock icons on win32

 

Hello Surya,

I was facing the same problem when I ported my application to win32, so I
read previous 
messages in the mailinglist like Jonathon said. 
The following solution works and was posted by Alexander:

||  for showing images on buttons in MS-Windows theme you must: 
||  1. open file  ..\GTK\\share\themes\MS-Windows\gtk-2.0\gtkrc 
||  2. change gtk-button-images = 0 to gtk-button-images = 1 

I wasn't to happy about that, since you don't want to manually patch the
gtkrc file to see some icons. There must be a better way! Even changing it
in your application is slightly better. The following code works for me,
but i'm not to happy about it.

//for switching on the stock id's in buttons for gtk+ under windows
GtkSettings *sSettings = gtk_settings_get_default();
gtk_settings_set_string_property(sSettings,  "gtk-button-images", "1",
"C:\\GTK\\share\\themes\\MS-Windows\\gtk-2.0\\gtkrc:5");

Is there any way to change the gtk-button-images setting without changing
the gtkrc file without
using absolute paths? a gtk standard function or something, because I
haven't found it.

Thank in advance,

Gerrie Slomp







Surya Kiran Gullapalli wrote: 

Hi all,

I'm a newbie to gtk/gtkmm. I was trying to get a small application, written
in gtk/gtkmm on windows, up and running.

I've downloaded the gtk+ installer from gladewin32.sf.net website.

 

I was able to get the application running. But the stock icons on the
application are missing. Am i missing something here.

Any help would be greatly appreciated.

 

I'm using vs8 compiler

 

Thanks in advance,

Surya

 





  _  



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

 

-- 


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


Re: Dynamic changing values at a GtkTreeStore with pointers

2007-03-21 Thread Yeti

...and to the `dynamic changing' part, if you change just
something in the data the pointer points to (not the pointer
itself), you have to emit "row-changed" signal on the
corresponding row for the tree view to notice.

Yeti

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


Re: Dynamic changing values at a GtkTreeStore with pointers

2007-03-21 Thread Yeti
On Wed, Mar 21, 2007 at 03:01:39PM -0300, Diogo Ramos wrote:
> This question is cracking my head off. I am days at it and i can't figure it
> out, although I thing a got pretty close.
> Here is the deal:
> I have a GtkTreeStore that I use to show some values.
> This values can be changed.
> So, my idea is to store a pointer at a cell so, every time I change the
> value of my data, the data is changed at the GtkTreeStore throw the pointer.
> I don't know if it's possible, but I am trying, :-)
> My last idea was change the GtkCellRendererText using
> gtk_tree_view_column_set_cell_data_func so, every time the render is called,
> a function of mine would translate a pointer, which is stored in the tree,
> to a text. But it didn't work. It wont stop complaining.
> Here is the menssage: GLib-GObject-WARNING **: unable to set property `text'
> of type `gchararray' from value of type `gpointer'
> I think it's because I set G_TYPE_POINTER at the model but the render I am
> using is for text, although I change the value when It has to be rendered.

If I understand what you are trying to achieve (some code
would be a better description), you probably call

  gtk_tree_view_column_add_attribute(column, renderer, "text", id);

*in addition* to setting up a cell data function.  In that
case don't.  It tells the tree view to attempt to set the
"text" property itself -- which inevitably fails as it
doesn't know how to make a string from a pointer.

On the other hand, if `translate' means just type-cast, then
you should use a G_TYPE_STRING column directly.

Anyway, working code using a G_TYPE_POINTER model column
with a cell data function to render text in
GtkCellRendererText view columns is attached.

Yeti

--
http://gwyddion.net/



#include 

static void
render_name(G_GNUC_UNUSED GtkCellLayout *layout,
GtkCellRenderer *renderer,
GtkTreeModel *model,
GtkTreeIter *iter,
G_GNUC_UNUSED gpointer user_data)
{
GParamSpec *prop;

gtk_tree_model_get(model, iter, 0, &prop, -1);
g_object_set(renderer, "text", prop->name, NULL);
}

static void
render_value_type(G_GNUC_UNUSED GtkCellLayout *layout,
  GtkCellRenderer *renderer,
  GtkTreeModel *model,
  GtkTreeIter *iter,
  G_GNUC_UNUSED gpointer user_data)
{
GParamSpec *prop;

gtk_tree_model_get(model, iter, 0, &prop, -1);
g_object_set(renderer, "text", g_type_name(prop->value_type), NULL);
}

static void
render_owner_type(G_GNUC_UNUSED GtkCellLayout *layout,
  GtkCellRenderer *renderer,
  GtkTreeModel *model,
  GtkTreeIter *iter,
  G_GNUC_UNUSED gpointer user_data)
{
GParamSpec *prop;

gtk_tree_model_get(model, iter, 0, &prop, -1);
g_object_set(renderer, "text", g_type_name(prop->owner_type), NULL);
}

static void
add_column(GtkTreeView *treeview,
   const gchar *title,
   GtkCellLayoutDataFunc func,
   gpointer func_data)
{
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;

renderer = gtk_cell_renderer_text_new();
g_object_set(renderer, "family", "Monospace", NULL);
column = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(column, title);
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(column), renderer, TRUE);
gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(column), renderer,
   func, func_data, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
}

int
main(int argc, char *argv[])
{
GtkWidget *window, *treeview, *scwin;
GtkListStore *store;
GtkTreeIter iter;
GParamSpec **props;
GObjectClass *klass;
GType type;
guint i, n;

gtk_init(&argc, &argv);
type = GTK_TYPE_TREE_VIEW;

store = gtk_list_store_new(1, G_TYPE_POINTER);
klass = G_OBJECT_CLASS(g_type_class_ref(type));
props = g_object_class_list_properties(klass, &n);
for (i = 0; i < n; i++)
gtk_list_store_insert_with_values(store, &iter, G_MAXINT,
  0, props[i],
  -1);
g_free(props);
g_type_class_unref(klass);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), -1, 400);
gtk_window_set_title(GTK_WINDOW(window), g_type_name(type));
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

scwin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scwin),
   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(window), scwin);

treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
gtk_container_add(GTK_CONTAINER(scwin), treeview);
add_column(GTK_TREE_VIEW(treeview), "Name", render_name, NULL

Dynamic changing values at a GtkTreeStore with pointers

2007-03-21 Thread Diogo Ramos

Hello to everybody,

This question is cracking my head off. I am days at it and i can't figure it
out, although I thing a got pretty close.
Here is the deal:
I have a GtkTreeStore that I use to show some values.
This values can be changed.
So, my idea is to store a pointer at a cell so, every time I change the
value of my data, the data is changed at the GtkTreeStore throw the pointer.
I don't know if it's possible, but I am trying, :-)
My last idea was change the GtkCellRendererText using
gtk_tree_view_column_set_cell_data_func so, every time the render is called,
a function of mine would translate a pointer, which is stored in the tree,
to a text. But it didn't work. It wont stop complaining.
Here is the menssage: GLib-GObject-WARNING **: unable to set property `text'
of type `gchararray' from value of type `gpointer'
I think it's because I set G_TYPE_POINTER at the model but the render I am
using is for text, although I change the value when It has to be rendered.

Someone knows how to accomplish that or, at least, if it is ever possible to
do?

Thank you,
Diogo
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Changing GTK2 fonts independly of GNOME tools

2007-03-21 Thread Jernej Simončič
On Sun, 18 Mar 2007 14:09:01 +0300 (MSK), sergey-feo wrote:

> how to change default fonts for gtk2 applications by hands,
> without any GNOME tools? What file and how should be changed?

~/.gtkrc - but it'll be easier if you use


-- 
< Jernej Simončič >< http://deepthought.ena.si/ >
< Contact address: >< jernej simoncic at isg si >

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


Re: GdkPixbuf questions

2007-03-21 Thread Magnus Myrefors
onsdagen den 21 mars 2007 08.50 skrev s88:
Hi,
I tried to use the put_pixel()-function but I encountered problems so I 
switched to the gdk-drawing functions instead. There is also an alternative 
to drawing areas... if you look at the bottom of the reference manual-page 
for GtkDrawingArea.

/Magnus 

> Hi all:
>I have some questions when I using the drawable area with the
> gtk+2.0.
> First, I'm building a data analyzer under thr Linux, so there is a process
> to generate the data and  my analyzer display the data.
> My idea is to use a drawable area(I use the GtkDrawingArea) and get the pix
> buffer of it by the gdk_pixbuf_get_from_drawable(), then my background
> program can fill the pix buffer pix by pix.
>
> Question 1: anytime I fill to the pixbuf, it will rendering the drawing
> area immediately?
> Question 2: the following code segment is what I done until now...what
> should I do?
>
> Thanks.
> Dave.
>
> this function put_pixel is referenced from the GDK Reference Manual
>  34 void
>  35 put_pixel (GdkPixbuf *pixbuf, int x, int y, guchar red, guchar green,
> guchar blue, guchar alpha)
>  36 {
>  37   int width, height, rowstride, n_channels;
>  38   guchar *pixels, *p;
>  39
>  40   n_channels = gdk_pixbuf_get_n_channels (pixbuf);
>  41   g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
>  42   g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
>  43   g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
>  44   g_assert (n_channels == 4);
>  45
>  46   width = gdk_pixbuf_get_width (pixbuf);
>  47   height = gdk_pixbuf_get_height (pixbuf);
>  48
>  49   g_assert (x >= 0 && x < width);
>  50   g_assert (y >= 0 && y < height);
>  51
>  52   rowstride = gdk_pixbuf_get_rowstride (pixbuf);
>  53   pixels = gdk_pixbuf_get_pixels (pixbuf);
>  54
>  55   p = pixels + y * rowstride + x * n_channels;
>  56   p[0] = red;
>  57   p[1] = green;
>  58   p[2] = blue;
>  59   p[3] = alpha;
>  60 }
>
>
> In the callbacks.c
> function on_drawingarea_virtual_LCD_configure_event() is the callback
> function of my drawing area.
>
> 151 gboolean
> 152 on_drawingarea_virtual_LCD_configure_event(GtkWidget
> *widget,
> 153 GdkEventConfigure *event)
> 154 {
> 155   gint x,y;
> 156   GdkPixbuf* virtual_LCD_buf;
> 157   GdkRectangle rect;
> 158
> 159
> 160   if(virtual_LCD_pixmap)
> 161 g_object_unref(virtual_LCD_pixmap);
> 162
> 163   virtual_LCD_pixmap= gdk_pixmap_new(widget->window,
> 164   widget->allocation.width,
> 165   widget->allocation.height,
> 166   -1);
> 167
> 168   gdk_window_get_origin (widget->window, &x, &y);
> 169   rect.x = x;
> 170   rect.y = y;
> 171   gdk_drawable_get_size (GDK_DRAWABLE (widget->window), &rect.width,
> 172   &rect.height);
> 173
> 174   virtual_LCD_buf = gdk_pixbuf_get_from_drawable(NULL,
> 175  virtual_LCD_pixmap,
> 176
> gdk_colormap_get_system(),
> 177  rect.x-x,
> 178  rect.y-y,
> 179  0,
> 180  0,
> 181  rect.width,
> 182  rect.height
> 183  );
> 184 gint i=0;
> 185 // I want to test the put_pixel when the drawing are establish.
> 186 for(i=0;i<100;i++){
> 187 put_pixel (virtual_LCD_buf, i, i, 255-i,255-i,255-(2*i),0);
> 188
> 189
> 190 }
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Creating a Modal Dialog from a Routine Called by g_idle_add()

2007-03-21 Thread Marshall Lake

I've run into a problem with my current project and I'm having difficulty 
finding the cause.  I'm sure the problem is because of a lack of 
understanding on my part concerning GTK.  I'm hoping someone here can prod 
me in the right direction.

I have a routine called by g_idle_add() which updates the contents of an 
already-existing modal dialog with data received from a server software. 
This routine gets called continually until the data from the server 
ceases.  Certain data which is received causes a new modal dialog to be 
created which looks for user input.

Things work fine until a new modal dialog needs to be created.  The dialog 
is created fine and the user input is accepted fine, but I cannot destroy 
the new modal dialog.  And at this point the routine is not called again 
by g_idle_add().  The program hangs, and the only thing I can do is kill 
the new modal dialog which in turn kills the whole program.

Can someone clue me in to what might be going on?

-- 
Marshall Lake -- [EMAIL PROTECTED] -- http://mlake.net
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GdkPixbuf questions

2007-03-21 Thread Michael Ekstrand
On Wed, 2007-03-21 at 15:50 +0800, s88 wrote:
> First, I'm building a data analyzer under thr Linux, so there is a
> process to generate the data and  my analyzer display the data. 
> My idea is to use a drawable area(I use the GtkDrawingArea) and get
> the pix buffer of it by the gdk_pixbuf_get_from_drawable(), then my
> background program can fill the pix buffer pix by pix. 
> 
> Question 1: anytime I fill to the pixbuf, it will rendering the
> drawing area immediately? 

As Yeti pointed out, there is no such thing as the "pixbuf of the
drawable".  gdk_pixbuf_get_from_drawable() is only to capture a snapshot
of a drawable's current state (it's particularly useful when you're
working with offscreen drawables).

If you want to draw in the drawing area, you can either do what Yeti
suggested, building a pixbuf and drawing it with gdk_draw_pixbuf().
However, unless you must build pixel-by-pixel, this is likely to be
slow.  If you can draw in lines, rectangles, curves, etc., it's probably
better to use the appropriate Cairo calls (or gdk_draw_*(), if you must
target GTK+ < 2.8) in the expose handler of your drawing area, or use
them on an off-screen drawable (GdkPixmap) and then send this to your
drawing area with gdk_draw_drawable() in the expose handler.

- Michael

-- 
Michael Ekstrand
Research Assistant, Scalable Computing Laboratory
Goanna, compute cluster and InfiniBand network monitor tool:
http://www.scl.ameslab.gov/Projects/Monitor/

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


Re: Glade vs Hand code

2007-03-21 Thread Tristan Van Berkom
On Wed, 2007-03-21 at 18:08 +1100, Andrew Cowie wrote:
[...]
> So then in a new application I decided "well, forget Glade" and started
> doing everything programmatically. And then I realized that I was having
> to deal with coming up with variable names for each and every bloody
> Label, and that was a real pain in the ass.
> 
> So the conclusion I settled on was to use Glade for as much scaffolding
> as possible, thus saving the object pressure of proxies being created
> for not much at all, but not to try and do anything even remotely
> complicated in Glade, preferring to hand off and switch to code at that
> point.

This sounds alot like how I usually use glade (and I do use very complex
projects, containing multiple toplevels all with complex
subhierarchies).

Basically I usually use an object/struct that defines that part of the
interface (usually its by toplevel - see the devhelp application code
for a very good example of the same technique) and I just resolve the
members that I need at load time - unref the GladeXML and connect
to any signals.

I agree & disagree with David, I think glade is fine for huge complex
projects but I do agree that glade is not right for data driven
parts of the interface - in which case you'll always need code
to generate the interface well. otoh a good combination can be found,
for instance you can use glade to create a template subhierarchy
that represents only one element of a list - your data-driven
program then uses glade to generate that for each item as you
pull them out of a DB or whatever (ofcourse this particular 
design is not good for huge datasets but its just an example :) ).

Cheers,
   -Tristan


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


Gtk combo

2007-03-21 Thread bradleyd
Hello everyone,
I am stuck on a Gtk combo. I have this code below on a button signal 
connect.
Code:

val = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(data->combo)->entry));
  if ( val == "Support Alpha" ){
printf("hi1"\n);
  }
  else if (val == "Support Bravo"){
 printf("hi2"\n);
  }
  else if ("val == "Support Charlie"){
 printf("hi3"\n);
  }

There are three entries in the combo box. When the user selects one and 
the presses button I need to distinguish between which one the user 
selected.
any help would be appreciated.
Thanks,
brad
DISCLAIMER: Under Florida Law (FS668.6076), e-mail addresses are public 
record.If you do not want your e-mail address released in response to a 
public-records request,do not send electronic mail to this entity. Instead, 
contact this office by phone or in writing.
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Cross compilation issue (Gtk+tinyX)

2007-03-21 Thread Shyjumon N.
Hi group,
   I was trying to cross compile GTK with tinyx backend. When i cross compiling 
xlibs, i am getting the following errors. As i understood, the files ccimake 
and imake are arm executables, since i am setting up cross development platform 
in my i386, why it sholud run these two. Is there any way to overcome this. Or 
is there any document or help from any body who did the same is welcome.
Please see the error message below.

[EMAIL PROTECTED] xc]# make World CROSSCOMPILEDIR=/root/crslib/arm/3.3.1/bin

Building Release 6.7.

I hope you checked the configuration parameters in ./config/cf
to see if you need to pass BOOTSTRAPCFLAGS.

Tue Mar 20 16:07:17 IST 2007

cd ./config/imake && make  -f Makefile.ini BOOTSTRAPCFLAGS="" 
CC="arm-linux-gcc" clean
make[1]: Entering directory `/root/softwares/tinyx_gtk+res/xc/config/imake'
rm -f ccimake imake.o imake
rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a tags TAGS make.log \#*
rm -f -r Makefile.proto Makefile Makefile.dep bootstrap
rm -f imakemdep_cpp.h
make[1]: Leaving directory `/root/softwares/tinyx_gtk+res/xc/config/imake'
make  Makefile.boot
make[1]: Entering directory `/root/softwares/tinyx_gtk+res/xc'
cd ./config/imake && make -w -f Makefile.ini BOOTSTRAPCFLAGS="" 
CC="arm-linux-gcc"
make[2]: Entering directory `/root/softwares/tinyx_gtk+res/xc/config/imake'
making imake with BOOTSTRAPCFLAGS= and 
CROSSCOMPILEFLAGS=-DCROSSCOMPILEDIR="/root/crslib/arm/3.3.1/bin" in config/imake
arm-linux-gcc -o ccimake -DCROSSCOMPILEDIR=\"/root/crslib/arm/3.3.1/bin\"  -O 
-I../../include -I../../imports/x11/include/X11 ccimake.c
if [ -n "/root/crslib/arm/3.3.1/bin" ] ; then \
/root/crslib/arm/3.3.1/bin/arm-linux-gcc -E `./ccimake` \
-DCROSSCOMPILE_CPP imakemdep.h > imakemdep_cpp.h; \
else touch imakemdep_cpp.h; fi
/bin/sh: ./ccimake: cannot execute binary file
arm-linux-gcc -c  -O -I../../include -I../../imports/x11/include/X11 
`./ccimake` imake.c
/bin/sh: ./ccimake: cannot execute binary file
arm-linux-gcc -o imake  -O -I../../include -I../../imports/x11/include/X11 
imake.o
make[2]: Leaving directory `/root/softwares/tinyx_gtk+res/xc/config/imake'
rm -f ./config/makedepend/Makefile.proto
./config/imake/imake -I./config/cf  -s ./config/makedepend/Makefile.proto -f 
./config/makedepend/Imakefile -DTOPDIR=../.. -DCURDIR=./config/makedepend
./config/imake/imake: ./config/imake/imake: cannot execute binary file
make[1]: *** [config/makedepend/Makefile.proto] Error 126
make[1]: Leaving directory `/root/softwares/tinyx_gtk+res/xc'
make: *** [World] Error 2
[EMAIL PROTECTED] xc]#


With regds,

 

Shyjumon N
Mobile: +91-9945006965


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


Re: Missing stock icons on win32

2007-03-21 Thread G.Slomp - Dynamicc Welding b.v.




Hello Surya,

I was facing the same problem when I ported my application to win32, so
I read previous 
messages in the mailinglist like Jonathon said. 
The following solution works and was posted by Alexander:

||  for showing images on buttons in MS-Windows theme you must:

||  1. open file  ..\GTK\\share\themes\MS-Windows\gtk-2.0\gtkrc

||  2. change gtk-button-images = 0 to gtk-button-images = 1


I wasn't to happy about that, since you don't want to manually patch the
gtkrc file to see some icons. There must be a better way! Even changing
it
in your application is slightly better. The following code works for me,
but i'm not to happy about it.

    //for switching on the stock id's in buttons for gtk+ under
windows    
    GtkSettings *sSettings = gtk_settings_get_default();
    gtk_settings_set_string_property(sSettings,  "gtk-button-images",
"1", "C:\\GTK\\share\\themes\\MS-Windows\\gtk-2.0\\gtkrc:5");

Is there any way to change the gtk-button-images setting without
changing the gtkrc file without
using absolute paths? a gtk standard function or something, because I
haven't found it.

Thank in advance,

Gerrie Slomp







Surya Kiran Gullapalli wrote:

  Hi all,
  I'm a newbie to gtk/gtkmm. I was trying to get a small
application, written in gtk/gtkmm on windows, up and running.
  I've downloaded the gtk+ installer from gladewin32.sf.net
website.
   
  I was able to get the application running. But the stock icons
on the application are missing. Am i missing something here.
  Any help would be greatly appreciated.
   
  I'm using vs8 compiler
   
  Thanks in advance,
  Surya
  

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



-- 



begin:vcard
fn:Gerrie Slomp - Dynamicc Welding b.v.
n:Slomp;Gerrie
email;internet:[EMAIL PROTECTED]
tel;work:+31(0) 524 580 825
tel;fax:+31(0) 524 560 612
version:2.1
end:vcard

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


Changing GTK2 fonts independly of GNOME tools

2007-03-21 Thread sergey-feo
1. Sorry for my bad English :-)
2. The question is simple:
how to change default fonts for gtk2 applications by hands,
without any GNOME tools? What file and how should be changed?
3. I think answer for this question should be placed into
FAQ. I try to find answer by google. Many people have such questions,
and main sentenses is "gtk2 ignores my gtkrc file" and 
"themes? what themes? I just want to change default fonts".

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


Re: Cairo Crash when Displaying Remotely to Solaris 8

2007-03-21 Thread Jonathan Chambers

Hi,
I see the same exact problem. I see it with Gtk or mono
System.Windows.Forms apps, both of which use cairo. I do not see it with Qt
apps, so I am fairly certain this is a cairo issue (perhaps endianess?).

- Jonathan

On 3/17/07, Richard Boaz <[EMAIL PROTECTED]> wrote:


Hi,

My program is crashing with the traceback provided below when executed
under the following scenario:

1) user is logged into a RedHat Enterprise Linux 4 machine via ssh -X
2) user executes the program for display back onto his machine
3) user machine = Sun Sparc architecture, running Solaris 8

This same scenario, executing remotely while displaying locally, works
without issue when the display machine is either another Linux machine or
a Mac OS X machine (either platform).

The program is crashing at startup (in call to gtk_widget_show_all()), and
as can be seen from the traceback, is failing in its calls to cairo.

I conclude that there is some issue related to the combination of calls to
cairo and the Solaris 8 machine, though this confuses me a bit.  Is it not
so that when executing and displaying on different machines, all calls to
graphics libraries not XLib occur on the executing machine, while all
calls to XLib itself occur on the displaying machine?  If this is true,
then why would calls to cairo fail only when displaying back to a Solaris
8 box?

On the other hand, that said, perhaps my assumptions are wrong and I'm
missing something fundamental here.

Anyone understand this and/or able to identify where this scenario is
going wrong and why?  And, the obvious follow-up, what is required to get
this to work as it should?

thanks in advance for any pointers,

richard

=== TRACEBACK ==

[sh]$ gdb pqlx
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/libthread_db.so.1".

(gdb) r

Starting program: /usr/local/bin/pqlx
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xd82000
[Thread debugging using libthread_db enabled]
[New Thread -1208650048 (LWP 4725)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208650048 (LWP 4725)]
0x in ?? ()

#0  0x in ?? ()
#1  0x438c2589 in _cairo_pixman_composite_triangles () from
/usr/lib/libcairo.so.2
#2  0x438c315f in _cairo_pixman_composite_triangles () from
/usr/lib/libcairo.so.2
#3  0x438b5aa2 in _cairo_pixman_composite () from /usr/lib/libcairo.so.2
#4  0x4389a4bf in cairo_font_options_create () from /usr/lib/libcairo.so.2
#5  0x438a02ef in cairo_surface_reference () from /usr/lib/libcairo.so.2
#6  0x438976bf in cairo_font_options_create () from /usr/lib/libcairo.so.2
#7  0x43897925 in cairo_font_options_create () from /usr/lib/libcairo.so.2
#8  0x438982fc in cairo_font_options_create () from /usr/lib/libcairo.so.2
#9  0x43898527 in cairo_font_options_create () from /usr/lib/libcairo.so.2
#10 0x438986da in cairo_font_options_create () from /usr/lib/libcairo.so.2
#11 0x43891779 in cairo_stroke_preserve () from /usr/lib/libcairo.so.2
#12 0x438917a2 in cairo_stroke () from /usr/lib/libcairo.so.2
#13 0x0027cdca in clearlooks_draw_progressbar_trough ()
   from /usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so
#14 0x00277e15 in clearlooks_style_register_type ()
   from /usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so
#15 0x436b6dca in gtk_paint_box () from /usr/lib/libgtk-x11-2.0.so.0
#16 0x4368deb5 in gtk_progress_bar_set_bar_style () from
/usr/lib/libgtk-x11-2.0.so.0
#17 0x4368cb2c in gtk_progress_configure () from /usr/lib/libgtk-
x11-2.0.so.0
#18 0x4368ce2c in gtk_progress_configure () from /usr/lib/libgtk-
x11-2.0.so.0
#19 0x432ad1d9 in g_cclosure_marshal_VOID__VOID () from
/usr/lib/libgobject-2.0.so.0
#20 0x4329e7a9 in g_value_set_static_boxed () from
/usr/lib/libgobject-2.0.so.0
#21 0x4329ff8b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#22 0x432b12ca in g_signal_override_class_closure () from
/usr/lib/libgobject-2.0.so.0
#23 0x432b2347 in g_signal_emit_valist () from /usr/lib/libgobject-
2.0.so.0
#24 0x432b2509 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#25 0x437565f6 in gtk_widget_realize () from /usr/lib/libgtk-x11-2.0.so.0
#26 0x43756899 in gtk_widget_map () from /usr/lib/libgtk-x11-2.0.so.0
#27 0x435d37b5 in gtk_container_child_type () from
/usr/lib/libgtk-x11-2.0.so.0
#28 0x43596631 in gtk_box_pack_start_defaults () from
/usr/lib/libgtk-x11-2.0.so.0
#29 0x435d10db in gtk_container_forall () from /usr/lib/libgtk-
x11-2.0.so.0
#30 0x435d376b in gtk_container_child_type () from
/usr/lib/libgtk-x11-2.0.so.0
#31 0x432ad1d9 in g_cclosure_marshal_VOID__VOID 

Re: GdkPixbuf questions

2007-03-21 Thread Yeti
On Wed, Mar 21, 2007 at 03:50:44PM +0800, s88 wrote:
>   I have some questions when I using the drawable area with the
> gtk+2.0.
> First, I'm building a data analyzer under thr Linux, so there is a process
> to generate the data and  my analyzer display the data.
> My idea is to use a drawable area(I use the GtkDrawingArea) and get the pix
> buffer of it by the gdk_pixbuf_get_from_drawable(),

There is no such thing as `the pixbuf of it'.  Every time
you call gdk_pixbuf_get_from_drawable() a new image of the
drawable is created and put to the pixbuf.  Read the first
paragraph of gdk_pixbuf_get_from_drawable() description.
And if parts of the drawable are obscured, you get garbage
there -- see paragraphs 5 and 6.  And the other paragraphs
too.

> then my background
> program can fill the pix buffer pix by pix.

You can do anything you wish with the pixbuf, but it will
have no effect on the widget.

> Question 2: the following code segment is what I done until now...what
> should I do?

If you want to display a pixbuf, just create a pixbuf with
gdk_pixbuf_new(), fill its contents and draw it with
gdk_draw_pixbuf() in the expose event of the widget.

Yeti

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