Re: GTK Coding Conventions

2005-04-12 Thread Stefan Kost
Hi Rick,
look at the GObject tutorial:
http://www.le-hacker.org/papers/gobject/
If you design your application in a oo-fashion, all global variables you have is 
an application object handle. That in turn knows the rest. Its like a tree, 
where one tree-node knows stuff about what it is responsible for and who is its 
parent.
Generally OO design needsa some thinking, like what parts, modules my app 
consist of and so on. It definitely pays back, when the app get larger.
A keyword to look out for is: 'Design Patterns'.

I myself look in apps like e.g gedit.
Ciao
  Stefan
Hello,
I am a noob to GTK+ programming, and GUI programming in general. I have
worked through the example, and done a few simple programs of my own.
I would like to improve my programs. Particularly I would like to do
away with , or at least reduce, the mumber of global variables. I would
also like to make my code more modular and object oriented.  Can anyone
recommend any good examples, or simple programs, that I could study to
learn good GTK+ coding practices?
Rick
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gnome desktop crashing!

2005-04-12 Thread APR Trainees
hi friends,

I used gconftool-2 to first shutdown the gconfd and then made changed
to the applet id list to add an applet to the panel on startup
however when i do this form the root and rebbot thje machine
again.the desktop goes haywire .Its completely destroyed.cant
see anything but some gray and black and red patches (which look like
a part of some error messages also!!) as if its hanged.

could some1 shed some light on why its happening!
i'm using redhat.

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


gnome desktop crashing!

2005-04-12 Thread APR Trainees
hi friends,

I used gconftool-2 to first shutdown the gconfd and then made changed
to the applet id list to add an applet to the panel on startup
however when i do this form the root and rebbot thje machine
again.the desktop goes haywire .Its completely destroyed.cant
see anything but some gray and black and red patches (which look like
a part of some error messages also!!) as if its hanged.

could some1 shed some light on why its happening!
i'm using redhat.

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


GTK+ 2.6.7 released

2005-04-12 Thread Matthias Clasen
GTK+ 2.6.7 is now available for download at:

 ftp://ftp.gtk.org/pub/gtk/v2.6/
 http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.6/

gtk+-2.6.7.tar.bz2   md5sum: b89bf892a0dee943f98b4caa12f773c8
gtk+-2.6.7.tar.gzmd5sum: 5e9629c573a3e2b234f5c225d029eefd

This is a bug fix release and is source and binary compatible
with 2.6.0.


What is GTK+


GTK+ is a multi-platform toolkit for creating graphical user
interfaces. Offering a complete set of widgets, GTK+ is suitable for
projects ranging from small one-off tools to complete application
suites.

GTK+ has been designed from the ground up to support a range of
languages, not only C/C++. Using GTK+ from languages such as Perl and
Python (especially in combination with the Glade GUI builder) provides
an effective method of rapid application development.

GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
pdevelopers, including those developing proprietary software, without
any license fees or royalties. 


Where to get more information about GTK+


Information about GTK+ including links to documentation can be
found at:
 
http://www.gtk.org/

An installation guide for GTK+ 2.6 is found at:

 http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html

Common questions:
 
http://developer.gnome.org/doc/API/2.0/gtk/gtk-question-index.html
http://www.gtk.org/faq/


Overview of Changes from GTK+ 2.6.6 to GTK+ 2.6.7
=
* Revert two fixes from 2.6.5 which were causing
  problems  [Crispin Flowerday]
* New and updated translations (bg,ja,ko,ca)


April 13, 2005


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


Re: OT: Processor register size

2005-04-12 Thread Liam R. E. Quin
On Mon, 2005-04-11 at 20:20 -0500, Timothy Flechtner wrote:
> wouldn't a pointer be register size?

Depends on the CPU architecture.  E.g. some have
a mixture of register sizes (especially 8-bit CPUs,
but also 16-bit ones).  On the PDP11 series an int
was typically 16 bits and so was a register, but
a pointer would be 32 bits (and so was a long).


