GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to add a tooltip to a GtkFileChooserButton?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
caros



Joined: 20 Aug 2008
Posts: 2

PostPosted: Wed Aug 20, 2008 8:59 pm    Post subject: How to add a tooltip to a GtkFileChooserButton? Reply with quote

I have not been able to make tooltips work on a GtkFileChooserButton
Is there anything unique about them?
Is it because they actually are a composite widget?
Does the tootlip have to be set on the label and button which are private?
Back to top
dreblen
Never Seen the Sunlight


Joined: 14 Jun 2007
Posts: 568
Location: Falun, WI USA

PostPosted: Thu Aug 21, 2008 3:30 am    Post subject: Reply with quote

it works fine for me.
does this work for you?
Code: (C)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <gtk/gtk.h>

int main(int argc, char **argv)
{
    GtkWidget *win;
    GtkWidget *but;

    gtk_init(&argc, &argv);

    win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(G_OBJECT(win), "delete-event", G_CALLBACK(gtk_main_quit), NULL);

    but = gtk_file_chooser_button_new("Chooser", GTK_FILE_CHOOSER_ACTION_OPEN);
    gtk_widget_set_tooltip_text(but, "This button opens a GtkFileChooser for opening");
    gtk_container_add(GTK_CONTAINER(win), but);
    gtk_widget_show(but);

    gtk_widget_show(win);

    gtk_main();

    return 0;
}
Back to top
caros



Joined: 20 Aug 2008
Posts: 2

PostPosted: Wed Aug 27, 2008 5:10 pm    Post subject: Reply with quote

No that does not work for me. What version do you have? I have 2.6.8
Back to top
dreblen
Never Seen the Sunlight


Joined: 14 Jun 2007
Posts: 568
Location: Falun, WI USA

PostPosted: Wed Aug 27, 2008 6:44 pm    Post subject: Reply with quote

I'm using 2.12.9.
does this version work for you?
I don't have a 2.6 system, but it should work.
Code: (C)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <gtk/gtk.h>

int main(int argc, char **argv)
{
    GtkWidget *win;
    GtkWidget *but;

    GtkTooltips *tooltips;

    gtk_init(&argc, &argv);

    tooltips = gtk_tooltips_new();

    win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(G_OBJECT(win), "delete-event", G_CALLBACK(gtk_main_quit), NULL);

    but = gtk_file_chooser_button_new("Chooser", GTK_FILE_CHOOSER_ACTION_OPEN);
    gtk_container_add(GTK_CONTAINER(win), but);
    gtk_widget_show(but);
    gtk_tooltips_set_tip(tooltips, but, "This button opens a GtkFileChooser for opening", NULL);

    gtk_widget_show(win);

    gtk_main();

    return 0;
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP