| View previous topic :: View next topic |
| Author |
Message |
ssiwek
Joined: 15 May 2006 Posts: 20
|
Posted: Mon Aug 28, 2006 11:19 am Post subject: GtkEntry doesn't emit editing-done? |
|
|
Hi!
I do have an other question. The GtkEntry widget does not emitt the signal editing-done.
But the GtkEntry implements the GtkCellEditable which does/should emitt the signal editing-done.
May be someone can explain me why this does not work.
Thanks in advance
Sven
Here is a little code:
| Code: | require_once ('Gtk2/VarDump.php');
if (!class_exists('gtk')) {
die("Please load the php-gtk2 module in your php.ini\r\n");
}
class App {
function load_glade($file) {
$this->wnd = new GladeXML($file);
$list_of_methods = get_class_methods($this);
for ($i = 0; $i < sizeof($list_of_methods); $i++) {
if (strstr($list_of_methods[$i], "on_")) {
if (preg_match('/on_(.+?)__(.+)$/', $list_of_methods[$i], $values)) {
$widget = $this->get_widget($values[1]);
$signal = $values[2];
$signal = str_replace('_', '-', $signal);
$widget->connect_simple($signal, array (
$this,
$list_of_methods[$i]
));
}
elseif (preg_match('/on_(.+?_.+)_(.+)$/', $list_of_methods[$i], $values)) {
$widget = $this->get_widget($values[1]);
$widget->connect_simple($values[2], array (
$this,
$list_of_methods[$i]
));
}
elseif (preg_match('/on_(.+?)_(.+?)$/', $list_of_methods[$i], $values)) {
$widget = $this->get_widget($values[1]);
$widget->connect_simple($values[2], array (
$this,
$list_of_methods[$i]
));
}
}
}
}
function get_widget($widget) {
return $this->wnd->get_widget($widget);
}
}
class App1 extends App {
function on_entry1__editing_done($a) {
Gtk2_VarDump :: display($a);
}
function init() {
// $w = $this->get_widget('entry1');
// $w->connect("editing_done", array (
// $this,
// "on_entry1__editing_done"
// ));
}
}
$a = new App1();
$a->load_glade("./ueb.glade");
$a->init();
gtk :: main();
?>
|
and here the glade file:
| Code: | <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkWindow" id="window1">
<property name="visible">True</property>
<property name="title" translatable="yes">window1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<child>
<widget class="GtkFixed" id="fixed1">
<property name="visible">True</property>
<child>
<widget class="GtkEntry" id="entry1">
<property name="width_request">158</property>
<property name="height_request">24</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="x">40</property>
<property name="y">24</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entry2">
<property name="width_request">158</property>
<property name="height_request">24</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="x">40</property>
<property name="y">64</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="width_request">53</property>
<property name="height_request">26</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">button1</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="x">80</property>
<property name="y">112</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
|
|
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Tue Aug 29, 2006 2:11 pm Post subject: Re: GtkEntry doesn't emit editing-done? |
|
|
| ssiwek wrote: | Hi!
I do have an other question. The GtkEntry widget does not emitt the signal editing-done.
But the GtkEntry implements the GtkCellEditable which does/should emitt the signal editing-done.
May be someone can explain me why this does not work.
Thanks in advance
|
If you use Christien's Dev Inspector, you'll note that the editing-done signal doesn't appear on the "signals" list for GtkEntry. I'm guessing this is because it hasn't been implemented yet for this widget.
Remember, this is Alpha software and is incomplete.
Take care.
-Ron T. |
|
| Back to top |
|
 |
