Tracking window position on screen

2008-03-04 Thread Mitko Haralanov
I am trying to find out which signal is emitted when a window is moved
on the screen. I have looked at GtkWindow, GtkWidget, GtkContainer, and
GtkScreen and I can't find anything that I can use.

I know I am missing something since I've seen applications do it!

-- 
Mitko Haralanov
==
 Professor: I knew I should have shown him "Electro-Gonnorhea, the
Noisy Killer."
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: OpenGL, GtkGlArea, GtkGLExt

2008-03-04 Thread Mikael Hallendal
4 mar 2008 kl. 19.14 skrev Behdad Esfahbod:

Hi,

> On Tue, 2008-03-04 at 17:04 +, Carlos Pereira wrote:
>
>> I have red a few times that thread, that Owen started five years ago,
>> and apparently there is agreement in the essentials:
>>
>> 1) remove all the fat from Gtkglext, namely the wrapper functions
>> discussed in that thread, make it a small library that cares only for
>> opengl integration, that works in the X window system but also in
>> Windows and Mac OS X, exactly as Gtk.
>
> Correct.
>
>> 2) change the name, for example to Gtkglarea 2.0*, the legitimate
>> sucessor to Gtkglarea 1 (the last version of Gtkglarea that I  
>> downloaded
>> last week is 1.99 and still comes with gtk_signal_connect and other  
>> Gtk
>> 1.2* functions deprecated long ago)
>
> No, gtkglarea is dead.  We don't want a new widget.  We want being  
> able
> to render to widgets using OpenGL as an alternative to using cairo.
> That is, the GtkGlExt approach.

This shouldn't be too much work as most of the code already is there.

>> 3) make it an official (but optional) Gtk library, downloadble from
>> www.gtk.org.
>
> No.  Push it into the Gtk+ tarball, probably as a new .so.  Like gdk,
> gdk-pixbuf, and gtk are different .so's.

Definitely agree.

>> I believe this would make Gtk more appealing, particularly for
>> scientific/engineering/architecture applications.
>> Carlos
>
> Indeed.

Not to mention new kind of user experiences for regular desktop  
applications (read Mac OS X) or mobile applications in the spirit of  
iphone. Much of it can be done without GL though, but some things  
definitely need hardware acceleration and 3D awareness.

Cheers,
   Mikael Hallendal

-- 
Imendio AB, http://www.imendio.com




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


Re: OpenGL, GtkGlArea, GtkGLExt

2008-03-04 Thread Martín RV (OPENGeoMap)
Hi carlos:

>
> I believe this would make Gtk more appealing, particularly for 
> scientific/engineering/architecture applications.
> Carlos
>  
>
>>

I think so...
http://groups.google.es/group/opengeomap/web/ogm-platform
hehe

Regards.

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


Re: OpenGL, GtkGlArea, GtkGLExt

2008-03-04 Thread Behdad Esfahbod
On Tue, 2008-03-04 at 17:04 +, Carlos Pereira wrote:

> Mikael Hallendal wrote:
> > 3 mar 2008 kl. 22.48 skrev Carlos Pereira:
> >
> > Hi Carlos,
> >
> > GtkGLext seems to be the most popular GL Area to use these days. You 
> > might also want to look at Clutter [1] or Pigment [2] which are 
> > canvases offering some higher level abstractions for 2D/3D usages. It 
> > depends a bit on what you need, if you just want an area for pure GL 
> > I'd go with GtkGLext.
> >
> > Regarding future inclusion of GL in GTK+ there is an open bug about it 
> > in the Bugzilla [3], I started looking into it a while back but didn't 
> > have time to get anything off my hard drive. There are some open 
> > issues in that you can read about in the bug tracker.
> >
> Thanks Michael,
> 
> I have red a few times that thread, that Owen started five years ago, 
> and apparently there is agreement in the essentials:
> 
> 1) remove all the fat from Gtkglext, namely the wrapper functions 
> discussed in that thread, make it a small library that cares only for  
> opengl integration, that works in the X window system but also in 
> Windows and Mac OS X, exactly as Gtk.

Correct.