> >>typedef unsigned char byte;
> >>byte word[sizeof(float)];

A float almost never fits into a register (except on
the FPU of course), but that expression will get you the numbe
of bytes that a float uses in memory, which seems to be
what you want.  You could also use
#define FLOAT_BYTES sizeof(float)

Liam


-- 
Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin
Pictures from old books: http://www.holoweb.net/~liam/pictures/oldbooks/
IRC (chat) programs: www.ircreviews.org/clients/

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


running a function

2005-04-12 Thread timothy johnson
I am new to gtk, and trying my hand at writing a mp3player, I am
working on the point of the player that when one song is done playing
it will load and play the next song. How do I run a test function
every couple milli seconds to check to see if it is still playing or
not? is g_timeout_add() what I need to use? Any example code?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GTK Coding Conventions

2005-04-12 Thread Rick Sutphin
Hello,
I am a noob to GTK+ programming, and GUI programming in general. I have
worked through the example, and done a few simple programs of my own.
I would like to improve my programs. Particularly I would like to do
away with , or at least reduce, the mumber of global variables. I would
also like to make my code more modular and object oriented.  Can anyone
recommend any good examples, or simple programs, that I could study to
learn good GTK+ coding practices?
Rick
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Fwd: Popup Menu

2005-04-12 Thread César Leonardo Blum Silveira
Nobody's getting the point.

1) I WANT TO write that program, because I always want to learn more
2) I don't need to capture the root window's mouse events, what
happens is that when an iDesk icon is right-clicked it lanches a new
program, and that "program" will be my menu
3) I don't have money to get my girlfriend a new computer
4) I want to install Slackware there, in orther to customize it for her machine

Thanks anyways,

César


On 4/12/05, Antonio Gomes <[EMAIL PROTECTED]> wrote:
> César,
>
> instead you customize a Window Manager, why don't you try to use the
> "Familix Linux" . It's the linux most similar  with Windows that I
> ever see 8-)
>
> It can find out Windows Networks, and so on ... Familix was entirely
> built in Brazil, therefore your official web site is in Portuguese ...
> but if you don't speak portuguese, you can at least see some
> screenshot of it ...
> .
>
> I've already implement it in a "advocacy office" , durring a migration
> process (win -> linux), aiming to reduce costs like win and office
> licenses.
>
> So ... you know :) it just a tip ...
>
> Best Regards
>
> On 4/12/05, Nigel Tao <[EMAIL PROTECTED]> wrote:
> > On Mon, 2005-04-11 at 21:23 -0300, César Leonardo Blum Silveira wrote:
> > > Is there a way I can make my application be just a popup menu?
> > > I mean, when the user opens it, there is no window, it automatically
> > > pops up a menu right where the mouse pointer is. Is that possible?
> >
> > Apologies for hijacking your thread, but on a related question - my
> > applet is nothing but an gtk.Entry, which already has a popup menu (with
> > Cut, Copy, ..., "Input Methods->" items).  How can I get the gtk.Menu
> > object when it pops (or otherwise add extra gtk.MenuItems to the popup
> > menu)?  I want to add "Preferences" and "About" items, without losing
> > the existing Cut, Copy, etc.
> >
> > tia,
> > Nigel.
> >
> > ___
> > gtk-app-devel-list mailing list
> > gtk-app-devel-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> >
>
> --
> Antonio Gomes
> E-mail: [EMAIL PROTECTED]
> Embedded Linux Lab - 10LE
> INdT - Instituto Nokia de Tecnologia (Manaus/Br)
> NOKIA's Technology Institute
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Link error: gdk_display_new

2005-04-12 Thread Antonio Gomes
Hi PSM,

take a look at 
and look for 'gdk_display_new' ... I think you are trying to use a
function specific of the 2.6.x series of GTK :S.

Try to upgrade your gtk, but note: it's it could became a hard task in
SuSE :\ !!

Best Regards

