Re: launching Nautilus window

2007-12-12 Thread jcupitt
On Dec 11, 2007 9:23 PM, Dr. Michael J. Chudobiak [EMAIL PROTECTED] wrote:
 Can someone point me to the correct way to launch a Nautilus window from
 a gtk application (i.e., context menu - open this folder in Nautilus).

The Portland project at freedesktop.org is doing this:

  http://portland.freedesktop.org/wiki/Portland

It's still quite new though, I don't know how many linuxes include it
(Ubuntu 7.10 does at least).

The command-line interface is very simple. Just do:

  system( xdg-open /my/directory/path );

And it opens the specified file in the user's preferred application
for files of that type. For a directory, you'll probably get Nautilus
on a Gnome machine.

There's a DBUS interface as well.

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


GTK button doesn't send signal repeatedly

2007-12-12 Thread Binary Chen
Hi,

When I keep presssing the button, it doesn't emit the signal repeatedly
as time goes, it only emit one. How can I enable it to send the signal
repeatedly in a specified interval?

Thanks.
Bin

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


Re: C vs C++ for GTK

2007-12-12 Thread Jon Harrop
On Saturday 24 November 2007 22:11, Patrick wrote:
 Hi Everyone.

 Sorry for the flame war bait, I know how passionate language debates
 get  but I need some guidance. I am using PyGTK right now and I am happy
 with it, but a day is coming soon were the speed limitations...

You might like to look at OCaml and the LablGTK2 bindings to GTK+. OCaml is 
high-level like Python and fast like C++.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Question about the realize signal

2007-12-12 Thread Tristan Van Berkom
On Dec 4, 2007 12:51 PM, Jim George [EMAIL PROTECTED] wrote:

 On Dec 4, 2007 3:06 AM, Dan H [EMAIL PROTECTED] wrote:
  Hello,
 


Hi, first about your radio buttons, you can set them to be in container mode
in the property editor, this will allow you to remove the label and put
anything
you want inside, if you just leave the placeholder then there will be
nothing.

If you have real custom widgets (i.e. they actually register a type in the
GType
system), then please read my blog post [1] about the simplest way to
integrate custom widgets into glade.

If you still find reasons that you absolutely must play with your hierarchy
(surely there is always something), I would not recommend the realize
handler.

realizing widgets will normally never result in the creation of widgets,
only thier backend screen resources are allocated in realize(), it just
seems a weird place to do it (some things could be realized twice because
of that).

I would think the best place is somewhere around g_object_unref(GladeXml
*xml),
in otherwords after glade_xml_new() and somewhere before gtk_main().

Cheers,
  -Tristan

[1] http://blogs.gnome.org/tvb/2007/07/25/some-popular-features/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How to implement a UI like Microsoft Word table by GTK??

2007-12-12 Thread li_top
Hi all
I have a problem to implement a UI like Microsoft Word table .
That is , The UI have tables . User can combine 2or3 or more tables to one 
table. How to 

do this UI? Please help me .
Thanks  Regardse
Tom
The UI like following:

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


Re: C vs C++ for GTK

2007-12-12 Thread Daniel Dieterle
On Mon, 2007-11-26 at 16:48 +, Jon Harrop wrote:
 On Saturday 24 November 2007 22:11, Patrick wrote:
  I thought that C++ must be the way to go as it can do everything that C
  can plus plus but some heavy hitters don't seem enthused with it,
  Linus Torvalds in particular has been quoted as calling it a horrible
  language.
 
 IIRC, Linus said that specifically in the context of systems programming.
 
 My recommendation is to choose a garbage collected language for GUI work as 
 it 
 makes everything so much easier. Lots of GCd languages have GTK bindings 
 these days.
 
 Incidentally, has anyone tried GTK# from C# on Mono?
Yeah,

works great and easy to use.

Daniel.
 

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


Re: C vs C++ for GTK

2007-12-12 Thread Jon Harrop
On Saturday 24 November 2007 22:11, Patrick wrote:
 I thought that C++ must be the way to go as it can do everything that C
 can plus plus but some heavy hitters don't seem enthused with it,
 Linus Torvalds in particular has been quoted as calling it a horrible
 language.

