Reply
Thread Tools
Posts: 318 | Thanked: 735 times | Joined on Oct 2009
#1
Hello,

I'm just trying to create a very simple dialog , but I discovered a strange behavior. First I created a simple HildonDialog, after I created a GtkBox with a GtkLabel and an HildonEntry and setted the text on the entry through hildon_gtk_entry_set_placeholder_text () then I packaged the GtkBox in the HildonDialog's vbox. The result is that the entry did not display the placeholder text , it appear only when the screen goes black (not completly black).
Anyone know the reason of this behavior? How I can fix it ?

Thank you.

P.S. : I have a little piece of code to demostrate it, if necessary I can paste it there.
 

The Following User Says Thank You to b0unc3 For This Useful Post:
Posts: 388 | Thanked: 842 times | Joined on Sep 2009 @ Finland
#2
Just guessing, but did you call gtk_widget_show_all for the dialog?
 
Posts: 318 | Thanked: 735 times | Joined on Oct 2009
#3
Yes, I have gtk_widget_show_all ( GTK_WIDGET(d) ); where d is the HildonDialog.
 

The Following User Says Thank You to b0unc3 For This Useful Post:
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#4
Originally Posted by b0unc3 View Post
P.S. : I have a little piece of code to demostrate it, if necessary I can paste it there.
The example would be nice to know exactly what you mean and to see how it behaves.

Thanks,

Daniel
 

The Following User Says Thank You to danielwilms For This Useful Post:
Posts: 318 | Thanked: 735 times | Joined on Oct 2009
#5
Ok, there is the example :

Code:
#include <hildon/hildon.h>

int main ( int argc, char *argv[] )
{
        GtkWidget *dialog;
        HildonDialog *d;
        GtkWidget *box;
        GtkWidget *sentry;
        GtkWidget *cstatus;

        hildon_gtk_init (&argc, &argv);

        d = HILDON_DIALOG (hildon_dialog_new ());
        gtk_window_set_title (GTK_WINDOW (d), "Hi!");
        hildon_dialog_add_button (HILDON_DIALOG (d), GTK_STOCK_OK, GTK_RESPONSE_NONE);
        box = gtk_vbox_new(2,FALSE);
        cstatus = gtk_label_new("test");
        sentry = hildon_entry_new(HILDON_SIZE_AUTO);
        hildon_gtk_entry_set_placeholder_text (GTK_ENTRY (sentry), " THE TEST");
        gtk_box_pack_start(GTK_BOX(box), cstatus, TRUE,TRUE,0);
        gtk_box_pack_start(GTK_BOX(box), sentry, TRUE,TRUE,0);

        gtk_container_add ( GTK_CONTAINER(GTK_DIALOG(d)->vbox), box);
        gtk_widget_show_all ( GTK_WIDGET(sentry) );

        gtk_widget_show_all ( GTK_WIDGET(d) );

        gtk_dialog_run(GTK_DIALOG(d));
        return 0;

}
 

The Following User Says Thank You to b0unc3 For This Useful Post:
Posts: 654 | Thanked: 664 times | Joined on Feb 2009 @ Germany
#6
Just a guess, but could it be that the HildonEntry has the focus? AFAIK, once it has the focus the placeholder text is hidden. The screen dimming could take away the focus and thus make the text visible again.
 

The Following 2 Users Say Thank You to conny For This Useful Post:
Posts: 318 | Thanked: 735 times | Joined on Oct 2009
#7
Yes, that is the reason.
Now I'm going to check if there is a method to remove the focus from a GtkEntry.
Thank you!
 

The Following User Says Thank You to b0unc3 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 08:43.