On 4/5/05, Paul Santa Maria <[EMAIL PROTECTED]> wrote:
> Hi -
> 
> I'm a complete newbie to GTK+:
> 
> We're writing a Linux-based app; one of our requirements is that the GUI must
> be able to address multiple different video cards independently.
> 
> SuSE 9.2 recognizes each of the three video cards in our system, and addresses
> them as:
> 
>   unix:0.0
>   unix:0.1
>   ... and ...
>   unix:0.2
> 
> So far, so good.
> 
> I've installed the default GTK+/GDK libraries that come with SuSE 9.2 (GTK2,
> 2.4.9-10.1), and I'm trying to adapt the sample code in "Multi-head Support
> Overview".  It's failing with this link error:
> 
>   make =>
> gcc  -g -O2   -o hello_glade  main.o support.o interface.o callbacks.o \
>   -Wl,--export-dynamic -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 \
>   -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 \
>   -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
> main.o(.text+0xb2): In function `main':
> /home/paulsm/proj/hello_glade/src/main.c:56:
>   undefined reference to `gdk_display_new'
> 
> I checked all the libraries in /opt/gnome/lib and all the headers in
> /opt/gnome/include/gdk, but I cannot find "gdk_display_new()".
> 
> Any idea what I'm doing wrong?  What I should do to resolve the problem?
> 
> Thank you very much in advance .. PSM
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 


-- 
Antonio Gomes
E-mail: [EMAIL PROTECTED]
Embedded Linux Lab - 10LE
INdT - Instituto Nokia de Tecnologia (Manaus/Br)
NOKIA's Technology Institute
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Popup Menu

2005-04-12 Thread Antonio Gomes
César, 

instead you customize a Window Manager, why don't you try to use the
"Familix Linux" . It's the linux most similar  with Windows that I
ever see 8-)

It can find out Windows Networks, and so on ... Familix was entirely
built in Brazil, therefore your official web site is in Portuguese ...
but if you don't speak portuguese, you can at least see some
screenshot of it ...
.

I've already implement it in a "advocacy office" , durring a migration
process (win -> linux), aiming to reduce costs like win and office
licenses.

So ... you know :) it just a tip ...

Best Regards

On 4/12/05, Nigel Tao <[EMAIL PROTECTED]> wrote:
> On Mon, 2005-04-11 at 21:23 -0300, César Leonardo Blum Silveira wrote:
> > Is there a way I can make my application be just a popup menu?
> > I mean, when the user opens it, there is no window, it automatically
> > pops up a menu right where the mouse pointer is. Is that possible?
> 
> Apologies for hijacking your thread, but on a related question - my
> applet is nothing but an gtk.Entry, which already has a popup menu (with
> Cut, Copy, ..., "Input Methods->" items).  How can I get the gtk.Menu
> object when it pops (or otherwise add extra gtk.MenuItems to the popup
> menu)?  I want to add "Preferences" and "About" items, without losing
> the existing Cut, Copy, etc.
> 
> tia,
> Nigel.
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 


-- 
Antonio Gomes
E-mail: [EMAIL PROTECTED]
Embedded Linux Lab - 10LE
INdT - Instituto Nokia de Tecnologia (Manaus/Br)
NOKIA's Technology Institute
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Widget sizes

2005-04-12 Thread Stéphane Konstantaropoulos
Hello All,

I have implemeted a widget and I'd like it to notify its container of
its preferred size but I do not want this size to be compulsory.

So I override the size_request method of the widget, where I set the
GtkRequisition.

Fine, it works, when I put that widget into a GtkVBox then into a
GtkWindow it resizes the whole thing when the app calls
gtk_widget_size_request(); then gtk_widget_queue_resize() on the widget;

But, the widget cannot be resized to smaller than that afterwards, it
works if I make the window bigger but it is stuck to the requested size
as the smallest size.

Is there a workaround? (without using calls to the toplevel window)
Perhaps in the GtkVBox that contains the widget?