> 2) change the name, for example to Gtkglarea 2.0*, the legitimate 
> sucessor to Gtkglarea 1 (the last version of Gtkglarea that I downloaded 
> last week is 1.99 and still comes with gtk_signal_connect and other Gtk 
> 1.2* functions deprecated long ago)

No, gtkglarea is dead.  We don't want a new widget.  We want being able
to render to widgets using OpenGL as an alternative to using cairo.
That is, the GtkGlExt approach.


> 3) make it an official (but optional) Gtk library, downloadble from 
> www.gtk.org.

No.  Push it into the Gtk+ tarball, probably as a new .so.  Like gdk,
gdk-pixbuf, and gtk are different .so's.

> I believe this would make Gtk more appealing, particularly for 
> scientific/engineering/architecture applications.
> Carlos

Indeed.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759

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


Re: OpenGL, GtkGlArea, GtkGLExt

2008-03-04 Thread Carlos Pereira
Mikael Hallendal wrote:
> 3 mar 2008 kl. 22.48 skrev Carlos Pereira:
>
> Hi Carlos,
>
> GtkGLext seems to be the most popular GL Area to use these days. You 
> might also want to look at Clutter [1] or Pigment [2] which are 
> canvases offering some higher level abstractions for 2D/3D usages. It 
> depends a bit on what you need, if you just want an area for pure GL 
> I'd go with GtkGLext.
>
> Regarding future inclusion of GL in GTK+ there is an open bug about it 
> in the Bugzilla [3], I started looking into it a while back but didn't 
> have time to get anything off my hard drive. There are some open 
> issues in that you can read about in the bug tracker.
>
Thanks Michael,

I have red a few times that thread, that Owen started five years ago, 
and apparently there is agreement in the essentials:

1) remove all the fat from Gtkglext, namely the wrapper functions 
discussed in that thread, make it a small library that cares only for  
opengl integration, that works in the X window system but also in 
Windows and Mac OS X, exactly as Gtk.

2) change the name, for example to Gtkglarea 2.0*, the legitimate 
sucessor to Gtkglarea 1 (the last version of Gtkglarea that I downloaded 
last week is 1.99 and still comes with gtk_signal_connect and other Gtk 
1.2* functions deprecated long ago)

3) make it an official (but optional) Gtk library, downloadble from 
www.gtk.org.

I believe this would make Gtk more appealing, particularly for 
scientific/engineering/architecture applications.
Carlos
> Good luck,
>   Mikael Hallendal
>
> [1] http://www.clutter-project.org/
> [2] https://code.fluendo.com/pigment/trac
> [3] http://bugzilla.gnome.org/show_bug.cgi?id=119189
>
>> Hi,
>> What is the currently recommended way to link GTK with OpenGL graphic
>> areas? GtkGLarea? GtkGLext? other?
>>
>> What are the future plans for GTK regarding OpenGL? is GTK planning to
>> support OpenGL directly without need for another library? I am not
>> particularly interested in fancy arbitrary widget rendering with OpenGL,
>> only rendering to graphic drawing areas,
>>
>> Best regards,
>> Carlos
>> ___
>> 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: gtk_text_buffer with clickable links?

2008-03-04 Thread Keith Maika
Andreas Rönnquist wrote:
> Hi!
> 
> I have managed to make a gtk_text_buffer and colorize what appears to be 
> links using gtk_text_buffer_apply_tag and some simple search algorithm.
> 
> Does someone have any resources explaining how to make those clickable - and 
> (later problem) to open them in "default webbrowser" or such, and also make 
> them underlined when mouse is hovering above them?
> 
> I have found an example, but that involves inserting actual buttons into the 
> textview, and that isn't really what I am after. (There must be a simpler way 
> to do what I want..)
> 
> Help and pointers to good documentation/tutorials/examples would be much 
> appreciated.
> I have looked at source that includes the requested behaviour, but it 
> contains a _lot_ of other stuff too, so it is quite hard to make out what is 
> important.
> 
> I would like to keep it as simple as possible (Editable textbuffer isn't at 
> all required, also I am not interested in full syntax highligthing or 
> similar. - as simple as possible.)
> 
> /Andreas
> 

