Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-02-13 04:42:49

wim
Member
From: Belgium
Registered: 2018-02-05
Posts: 15
Website

keep focus on gtkentry in panel plugin

Hi,

I have a gtkentry , like the calculator plugin.
But I cannot type in it because it loses focus all the time.
How can I set the focus on the entry ?
thx

Offline

#2 2018-02-14 20:09:07

wim
Member
From: Belgium
Registered: 2018-02-05
Posts: 15
Website

Re: keep focus on gtkentry in panel plugin

Hello.

I found out how to get the focus ,but I can only get into the entry after a double click
It is a sample->combobox = gtk_combo_box_text_new_with_entry(); that I'm using.

Here is my code

static gboolean entry_buttonpress_cb(GtkWidget *entry, GdkEventButton *event, SamplePlugin *sample)
{
    GtkWidget *toplevel;
    gboolean result;
    gchar *input;
    toplevel = gtk_widget_get_toplevel(entry);

    if (event->button != 3 && toplevel && gtk_widget_get_window(toplevel)) {        
        xfce_panel_plugin_focus_widget(sample->plugin, entry);
        input = gtk_combo_box_text_get_active_text (sample->combobox);    

Offline

#3 2018-02-14 20:32:05

wim
Member
From: Belgium
Registered: 2018-02-05
Posts: 15
Website

Re: keep focus on gtkentry in panel plugin

If I use a normal gtk_entry it works.
so it must be something with the gtk_combo_box_text_new_with_entry()
somebody has an idea ?

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 521.67 KiB (Peak: 530.58 KiB) ]