Thanks for helping,
-- 
Stéphane Konstantaropoulos
- Research Student, Computer Science
-- University of York, http://www-users.cs.york.ac.uk/~stephane
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: threads gdk/Xlib

2005-04-12 Thread Stéphane Konstantaropoulos
On Mon, 2005-04-11 at 09:51 -0400, Owen Taylor wrote:
> On Mon, 2005-04-11 at 13:06 +0100, Stéphane Konstantaropoulos wrote:
> > Hello all,
> > 
> > I am programming a testing app for a gtk widget that embeds Xine and I
> > am facing little problems with threads and XLib: the application crashes
> > all the time whith "Xlib: unexpected async reply"
> > 
> > It got fixed only when I called the following functions in the following
> > sequence:
> > 
> > XInitThreads ();
> > g_thread_init(NULL);
> > gdk_threads_init();
> > gtk_init(&argc, &argv);
> > 
> > There is no need to put gtk_main() between gdk_threads_enter() and 
> > gdk_threads_leave().
> 
> If you use a debugging threads library, you'll then see warnings about
> "unlocking an unlocked mutex" or similar. If you call gdk_threads_init
> (), then all calls to GDK must be within the GDK lock. On the other
> hand, there is no reason to call gdk_threads_init() if you are using
> GDK from only one thread.
> 
> > To sum up: there are calls to Xlib from other threads, created by Xine. Gdk 
> > also calls Xlib but only from the
> > main thread (my app does not create any). Xine always calls XLockDisplay() 
> > before doing any of these calls.
> > 
> > Question then:
> > 
> > - Does Gdk call XLockdisplay() at all?
> 
> When necessary, yes. You only need to call XLockDisplay() if you are
> doing incredibly grotty low-level Xlib programming. GDK does some of
> that, it's conceivable that Xine does too, though I rather doubt it.

> > - Do you need to call XInitThreads() before gdk_threads_init() ? -> that's 
> > the way it seems to work for me.
> 
> No, I don't think so. You *do* need to call XInitThreads before making
> any other GDK/GTK+ calls (like gtk_init() 
> since they might call Xlib functions)

Great! No need for Gdk threads so I removed the call to gdk_threads_init
() and just kept the call to XInitThreads() before doing anything else
and -- it works...

Thanks a lot Owen,

-- 
Stéphane Konstantaropoulos
- Research Student, Computer Science
-- University of York, http://www-users.cs.york.ac.uk/~stephane
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: GtkTextView and scrolled window

2005-04-12 Thread Mishael A Sibiryakov
Ð ÐÑÑ, 12/04/2005 Ð 11:55 -0700, Paolo Costabel ÐÐÑÐÑ:
> I that case you need to use
> 
> gtk_text_view_scroll_to_iter
> 
> to force an update.

Thanks, it works :)

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


debugging font problems

2005-04-12 Thread Dan McMahill
I recently updated everything (fontconfig, glib, atk, pango, gtk, etc)
on my solaris-9 box with openwin.  Now I can longer get any fonts to
display in gtk2 programs.  Not even the gtk-demo program.  So until
I can fix this, I can't write gtk programs anymore and use them!

I've re-run fc-cache with 'fc-cache -f -v' to make sure it completes
as it has in the past.  Then I tried running the gtk-demo program
on both the solaris-9 box and a NetBSD/alpha box.  What I found is:


client  Xserver Result
--  --- ---
gtk-demo,   Solaris-9,  seems ok
NetBSD/alphaopenwin


gtk-demo,   Solaris-9,  no fonts
Solaris-9/sparc openwin


gtk-demo,   Win XP  seems ok
NetBSD/alphaX/deep


gtk-demo,   Win XP, seems ok
Solaris-9/sparc X/deep

gtk1 programs   Solaris-9   all are fine
on any machine  openwin

so there seems to be something about the client and
X server being on the solaris box.

Any suggestions on how to debug whats going on?  

I'm using version 2.6.4 of gtk2, 2.3.0 of fontconfig, pango-1.8.1,
not sure what other versions are of use.

