Re: How to use Gtk+1.2 Load a PNG Graphic.(duanjf)

2005-04-12 Thread Keith Sharp
On Tue, 2005-04-12 at 17:23 +0800, æåé wrote:
> Hello.
>   I want to usr Gtk+1.2 Load a Png picture.
>   How can I do?

GdkPixbuf:

http://developer.gnome.org/doc/API/gdk-pixbuf/index.html

Keith.

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


Re: glib.2.6.0.pc

2005-07-17 Thread Keith Sharp
On Sun, 2005-07-17 at 14:16 +0530, Abhishek Misra wrote:
> Hello,
> 
> for glib-2.6.0 i have done
> 
> /configure
> make
> rm -rf /install-prefix/include/glib.h /install-prefix/include/gmodule.h
> make install
> 
> all this comleted without any errors 
> 
> 
> but /usr/lib/pkgconfig/ still does not contaion  glib-2.6.0.pc file 
> 
> please let me know where the problrem could lie.

By default configure will use /usr/local as its prefix.  You can
override this by using the --prefix argument.  There are other
variations you can use to control the installation with even finer
granularity, run the command:

./configure --help

to get a list of the options you can use.

Keith.

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


Re: Icon in a tray - how?

2005-12-01 Thread Keith Sharp
On Tue, 2005-11-29 at 12:43 +0300, Igor Gorbounov wrote:
> Tell me, please, what widget (or anything else) can be used to represent 
> an application
> by an icon in the tray (or notification area applet?)?

I think you want libegg:

http://cvs.gnome.org/viewcvs/libegg/

In particular, EggTrayIcon:

http://cvs.gnome.org/viewcvs/libegg/libegg/tray/

Keith.

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


Re: gtk_entry_get_text() - having problems with return type

2003-03-05 Thread Keith Sharp
On Wed, 2003-03-05 at 01:16, Raymond Wan wrote:
> Hi,
> 
> On Wed, 5 Mar 2003, Ben LeMasurier wrote:
> > warning: assignment makes pointer from integer without a cast
> > 
> > gethostbyname() requests a char *
> > and gtk_entry_get_text() returns G_CONST_RETURN gchar*
> 
>   According to the glib docs, a G_CONST_RETURN gchar* is typedef'ed
> to a char* (See glib, basic types in the docs).  But, as it stresses in
> the gtk_entry_get_text (), you shouldn'tfree, modify, or store it.  I
> think I malloc'ed a temporary variable of type char * and did a strcpy and
> that worked fine.  Just don't try storing it with an assignment...

What I normally do is use g_strdup (), eg:

gchar *name;
GtkWidget *name_entry;

name = g_strdup (gtk_entry_get_text(GTK_ENTRY(name_entry)));

g_print ("The name was: %s\n", name);
g_free (name);

Keith.

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


Re: Destroying a Dialog Box....

2003-11-30 Thread Keith Sharp
On Sun, 2003-11-30 at 08:52, Hari Prasad Nadig wrote:

[Snip]

> Basically, I'm trying to put a cancel button which closes the dialog..
> 
> Is this a proper method or is there any 'proper' way of doing this?

How about using a GtkDialog?

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

Keith.

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


Re: gtktree functions

2003-12-26 Thread Keith Sharp
On Fri, 2003-12-26 at 15:20, Ashok Chauhan wrote:
>   where i can get gtk_tree_view_set_model functions descriptions?
> there functionalities.

Start at:

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

and in particular:

http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeView.html#gtk-tree-view-set-model

Keith.

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


Re: helpon porting gtk-1.2 to gtk-2.x

2003-12-30 Thread Keith Sharp
On Tue, 2003-12-30 at 13:49, [EMAIL PROTECTED] wrote:
> I had references to god web pages on this subject, but I have lost
> them.  Can someone point me in the right direction?

Try:

http://developer.gnome.org/dotplan/porting/

Keith.

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


Re: GTK-Treeview ( unallocate listStore )

2004-01-17 Thread Keith Sharp
On Fri, 2004-01-16 at 18:33, Chris De Maeyer wrote:

> On Fri, 2004-01-16 at 13:50, Brice LEROY wrote:
> > Hello,
> > I looking for a solution to deallocate a liststore loaded in a
> > treeview. If you know a function to get the pointer to the
> > gtk_list_store loaded in a treeview to delete with g_free() this
> > variable.