IIRC, Linus said that specifically in the context of systems programming.

My recommendation is to choose a garbage collected language for GUI work as it 
makes everything so much easier. Lots of GCd languages have GTK bindings 
these days.

Incidentally, has anyone tried GTK# from C# on Mono?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Change interface font in a GTK application at runtime without reopening windows

2007-12-12 Thread Gabriele Greco
A lot of users are asking me for the capability to change the font of an
  application runtime.

I know that the correct answer should be change your gtk theme or edit
the application RC file, but while this kind of answer is good with
power users, normal users often want to be able to grab a font from a
list and quickly try it on the REAL application interface without the
need of a restart.

I know that I can change the font of a single widget with
gtk_widget_modify_font(), and that I can change the font of EVERY future
widget with something like:


gtk_rc_parse_string(gtk-font-name=\sans 13\\n);

But what if I want to change the font of the actual interface without
having to close all the application window and open them again?

I'm quite sure it's possible since I've seen a few apps doing it. Sadly
I don't remember the apps, otherwise I'd go peek at their sources :)

I think there should be cleaner way that a full iteration on the widget
tree of every window and a gtk_widget_modify_font() Call on each widget,
isn't it? :)

Bye,
  Gabry


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


Can't set the website link clickable of gtk_about

2007-12-12 Thread TualatriX
Hello everyone:

I want my app's about dialog's website link can clickable, but whatever I
try to, it can't work.
I also read some code, such as gedit, nuatilus, their about dialog is using
gtk_about_dialog_set_website_label and gtk_about_dialog_set_website. Their
website can clickable, but why mime isn't like there?

That's the code:
gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(dialog),http://abc.com
);
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog),My website);

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


subscribe

2007-12-12 Thread Sreenivas Chowdary

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


Problems in GdkWindow Events with Gtk - DirectFb backend

2007-12-12 Thread Sreenivas Chowdary
Hi,

I am facing an issue to get events on GdkWindow which was built with
Gtk DirectFb backend.

In sample program i am creating a toplevel GdkWindow and creating a
child Gdkwindow.
While creating GdkWindow i have added events mask, and used
gdk_window_add_filter() function to add event handler callback to
GdkWindow.
While running executable I am not getting any events (Key press,
expose, button press etc..).
With same program we are getting events on Gtk - X11 backend.

Is Events handling implementation for GdkWindow with DirectFb backend
implemented or not?
Please suggest me how to get events on GdkWindow with DFB backend.


Sample program is this-

#include gtk/gtk.h
#include gdk/gdk.h

GdkFilterReturn child_handle_event( void *event1, GdkEvent *event2,
gpointer userdata )
{
g_printf(child_handle_event\n);
}


int main(int argc, char* argv[])
{

GdkWindow *parent, *child;
GdkWindowAttr attr;

gtk_init(argc, argv);

attr.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ;
attr.x = 100;
attr.y = 100;
attr.width = 800;
attr.height = 600;
attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.wclass = GDK_INPUT_OUTPUT;
parent = gdk_window_new (NULL, attr, GDK_WA_X | GDK_WA_Y);

attr.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
attr.x = 200;
attr.y = 200;
attr.width = 400;
attr.height = 300;
attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_OUTPUT;
child = gdk_window_new (parent, attr, GDK_WA_X | GDK_WA_Y);

gdk_window_add_filter (child, child_handle_event, NULL);

gdk_window_show (child);
gdk_window_show (parent);

gtk_main();

}
---


Thanks  Regards
Sreenivas

#include gtk/gtk.h
#include gdk/gdk.h

GdkFilterReturn child_handle_event( void *event1, GdkEvent *event2, gpointer 
userdata )
{
g_printf(child_handle_event\n);
}