Thanks
-Dan

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


Re: GtkTextView and scrolled window

2005-04-12 Thread Paolo Costabel
I that case you need to use
gtk_text_view_scroll_to_iter
to force an update.
Mishael A Sibiryakov wrote:
Ð ÐÑÑ, 12/04/2005 Ð 10:15 -0700, Paolo Costabel ÐÐÑÐÑ:
 

Mishael A Sibiryakov wrote:
   

Hello.
I have a two small question about GtkTextView and about how it works
with scrolled window widget.
1. I have a TextView witch is placed to scrolled window (this is simple
chat window), and i want to do automatic scroll is new message inserted
to TextBuffer. How can i do that ? I try to read about GtkAdjustment but
i have not absolutely understood how i can do that.

 

When you enter text in a TextView, it will automatically scroll. Look at 
the gtk-demo for an example.
   

It is not editable buffer. This is a chat messages buffer, something
like irc and etc. And it does not want scroll, differently i would not
write :)
Look at the code.
   scroll = gtk_scrolled_window_new(NULL, NULL);
   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
  GTK_POLICY_AUTOMATIC,
  GTK_POLICY_AUTOMATIC);
   hub->gui.messb = (GtkWidget *)gtk_text_buffer_new(NULL);
   gtk_text_buffer_get_start_iter(GTK_TEXT_BUFFER(hub->gui.messb),
&hub->gui.iter);
   text =
gtk_text_view_new_with_buffer(GTK_TEXT_BUFFER(hub->gui.messb));
   gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
   gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
   gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
   gtk_container_add(GTK_CONTAINER(scroll), text);
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: GtkTextView and scrolled window

2005-04-12 Thread Mishael A Sibiryakov
Ð ÐÑÑ, 12/04/2005 Ð 10:15 -0700, Paolo Costabel ÐÐÑÐÑ:
> Mishael A Sibiryakov wrote:
> 
> >Hello.
> >
> > I have a two small question about GtkTextView and about how it works
> >with scrolled window widget.
> >
> > 1. I have a TextView witch is placed to scrolled window (this is simple
> >chat window), and i want to do automatic scroll is new message inserted
> >to TextBuffer. How can i do that ? I try to read about GtkAdjustment but
> >i have not absolutely understood how i can do that.
> >
> >  
> >
> When you enter text in a TextView, it will automatically scroll. Look at 
> the gtk-demo for an example.

It is not editable buffer. This is a chat messages buffer, something
like irc and etc. And it does not want scroll, differently i would not
write :)

Look at the code.

scroll = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
   GTK_POLICY_AUTOMATIC,
   GTK_POLICY_AUTOMATIC);

hub->gui.messb = (GtkWidget *)gtk_text_buffer_new(NULL);
gtk_text_buffer_get_start_iter(GTK_TEXT_BUFFER(hub->gui.messb),
&hub->gui.iter);
text =
gtk_text_view_new_with_buffer(GTK_TEXT_BUFFER(hub->gui.messb));
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);

gtk_container_add(GTK_CONTAINER(scroll), text);


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


Re: GtkTextView and scrolled window

2005-04-12 Thread Paolo Costabel
Mishael A Sibiryakov wrote:
Hello.
I have a two small question about GtkTextView and about how it works
with scrolled window widget.
1. I have a TextView witch is placed to scrolled window (this is simple
chat window), and i want to do automatic scroll is new message inserted
to TextBuffer. How can i do that ? I try to read about GtkAdjustment but
i have not absolutely understood how i can do that.
 

When you enter text in a TextView, it will automatically scroll. Look at 
the gtk-demo for an example.

2. How i can do "messages limit" ? Now i can count lines in TextBuffer
and remove line on first TextIter if count is more than limit. Is this
correct, or anybody know most beautiful solution ?
 

Yes, this will work.
Sorry for my poor english.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


changing keyboard on the fly