ssiwek
Joined: 15 May 2006 Posts: 20
|
Posted: Tue Aug 29, 2006 3:13 pm Post subject: Re: GtkEntry doesn't emit editing-done? |
|
|
| ron_t wrote: | | ssiwek wrote: | Hi!
I do have an other question. The GtkEntry widget does not emitt the signal editing-done.
But the GtkEntry implements the GtkCellEditable which does/should emitt the signal editing-done.
May be someone can explain me why this does not work.
Thanks in advance
|
If you use Christien's Dev Inspector, you'll note that the editing-done signal doesn't appear on the "signals" list for GtkEntry. I'm guessing this is because it hasn't been implemented yet for this widget.
Remember, this is Alpha software and is incomplete.
Take care.
-Ron T. |
Hi Ron,
I am aware that this is still alpha software. But I am very unsure if I found a bug? because I am a really newbe with gtk and objects and such.
So if I have understand you right, you too think that if this was not an alpha software, the gtkentry widget should emitt the signal?
Have a nice day
Sven
I have inspected this with the DevInspector. I found that focus_out_event does work for GtkEntry - and it is not listed in the DevInspector. So your guess seems to be wrong... |
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Wed Aug 30, 2006 5:12 pm Post subject: Re: GtkEntry doesn't emit editing-done? |
|
|
| ssiwek wrote: |
I am aware that this is still alpha software. But I am very unsure if I found a bug? because I am a really newbe with gtk and objects and such. |
Sorry, Sven. I didn't mean to insult your intelligence.
| ssiwek wrote: |
So if I have understand you right, you too think that if this was not an alpha software, the gtkentry widget should emitt the signal?
|
It makes sense that it would, but to be sure you might want to ask on the php-gtk mailing list. The developers are listening there whereas I'm not sure if any of them read the postings here on Gnope.
| ssiwek wrote: |
I have inspected this with the DevInspector. I found that focus_out_event does work for GtkEntry - and it is not listed in the DevInspector.
|
Strange. I was under the impression that Dev Inspector did a "live" report on all widgets as well as their signals, methods, etc.
Christien?
-Ron T. |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Thu Aug 31, 2006 9:21 am Post subject: |
|
|
| Quote: | | Strange. I was under the impression that Dev Inspector did a "live" report on all widgets as well as their signals, methods, etc. |
Dev_Inspector unfortunately doesn't show inherited signals, only the one the widget introduces itself. So you need to look at the parent and grandparent to find all signals. |
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Thu Aug 31, 2006 2:27 pm Post subject: |
|
|
| cweiske wrote: |
Dev_Inspector unfortunately doesn't show inherited signals. |
Ah! Okay.
I don't know where I got the idea that it did, but since some signals, methods, etc. seem to be inherited from the parent and seem not to be, it would be handy. I don't suppose there's any way of talking you into...?
Or would it be a big pain in the butt? I haven't looked at your code, so I don't know if this is something where including each individual signal, method, etc. would have to be coded by hand.
-Ron T. |
|
| Back to top |
|
 |
leon_pegg
Joined: 12 Jun 2006 Posts: 113 Location: hemel / UK
|
Posted: Thu Aug 31, 2006 2:30 pm Post subject: |
|
|
| ron if you look at my post i have made an update to the dev inspector that shows all inerited signals. |
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Thu Aug 31, 2006 2:53 pm Post subject: |
|
|
| Quote: | | ron if you look at my post i have made an update to the dev inspector that shows all inerited signals. |
Hmm... I'm not sure which post you're referring to, Christien. I took a look at the Gnope channel with the handy GUI you wrote and I see DevInspector is up-to-date on my machine (version 0.2.0, right?). I also looked in the Annoucements forum and saw no posting for any version later than May 17, 2006.
What am I missing?
-Ron T. |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Thu Aug 31, 2006 2:56 pm Post subject: |
|
|
| leon_pegg answered, not me. He meant his forum post. |
|
| Back to top |
|
 |
leon_pegg
Joined: 12 Jun 2006 Posts: 113 Location: hemel / UK
|
Posted: Thu Aug 31, 2006 2:59 pm Post subject: |
|
|
| sorry to cause confusion. |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Thu Aug 31, 2006 3:09 pm Post subject: |
|
|
| I released a new version showing parent signals |
|
| Back to top |
|
 |
ssiwek
Joined: 15 May 2006 Posts: 20
|
Posted: Thu Aug 31, 2006 3:51 pm Post subject: |
|
|
| ron_t wrote: | | Quote: | | ron if you look at my post i have made an update to the dev inspector that shows all inerited signals. |
Hmm... I'm not sure which post you're referring to, Christien. I took a look at the Gnope channel with the handy GUI you wrote and I see DevInspector is up-to-date on my machine (version 0.2.0, right?). I also looked in the Annoucements forum and saw no posting for any version later than May 17, 2006.
What am I missing?
-Ron T. |
Hi!
You may have to press F6 in the Package Installer to receive the new Information.
Sven |
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Thu Aug 31, 2006 5:08 pm Post subject: |
|
|
| cweiske wrote: | | leon_pegg answered, not me. He meant his forum post. |
I'll be fine... really. Man, it's way too early in the morning for me.
Thanks Christien, Leon, and Sven for helping me wake up.
And thanks, Sven, for the tip about F6.
Take care, all.
-Ron T. |
|
| Back to top |
|
 |
|