> g_object_unref (G_OBJECT (store));

And before this you will need to:

store = gtk_tree_view_get_model (treeview);

You will need to be careful with types and casts GTK_TREE_MODEL /
GTK_LIST_STORE.

Keith.

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


Re: Create Makefile

2004-01-19 Thread Keith Sharp
On Mon, 2004-01-19 at 14:10, Manoj tr wrote:
> Hai 
> 
> How to create Makefile.am , Makefile and Makefile.in for a group of
> source programs in c

Have a look at this tutorial:

  http://bo.majewski.name/bluear/gnu/GTK/plain/index.htm

Keith.

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


Re: GTK+ books

2004-02-06 Thread Keith Sharp
On Fri, 2004-02-06 at 10:45, Serdar Ozgur ATA wrote:
> Hello
>  
> Could you give me your advices about books on GTK+ which you're
> familiar with,
> As I can see on the NET , there are quite a few GTK+ programming books
> available in the market and
> unfortunately many of them are not good according to reviews I read.
> As a beginner, more details is more important for me.

It's not been published in English yet, but a lot of people are looking
forward to "The Official GNOME 2.0 Developers Guide" by Matthius
Warkus.  You can pre-order from Amazon:

http://www.amazon.com/exec/obidos/tg/detail/-/1593270305/qid=1076081552//ref=sr_8_xs_ap_i1_xgl14/103-9352561-1883025?v=glance&s=books&n=507846

Keith.

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


Re: gtK+ tutorials

2004-04-06 Thread Keith Sharp
On Tue, 2004-04-06 at 07:17, rohit goel wrote:
> i m newbie in gtk+ . from where to download gtk+
> tutorials please let me know  ...rohit

Try:

http://www.gtk.org/tutorial/

Keith.

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


Re: How to get Source code of gtk FileSelection widget

2004-04-14 Thread Keith Sharp
On Wed, 2004-04-14 at 16:26, Chaitanya RD Kulkarni wrote:
> I need to modify the FileSelection widget-i want to add a few more
> buttons to it & i would like to change the name of Cancel button to
> "Next".What shall i do? how can i get the source code of FileSelection
> widget so that i can modify it?or is there any other way to achieve
> this?i will be grateful if anyone helps. i need this info for my
> project work.
> -chaitanya.   

Download the source code:

ftp://ftp.gtk.org/pub/gtk/v2.4/gtk+-2.4.0.tar.gz

Keith.

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


Re: learning gtk - callbacks

2004-09-25 Thread Keith Sharp
On Fri, 2004-09-24 at 16:30 -0700, greg wolski wrote:
> Hi there,
> I am trying to learn gtk and I have a hard time to understand signals.
> This comes from helloworld in tutorial
> 
> g_signal_connect (G_OBJECT (window), "delete_event",
>   G_CALLBACK (delete_event), NULL);
> g_signal_connect (G_OBJECT (window), "destroy",
>   G_CALLBACK (destroy), NULL);
> 
> 
> Question:
> How does gtk know what functions it should call?

The third argument to g_signal_connect defines which function GTK calls.
In your examples "G_CALLBACK (delete_event)" and "G_CALLBACK (destroy)"
are the third arguments.  The G_CALLBACK () is to cast the function
pointer to the correct type, the actual functions are called
"delete_event" and "destroy", which happens to be the same as the signal
names, this is just coincidence you can call them anything you want.

> I mean for me it basically says: call this or this.
> Is it about the arguments that are declared in callback functions?

No, it is about the functions you pass as the third argument to
g_signal_connect.

> This is a little bit confusing because no arguments are indicated in
> those connections.

The fourth argument to g_signal_connect is a pointer you can use to pass
an extra argument to the callback function.  The signatures for callback
functions depend on the signal type and the object type.  These
signatures are defined in the API documents.  The convention is that the
final argument to a callback is a "gpointer data" which will be the
pointer you supply as the fourth argument to g_signal_connect.  In your
example this is NULL in both cases.

Keith.

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


Re: Source compiling for gtk+ 2.2 and 2.4