2005-04-12 Thread Boncek, John
I've searched high and low and can't find any information about how to
change keyboard layout within a GTK application.  I don't need to remap
keys or anything similar.  I want everything to be standard wrt the
keyboard in question, but I need to allow a user to select which of a
number of standard keyboard layouts they are using, including US, Greek,
Russian, etc.  I've found some information about GdkKeymap and how it's
used to interpret keyboard state but nothing about selecting a different
keyboard.  The application needs to do this because it's an embedded
turnkey app running under IceWM; the IceWM environment will not be exposed
to the user.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: (no subject)

2005-04-12 Thread Antonio Gomes
Hi ,  

this error message is returned because this function is not defined in
the gtk 1.2.1 !!

take a look at ,
GTK+ reference manual for 1.X series ... you will see that there is no
'gtk_window_get_focus', but another related fuctions :S

If you port your app to GTK 2.X , try


Best Regards

> 
> The compiler(gtk+1.2.10) gave the following error:
> 
> [EMAIL PROTECTED] test]# make
> gcc `gtk-config --cflags`  foc.c -o foc `gtk-config --libs`
> foc.c: In function `fovu':
> foc.c:60: warning: assignment makes pointer from integer without a cast
> /tmp/ccbfegod.o(.text+0x297): In function `fovu':
> : undefined reference to `gtk_window_get_focus'
> collect2: ld returned 1 exit status
> make: *** [foc] Error 1
> [EMAIL PROTECTED] test]#


-- 
Antonio Gomes
E-mail: [EMAIL PROTECTED]
Embedded Linux Lab - 10LE
INdT - Instituto Nokia de Tecnologia (Manaus/Br)
NOKIA's Technology Institute
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gtk path insert

2005-04-12 Thread Mishael A Sibiryakov
Ð ÐÑÑ, 12/04/2005 Ð 20:47 +0530, srinivas ÐÐÑÐÑ:
> hi;
> 
>i am doing a scanning application gui with gtk. now i would like to
> have idea abt how to get the path of a file. itz like when i select a
> file the path has to be added to the list from there the file will be
> scanned. how to add file or directory path to list.

How about to use something like:
struct directory {
char *path;
list *files;
};


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


Gtk path insert

2005-04-12 Thread srinivas
hi;

   i am doing a scanning application gui with gtk. now i would like to
have idea abt how to get the path of a file. itz like when i select a
file the path has to be added to the list from there the file will be
scanned. how to add file or directory path to list.

thanks;

vasu.

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


GtkTextView and scrolled window

2005-04-12 Thread Mishael A Sibiryakov

Hello.

I have a two small question about GtkTextView and about how it works
with scrolled window widget.

1. I have a TextView witch is placed to scrolled window (this is simple
chat window), and i want to do automatic scroll is new message inserted
to TextBuffer. How can i do that ? I try to read about GtkAdjustment but
i have not absolutely understood how i can do that.

2. How i can do "messages limit" ? Now i can count lines in TextBuffer
and remove line on first TextIter if count is more than limit. Is this
correct, or anybody know most beautiful solution ?

Sorry for my poor english.

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


Re: Report Generation

2005-04-12 Thread Todd Fisher
Hubert Sokolowski wrote:
Hi!
 

hello
I need to generate a report which will have images as well as some text
related to each image  in  a particular format. I also need to print the
report. Im not sure as to how to go about this problem. I was thinking of
maybe using GnomeCanvas but im not quite sure. Could someone please give
me
a few suggestions of how to go about.
   

the easiest way is to generate a html page an open it with some external
browser. this approach is very portable.
regards
hs
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

Or if you want to get fancy try embedding mozilla right in your app :-)
http://www.mozilla.org/unix/gtk-embedding.html
Then you could even use javascript to dynamically construct the report 
and it provides a pretty nice interface for printing.

It's also portable --> http://severna.homeip.net/gtkmozwin32.php
the win32 patch -->  https://bugzilla.mozilla.org/show_bug.cgi?id=256560
-Todd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Popup Menu

2005-04-12 Thread Nigel Tao
On Mon, 2005-04-11 at 21:23 -0300, CÃsar Leonardo Blum Silveira wrote:
> Is there a way I can make my application be just a popup menu?
> I mean, when the user opens it, there is no window, it automatically
> pops up a menu right where the mouse pointer is. Is that possible?

Apologies for hijacking your thread, but on a related question - my
applet is nothing but an gtk.Entry, which already has a popup menu (with
Cut, Copy, ..., "Input Methods->" items).  How can I get the gtk.Menu
object when it pops (or otherwise add extra gtk.MenuItems to the popup
menu)?  I want to add "Preferences" and "About" items, without losing
the existing Cut, Copy, etc.

tia,
Nigel.

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


Re: Report Generation

2005-04-12 Thread Hubert Sokolowski

Hi!

> hello
>
> I need to generate a report which will have images as well as some text
> related to each image  in  a particular format. I also need to print the
> report. Im not sure as to how to go about this problem. I was thinking of
> maybe using GnomeCanvas but im not quite sure. Could someone please give
> me
> a few suggestions of how to go about.
>

the easiest way is to generate a html page an open it with some external
browser. this approach is very portable.

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


Report Generation

2005-04-12 Thread [ A b h i s h e k ]
hello
I need to generate a report which will have images as well as some text 
related to each image  in  a particular format. I also need to print the 
report. Im not sure as to how to go about this problem. I was thinking of 
maybe using GnomeCanvas but im not quite sure. Could someone please give me 
a few suggestions of how to go about.

Thank You
Abhishek Samuel.
_
Click, Upload, Print http://www.kodakexpress.co.in?soe=4956 Deliver in India
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Have you examined all the alternatives?

2005-04-12 Thread Athanasios Anastasiou
Hello Cesar
The things people do for love!!! :-)
Have you examined all the possible alternatives for the application you 
are trying to make? For example, maybe the window manager you are 
refering to (FVWM), has already some means of modifying the behaviour of 
the right click, or even the option of modifying the pop up menu that 
appears.

If you use GTK to provide this functionality you should bare in mind 
that the application will probably not have a proper main window and 
will have to stay ON all the time. Traping the right click event is 
going to be tricky, as you only want it to respond when the mouse is 
over the desktop area and still it might collide with the right click 
event response from the window manager.

So...Why dont you buy your girlfriend a new computer that can run a more 
geared up distribution of linux? If she is a beginer she is going to 
appreciate it much more than having to cope with all the "limitations" 
and "pecularities" your solution introduces. There is even the 
possibility of turning down Linux because she does not find it practical 
and think that its ugly. Think about it.

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


Re: Help!!!!!!!

2005-04-12 Thread Muthiah Annamalai
Hello!
You could have well done some kind of search on this
list before. But Ill suggest something else,
read the rest of this mail, it may solve your probs,
and 
donot use GTK+1.2  shift to GTK+2.0 API.

1] System date can be got from calls like
asctime(), see man asctime
2] TO get current focus, try gtk_widget_get_focus()
   or something in gtkwidget.h
3] use `pkg-config libglade-1.0 --cflags --libs`
try changing the version, or using it without
   versions.
Cheers
Muthu.

--- trupthi n t <[EMAIL PROTECTED]> wrote:
>   
> Hi,
>   I am developing an application in using gtk+1.2.10
> in linux.
> 
>   I am not able to carry out the following tasks:
> 
>  1)TO capture the system date (using an in built
> function)
>  2)To write/find a function which returns the
> the widget on which 
>  the current focus is.
>  3)To compile and execute glade interface
> designer for gtk+1.2
> 
>Kindly help.
>  
>  Regards,
>  
> Trupthi
>  
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
>
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_window_get_focus (1.2)

2005-04-12 Thread Iago Rubio
On Tue, 2005-04-12 at 06:22 +, trupthi n t wrote:
>   Hi,
>  
> To write/find a function which returns the the widget on which
> the current focus is,when i used the following function
> 
> GtkWidget*  gtk_window_get_focus(GtkWindow *window);
> 
> The compiler(gtk+1.2.10) gave the following error:

The function does not exists on gtk+-1.2
http://developer.gnome.org/doc/API/gtk/gtkwindow.html

Try to port your app to gtk+-2.0
http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#gtk-window-
get-focus
-- 
Iago Rubio
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK+, CYGWIN, MSW and GCC flagas

2005-04-12 Thread Dov Grobgeld
Hello Jamiil,

Writing the makefile with the proper flag for cygwin is a lot
less text than the contents of your email ;-) :

COPT = -mms-bitfields -mno-cygwin
DEBUG = -g -Wall
INCLUDE = `pkg-config --cflags gtk+-2.0`
LDFLAGS = `pkg-config --libs gtk+-2.0` -mwindows
CFLAGS = $(COPT) $(DEBUG) $(INCLUDE) 
SRC = foo.c \
  bar.c
OBJ = $(SRC:.c=.o)

foo : $(OBJ)
$(LINK.c) -o $@ $(OBJ) $(LDFLAGS)

Put this in a file called "Makefile", changed the SRC variable to
include the projects sources, save and then write make from the
cygwin shell. The result is an executable that is independant 
from cygwin.

Hope this helps.

Regards,
Dov (who actually much prefers using scons instead of make)

On Mon, Apr 11, 2005 at 08:09:04AM -0400, Jamiil Abdullah-Alkadir wrote:
> Before going any further, I would like to thank everyone involved in 
> helping me find I solution to this problem, your help has been most 
> valuable, specially yours Stefan; your help has been most welcomed.
> I did check "Tor's" web page righ after reading your message; there I found 
> out that one can compile a gtk program under cygwin that will be able to 
> run on MSW machines just by using the '-mno-cygwin' flag.
> I have not tested this flag and cannot make any assestment as to the 
> certenty of Tor's statement for two reasons. I don't know how to use this 
> falg and I don't want to spent the time finding out how it works knowing 
> that the result could be unsatisfactory. Thus I have decided to post the 
> folowing question to the group in the hope that someone might have had a 
> previous encounter with this problem and be in a better possition to make a 
> recomendation on this issue.
> 
> Before Thanks to everyone envolved in
> 
> >From: Stefan Kost <[EMAIL PROTECTED]>
> >To: Jamiil Abdullah-Alkadir <[EMAIL PROTECTED]>
> >CC: gtk-list@gnome.org,  gtk-app-devel-list@gnome.org,  cygwin@cygwin.com
> >Subject: Re: GTK+, CYGWIN & MSW
> >Date: Mon, 11 Apr 2005 08:51:34 +0200
> >
> >Hi Jamiil,
> >
> >that is normal when using Cygwin. If you want a native version use MingW 
> >together with the gtk+ builds e.g. Tor offers.
> >
> >Stefan
> >
> >>I have finally got an application to compile under cygwin, but to run it 
> >>I have to launch the X server, 'startx' to be able to run the program 
> >>under cygwin. However, I am not able to run the program form windows, I 
> >>have added the 'cygwin.dll' and 'cygX11-6.dll' directories to the 
> >>'autoexec.bat' '%path%'. the program just does not run. What can I do to 
> >>get this fixed?
> >>
> >>TIA
> >>
> >>_
> >>MSN? Calendar keeps you organized and takes the effort out of scheduling 
> >>get-togethers. 
> >>http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> >> 
> >> Start enjoying all the benefits of MSN? Premium right now and get the 
> >>first two months FREE*.
> >>
> >>___
> >>gtk-app-devel-list mailing list
> >>gtk-app-devel-list@gnome.org
> >>http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> >
> 
> _
> Take advantage of powerful junk e-mail filters built on patented Microsoft? 
> SmartScreen Technology. 
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>  
>  Start enjoying all the benefits of MSN? Premium right now and get the first 
> two months FREE*.
> 
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list