int main(int argc, char* argv[])
{

GdkWindow *parent, *child;
GdkWindowAttr attr;

gtk_init(argc, argv);

attr.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | 
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ;
attr.x = 100;
attr.y = 100;
attr.width = 800;
attr.height = 600;
attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.wclass = GDK_INPUT_OUTPUT;
parent = gdk_window_new (NULL, attr, GDK_WA_X | GDK_WA_Y);

attr.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | 
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
attr.x = 200;
attr.y = 200;
attr.width = 400;
attr.height = 300;
attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_OUTPUT;
child = gdk_window_new (parent, attr, GDK_WA_X | GDK_WA_Y);

gdk_window_add_filter (child, child_handle_event, NULL);

gdk_window_show (child);
gdk_window_show (parent);

gtk_main();

}

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

Re: Slow UI updates with GtkImage

2007-12-12 Thread Tristan Van Berkom
On Nov 27, 2007 6:11 AM, David Brigada [EMAIL PROTECTED] wrote:
 Hi,

 I'm working on an audio player application.  I currently have two
 elements that change on a frequent basis: a GtkHScale and a GtkImage.
 Whenever I update the data, I call gtk_widget_queue_draw on the widget
 that changed.  With just the slider updating every 200ms, it works fine.
   If I add the GtkImage changing (by swapping out the GdkPixbuf with
 gtk_image_pixbuf_set) or I call gtk_widget_queue_draw on the widget, the
 UI waits about 2.5s in between redraws on both the slider and the image.
   This event happens about every 186ms.

 Is there something that I should be doing differently here?  Is this
 method horribly inefficient?  What should I change?

You should not have to call gtk_widget_queue_draw() at all in this
case (I'm sure the gtkimage  gtkscale implementations do this
themselves when you update the image or adjustment values).

Rather, how is your application structured ? do you use a thread
for the audio or are you processing audio data for 2.5s intervals
before ever returning control to the gtk+ main loop ? (are you
blocking or read or write maybe ?).

Even if you get it all right though, remember that you can still
get resource starvation when writing a media streaming app,
probably your audio processing thread is a higher priority.

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


Re: Can't set the website link clickable of gtk_about

2007-12-12 Thread Emmanuele Bassi

On Fri, 2007-11-16 at 12:54 +0800, TualatriX wrote:

 I also read some code, such as gedit, nuatilus, their about dialog is using
 gtk_about_dialog_set_website_label and gtk_about_dialog_set_website. Their
 website can clickable, but why mime isn't like there?
 
 That's the code:
 gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(dialog),http://abc.com
 );
 gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog),My website);

the documentation has been recently updated to mention this, but here's
the gist: you must set the GtkAboutDialog URL and/or email hooks for the
website and email button to become link buttons.

see the documentation of:

  gtk_about_dialog_set_url_hook()
  gtk_about_dialog_set_email_hook()

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net

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


Re: C vs C++ for GTK

2007-12-12 Thread Michael L Torrie
Jon Harrop wrote:
 On Saturday 24 November 2007 22:11, Patrick wrote:
 I thought that C++ must be the way to go as it can do everything that C
 can plus plus but some heavy hitters don't seem enthused with it,
 Linus Torvalds in particular has been quoted as calling it a horrible
 language.
 
 IIRC, Linus said that specifically in the context of systems programming.
 
 My recommendation is to choose a garbage collected language for GUI work as 
 it 
 makes everything so much easier. Lots of GCd languages have GTK bindings 
 these days.

Just because a language or library implements garbage collection doesn't
mean you don't need to manage resources.  Especially when you're working
with a GUI.  It's totally possible to leak memory in Python, C# or any
other managed language if you don't know what you are doing.  It's a bit
harder, but still a problem.  Recently the Darpa autonomous vehicle
challenge was lost by one group because their C# control system was
leaking very badly, requiring a restart every 30 minutes or so.

GTKmm is based on some very nice C++ abstractions around pointers,
providing many of the same benefits as any managed language with pure
C++.  They are called smart pointers and for GUI development, they work
very very well.  I find GTK in C++ to be almost as productive as python
or C#

 
 Incidentally, has anyone tried GTK# from C# on Mono?