2004-12-11 Thread Keith Sharp
On Sat, 2004-12-11 at 14:42 +0100, antongiulio wrote:
> Hi,
> 
> in my little app I have used 'gtkcombobox' widget. In a system with gtk+ 
> 2.4.x installed, it works, but in system with gtk+ =< 2.2 I got errors on 
> compiling.
> 
> Since v2.4 GtkComboBox has replaced 'deprecated' GtkOptionMenu. Is there a 
> way to compile both version of gtk+ library?
> 
> I thought to use:
> 
> #ifdef any_macro_for_gtk_version
> gtkcombobox
> #else
> gtkoptionmenu
> #endif
> 
> Could be it good? Eventually, what is right macro to use?

http://developer.gnome.org/doc/API/2.0/gtk/gtk-Feature-Test-Macros.html

Keith.

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


Re: Beginner questions ...

2004-12-15 Thread Keith Sharp
On Wed, 2004-12-15 at 18:29 +0100, Sam B wrote:
> Hello and thank you for reading my post !
> 
> I have a few questions about gtk+, sorry, I am a beginner :
> 
> 1)  I use the widget to get a filename with a menu (I don't remember its 
> name). I connected the "Cancel" button signal to "widget_destroy" and this 
> is OK. But I would like the app to do a few functions and then close the 
> widget used to choose the filename. How could I close a widget from a 
> function called by this widget ? Now, when I click OK, the widget asking me 
> to choose a file is still open and sould be closed !

Your question is not clear, what do you mean by "widget"?  However, what
you probably want to do is pass a pointer to the widget as the final
argument to g_signal_connect() when you hook up the callback to the OK
button.

A snippet of the main function would be:

GtkWidget *widget;
GtkButton *button;

/* Create the widget, button, and other stuff as required */

g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (ok_button_cb), 
widget);

gtk_widget_show_all (widget);
gtk_main ();

And the callback would be:

static void
ok_button_cb (GtkButton *button, gpointer data)
{
GtkWidget *widget = GTK_WIDGET (data);

/* Do the things you want */

gtk_widget_destroy (widget);
return;
}

> 2) I vould like to make a Notebook with a variable number of tabs, depending 
> on the user's actions. Which function does this ?

Just add another page to the notebook for each tab your user needs.  You
can either prepend or append:

http://developer.gnome.org/doc/API/2.0/gtk/GtkNotebook.html#gtk-notebook-prepend-page

http://developer.gnome.org/doc/API/2.0/gtk/GtkNotebook.html#gtk-notebook-append-page

All of the functions about notebooks can be found:

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

Keith.

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


Re: simple text editing

2004-12-21 Thread Keith Sharp
On Tue, 2004-12-21 at 08:34 -0800, [EMAIL PROTECTED] wrote:
> Hello,
> 
> I'm very new to GTK and Linux programming in general-- I come from a Win32
> background.  I am very fond of the free software movement and for that
> reason, among others, have chosen gnome to use as my environment and have
> chosen to learn GTK+/Gnome programming.
> 
> I do a bit of programming for an embedded 8-bit programmer known as a PIC.
>  It has a very small instruction set and is compiled using a program known
> as gpasm.  I wanted to create a small text editor with syntax highlighting
> for it's asm syntax and have the assemble callable from within the editor
> and show the output in the output window-- basically a lightweight and
> minimal IDE for a PIC.
> 
> My question is, would this type of thing be doable via plugins for GEDIT
> and if so, can someone point me in the right direction?  I'd rather not
> reinvent the wheel.  GEDIT is perfect if I can find a way to add my syntax
> highlighting and create a dialog for calling the assembler.
> 
> If GEDIT is not the way to go, does anybody know of a good way to approach
> this project.  I realize I have a lot of learning to do.  I have two books
> on the subject of GTK and/or Gnome developement and have been tinkering
> within the Anjuta IDE-- but am ultimately a "newbie". Any advise would be
> much appreciated.

I think that Gedit is the solution here.  You need to do two things:

1)  Gedit uses the GtkSourceView widget to do the actual display and
editing.  A bit of googling should show you how to define a new
highlighting mode.  IIRC it just involves creating a simple text file to
define the language.

2) Gedit has a plugin capability.  I have never used this before, but I
don't imagine it is that tricky.  You should download the source (and
the source for the plugins) and look at the provided plugins.

Keith.

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