Re: my program has these problems

2005-05-21 Thread Shixin Zeng
On 5/20/05, 顺珉 吴 <[EMAIL PROTECTED]> wrote:
> 
> Hi Muthiah:
> Thanks for your reply.
> About the question 4, I am not sure whether the
> libglade is used if I use the Glade to build my GUI?


This depends on you how to build GUI.
As Glade can generate both C source and XML data file for GUI, you coulde 
build GUI either by the C source generated by Glade, or with libglade via 
the generated XML file. In the latter case, libglade is required.

-- 
Best regards

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

Re: my program has these problems

2005-05-21 Thread Shixin Zeng
Hi, 吴顺珉

On 5/20/05, 顺珉 吴 <[EMAIL PROTECTED]> wrote:

> 1.The program can deal with english (ascii) filename and info well, but I 
> don't know how to deal with other types if encoded string. Chinese, japanese 
> and many other languages have their own coding type, not always UTF-8. And 
> these user may not choose UTF as thier system local.
> How can I translate "some types" of encoded string to other types? Or at 
> least, translate all to UTF-8 type?

Please refer to 
http://www.gtk.org/api/2.6/glib/glib-Character-Set-Conversion.html for 
Charset convertion
As all string inside GTK+ are UTF-8, you should convert the filenames' 
encoding to UTF-8, and then convert them back to store on disk if neccesary.
For those locales other than utf-8, you should set environment viriable 
[EMAIL PROTECTED] to make g_filename* functions work correctly.

Hope this will help.



-- 
Best regards

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

Re: launching web-browser

2005-05-21 Thread John Cupitt
On 5/21/05, Peter Bloomfield <[EMAIL PROTECTED]> wrote:
> On 05/21/2005 08:51:05 AM, Gyözö Both wrote:
> > thanks for your answers. if possible, i'd like to have a
> > solution that only uses gtk/glib, i wouldn't want to have a
> > gnome-dependency in my app. is there a way?

I use this as a fallback: it just runs a commmand with an argument
which can be set from my application's preferences. The default is
"mozilla" for the command and "-remote 'openURL(%s)'" for the
argument. Very stupid, but it does sort-of work.

static gboolean shown = FALSE;

BufInfo buf;
char txt[512];
BufInfo buf2;
char txt2[512];
 
char url2[FILENAME_MAX];

expand_variables( url, url2 );

buf_init_static( &buf, txt, 512 );
buf_appendf( &buf, "%s %s", BOX_BROWSER, BOX_BROWSER_REMOTE );
buf_init_static( &buf2, txt2, 512 );
buf_appendf( &buf2, buf_all( &buf ), url2 );

if( systemf( "%s", buf_all( &buf2 ) ) ) {
error_top( _( "Unable to open location." ) );
error_sub( _(
"Attempted to launch browser with command:\n"
"  %s\n"
"You can change this command in Preferences." ),
buf_all( &buf2 ) );
box_alert( par );
}
else if( !shown ) {
box_info( par, 
_( "Browser window opened." ),
_( "Opened window for URL:\n"
"  %s\n"
"You may need to switch desktops to see the "
"new window." ),
url2 );

/* Only show 1st time.
 */
shown = TRUE;
}
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: How to shape a button

2005-05-21 Thread Chris Wu
Hi!
  Thank you very much, Mr.Muthiah
  It works, that great!
  Thanks.

 Chris.Wu
  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Muthiah Annamalai
Sent: 2005年5月20日 17:34
To: [EMAIL PROTECTED]; gtk-app-devel-list@gnome.org
Subject: RE: How to shape a button


Hi!
It seems to work for me...

I just forgot to mention, just create & connect a
button to its configure_event.


> 
> 
> #include
> #include
> #include
> 
>  
> gboolean  configure_event(GtkWidget *w,gpointer
> data)
> {  
>   //make a shaped mask
>   GdkPixmap *pix;
>   GdkBitmap *bit;
>   GdkColor c={0};
> 
>  
>
pix=gdk_pixmap_create_from_xpm(w->window,&bit,&c,"circle.xpm");
>  
>
gdk_window_shape_combine_mask(GDK_WINDOW(w->window),bit,100,100);
>  
>   gtk_window_set_decorated(GTK_WINDOW(w),FALSE);
>   return TRUE;
> }
> 
> GtkWidget * make_shapedwidget(void)
> {
>   GtkWidget *w,*btn;
> 
>   w=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>   btn=gtk_button_new_with_label("Hello WOrld");
>  
>
g_signal_connect(G_OBJECT(btn),"configure_event",G_CALLBACK(configure_event),NULL);
>  
>
g_signal_connect(G_OBJECT(w),"destroy",G_CALLBACK(gtk_main_quit),NULL);
> 
>   
> gtk_container_add(GTK_CONTAINER(w),btn);
>   return w;
> }
> 
 
 Cheers
 -Muthu.
 




__ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_
Scanned by Sanmina-SCI eShield 
_

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


Re: launching web-browser

2005-05-21 Thread Peter Bloomfield

On 05/21/2005 08:51:05 AM, Gyözö Both wrote:
thanks for your answers. if possible, i'd like to have a  
solution that only uses gtk/glib, i wouldn't want to have a  
gnome-dependency in my app. is there a way?


gyözö


So would I--if you find one, please be sure to post it!

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


Re: launching web-browser

2005-05-21 Thread Gyözö Both
thanks for your answers. if possible, i'd like to have a solution that
only uses gtk/glib, i wouldn't want to have a gnome-dependency in my
app. is there a way?

gyözö

-- 
A new koan:

If you have some ice cream, I will give it to you.

If you have no ice cream, I will take it away from you.

It is an ice cream koan.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: launching web browser

2005-05-21 Thread John Cupitt
On 5/21/05, Gyözö Both <[EMAIL PROTECTED]> wrote:
> is there a good (and easy) way to launch the system's default web
> browser with a given url from my gtk program?

If you're interested in cross-platform, the windows and mac
equivalents to gnome-url I've discovered are:

#ifdef WIN32
char url2[FILENAME_MAX];
int v;

expand_variables( url, url2 );
v = (int) ShellExecute( NULL, "open", url2, NULL, NULL, SW_SHOWNORMAL );
if( v <= 32 ) {
error_top( _( "Unable to open location." ) );
error_sub( _( "Unable to open URL \"%s\", "
"windows error code = %d." ), url, v );
box_alert( par );
}
#elif defined MAC_OSX
static gboolean shown = FALSE;

(void) systemf( "open %s", url );

if( !shown ) {
box_info( par, _( "Browser window opened." ),
_( "Opened window for URL:\n"
"  %s\n"
"This may take a few seconds." ), url );
shown = TRUE; 
}
#else /*unix-y*/
gnome-stuff
#endif

(experts probably know something better)

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


Re: launching web browser

2005-05-21 Thread Peter Bloomfield

On 05/21/2005 03:15:48 AM, Gyözö Both wrote:

hi,

is there a good (and easy) way to launch the system's default  
web browser with a given url from my gtk program?


See  
.

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


launching web browser

2005-05-21 Thread Gyözö Both
hi,

is there a good (and easy) way to launch the system's default web
browser with a given url from my gtk program?

gyözö

-- 
Brooke's Law:
Whenever a system becomes completely defined, some damn fool
discovers something which either abolishes the system or expands it
beyond recognition.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list