Yup.  It works awesomely well.  It's very clean.  Of course I can't
think of many reasons to do it anymore.  I use python most of the time now.

 


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
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 implement a UI like Microsoft Word table by GTK??

2007-12-12 Thread Michael L Torrie
li_top wrote:
 Hi all
 I have a problem to implement a UI like Microsoft Word table .
 That is , The UI have tables . User can combine 2or3 or more tables to one 
 table. How to 
 
 do this UI? Please help me .

Your question is too vague to really be answered usefully.  But it
sounds to me like you probably want to implement this kind of UI feature
using some HTML rendering widget.  Or mess about with Pango markup
inside of a rich text editing field.

 Thanks  Regardse
 Tom
 The UI like following:
 
  __
 |_|___|___||
 | |   |   ||
 | |   |   ||
 |_|___|___||
 | |   |   ||
 |_|___|___||
  
  
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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


Re: Hidden dialogs on Windows after changing a window

2007-12-12 Thread Enrico Tröger
On Fri, 7 Dec 2007 18:31:17 +0100, Enrico Tröger
[EMAIL PROTECTED] wrote:

 Hi,
 
 the attached sample program creates a GtkWindow and shows a
 filechooser dialog. The parent of the dialog is the create window.
 When executing, both windows show up. Then I change to another open
 application and then change back to the simple test program(using the
 taskbar). And on Linux the filechooser dialog shows up again on top
 of the GtkWindow, as expected. But doing the same on Windows, with
 the same code, only the GtkWindow shows up and the filechooser dialog
 is hidden behind the other application I switched to previously.
 Does anyone have a clue what I'm doing wrong?
 gtk_window_set_transient_for() is used, what else can I do?

Nobody?


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Change interface font in a GTK application at runtime without reopening windows

2007-12-12 Thread Brian J. Tarricone
Gabriele Greco wrote:
 A lot of users are asking me for the capability to change the font of an
   application runtime.
 
 I know that the correct answer should be change your gtk theme or edit
 the application RC file, but while this kind of answer is good with
 power users, normal users often want to be able to grab a font from a
 list and quickly try it on the REAL application interface without the
 need of a restart.
 
 I know that I can change the font of a single widget with
 gtk_widget_modify_font(), and that I can change the font of EVERY future
 widget with something like:
 
 
 gtk_rc_parse_string(gtk-font-name=\sans 13\\n);
 
 But what if I want to change the font of the actual interface without
 having to close all the application window and open them again?
 
 I'm quite sure it's possible since I've seen a few apps doing it. Sadly
 I don't remember the apps, otherwise I'd go peek at their sources :)
 
 I think there should be cleaner way that a full iteration on the widget
 tree of every window and a gtk_widget_modify_font() Call on each widget,
 isn't it? :)

Not 100% sure, but this might be what you're looking for:

http://library.gnome.org/devel/gtk/stable/gtk-Resource-Files.html#gtk-rc-reset-styles

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


Re: Set widget size in percentage

2007-12-12 Thread Prashant J Zaveri
Hey Thanks,
  I later figured out that there is another widget
also called Gtk-alignment which helps to perform same task. Now I need
to
change the structure of my program, but thats fine as long as I am
able to maintain aspect ratio and alignment.

Cheers,

On Dec 8, 2007 9:51 PM, Tristan Van Berkom [EMAIL PROTECTED] wrote:

 On Dec 8, 2007 4:50 AM, Prashant J Zaveri [EMAIL PROTECTED] wrote:


  Hello...
 I am writing a gtk application to run on some other display. I want
  to maintain the size and layout of widgets that I have set on my
  desktop.For that I would like to specify widget size in percentage.
 
  Any idea how can I do that...

 Using the containers provided by gtk+ (GtkBox/GtkTable etc)
 will do this automatically.

 If you have a specific need you might look at GtkAspectFrame,
  it uses aspect ratio to place one widget inside at specified size
 and coordinates (the contained widget could in turn be another
 container ofcourse).

 Cheers,
  -Tristan





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