I needed to do this quite a while back, and at the time I took a look at 
the GAIM code to see how they did it.  It was a matter of connecting an 
event to the tag used to mark the text, and when activated, you'd open 
the URL.

You can check the code I wrote by downloading the source @ 
http://aoeex.com/projects/easydict/  The relevant functions are 
textview_add_url(), textview_url_activate(), and 
textview_motion_notify_cb().

Here's snippets of the functions relevant parts:
void textview_add_url(const gchar *txtURL){
...
if (!url){
url=gtk_text_tag_new("url_tag");
g_object_set(url, "underline", PANGO_UNDERLINE_SINGLE, 
"underline-set", true, NULL);
g_object_set(url, "foreground-gdk", &blue, NULL);
g_signal_connect(G_OBJECT(url), "event",
 G_CALLBACK(textview_url_activate), NULL);
gtk_text_tag_table_add(tagTbl, url);
}
...
}


gboolean textview_url_activate(GtkTextTag *tag, 
__attribute__((unused))GObject *arg1, GdkEvent *event, GtkTextIter 
*arg2, __attribute__((unused))gpointer d){
GdkEventButton *event_btn=(GdkEventButton*)event;
if (event->type == GDK_BUTTON_RELEASE && event_btn->button == 1){
...

link=gtk_text_iter_get_text(&start, &end);
if (link){
gint memNeeded=strlen(BROWSER_CMDLINE)+strlen(link)+1;
gchar *cmd_line=KLIB_malloc(memNeeded);
snprintf(cmd_line, memNeeded, BROWSER_CMDLINE, link);
system(cmd_line);
}
}
return false;
}


gboolean textview_motion_notify_cb(GtkWidget *textview, GdkEventMotion 
*event, __attribute__((unused))gpointer d){
...
if (gtk_text_iter_has_tag(&iter, tag)){
GdkCursor *cur=gdk_cursor_new(GDK_HAND2);
gdk_window_set_cursor(event->window, cur);
}
else {
GdkCursor *cur=gdk_cursor_new(GDK_XTERM);
gdk_window_set_cursor(event->window, cur);
}
return false;
}
-- 
Keith Maika
http://aoeex.com/ - Personal site
http://www.gnu.org/philosophy/can-you-trust.html - Can you trust your 
computer?
http://www.gnu.org/philosophy/no-word-attachments.html - Support Open 
Communication.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk_text_buffer with clickable links?

2008-03-04 Thread Andreas Rönnquist
Hi!

I have managed to make a gtk_text_buffer and colorize what appears to be links 
using gtk_text_buffer_apply_tag and some simple search algorithm.

Does someone have any resources explaining how to make those clickable - and 
(later problem) to open them in "default webbrowser" or such, and also make 
them underlined when mouse is hovering above them?

I have found an example, but that involves inserting actual buttons into the 
textview, and that isn't really what I am after. (There must be a simpler way 
to do what I want..)

Help and pointers to good documentation/tutorials/examples would be much 
appreciated.
I have looked at source that includes the requested behaviour, but it contains 
a _lot_ of other stuff too, so it is quite hard to make out what is important.

I would like to keep it as simple as possible (Editable textbuffer isn't at all 
required, also I am not interested in full syntax highligthing or similar. - as 
simple as possible.)

/Andreas

-- 
Andreas Rönnquist <[EMAIL PROTECTED]>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkMenuItem label

2008-03-04 Thread Olivier Delhomme
2008/3/4, Olivier Delhomme <[EMAIL PROTECTED]>:
>
>
> Hello,
>
> Is there a convenient way to retrieve the label of a GtkMenuItem
> created with gtk_menu_item_new_with_label("my label") ?


I found this, which should solve the problem :

   GtkLabel *label = NULL;
   gchar *text = NULL;

   label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(menu_item)));
   text = gtk_label_get_text(label);

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


GtkMenuItem label

2008-03-04 Thread Olivier Delhomme
Hello,

Is there a convenient way to retrieve the label of a GtkMenuItem
created with gtk_menu_item_new_with_label("my label") ?

Thanks,

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