On Thu, 2004-04-08 at 03:33, Ivan Dubrov wrote:
From: http://www.gtk.org/tutorial/sec-thetooltipsobject.html GtkTooltips *tooltips; GtkWidget *button; tooltips = gtk_tooltips_new (); button = gtk_button_new_with_label ("button 1"); gtk_tooltips_set_tip (tooltips, button, "This is button 1", NULL); Hope this helps.
No, I need exactly balloon widget, something like this:
[Widget]
\
\
---------------
| Some text) |
---------------
Which I can show/hide where I want and when I want
Create a GtkWindow undecorated, and put a label on it with the text you
want to show.
Then you can show it where and when you want.
GtkWidget*
create_ballon (gchar* text, gint pos_x, gint pos_y)
{
GtkWidget* popup;
GtkWidget* frame;
GtkWidget* label;
popup = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW (popup),
GDK_WINDOW_TYPE_HINT_MENU);
#ifdef GTK_IS_2_2 // you must define it yourself
gtk_window_set_skip_taskbar_hint(GTK_WINDOW (popup), TRUE);
gtk_window_set_skip_pager_hint(GTK_WINDOW (popup), TRUE);
#endif
gtk_window_set_decorated (GTK_WINDOW (popup), FALSE);
frame = gtk_frame_new (NULL);
gtk_widget_show (frame);
gtk_container_add (GTK_CONTAINER (popup), frame);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_set_border_width (GTK_CONTAINER (frame), 0);
label = gtk_label_new(text);
gtk_container_add( GTK_CONTAINER (frame), label);
gtk_window_move (GTK_WINDOW (popup), pos_x, pos_y);
return popup;
}
And then call it with:
....
GtkWidget* ballon = create_ballon("Hi",this_x, this_y);
gtk_widget_show(ballon);
....
You must define yourself "this_x" and "this_y" to place the window where
you want.
Hope this helps.
--
Iago Rubio
- Home page * http://www.iagorubio.com
- Last project * http://cssed.sourceforge.net
- GPG Keyserv * pgp.rediris.es id=0x909BD4DD
Attachment:
signature.asc
Description: This is a digitally signed message part