gnope php gtk gui gnope.org  

GtkEntry doesn't emit editing-done?

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
ssiwek



Joined: 15 May 2006
Posts: 20

PostPosted: Mon Aug 28, 2006 11:19 am    Post subject: GtkEntry doesn't emit editing-done? Reply with quote

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

PostPosted: Tue Aug 29, 2006 2:11 pm    Post subject: Re: GtkEntry doesn't emit editing-done? Reply with quote

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

PostPosted: Tue Aug 29, 2006 3:13 pm    Post subject: Re: GtkEntry doesn't emit editing-done? Reply with quote

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

PostPosted: Wed Aug 30, 2006 5:12 pm    Post subject: Re: GtkEntry doesn't emit editing-done? Reply with quote

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. Very Happy

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

PostPosted: Thu Aug 31, 2006 9:21 am    Post subject: Reply with quote

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

PostPosted: Thu Aug 31, 2006 2:27 pm    Post subject: Reply with quote

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

PostPosted: Thu Aug 31, 2006 2:30 pm    Post subject: Reply with quote

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

PostPosted: Thu Aug 31, 2006 2:53 pm    Post subject: Reply with quote

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

PostPosted: Thu Aug 31, 2006 2:56 pm    Post subject: Reply with quote

leon_pegg answered, not me. He meant his forum post.
Back to top
leon_pegg



Joined: 12 Jun 2006
Posts: 113
Location: hemel / UK

PostPosted: Thu Aug 31, 2006 2:59 pm    Post subject: Reply with quote

sorry to cause confusion.
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Thu Aug 31, 2006 3:09 pm    Post subject: Reply with quote

I released a new version showing parent signals
Back to top
ssiwek



Joined: 15 May 2006
Posts: 20

PostPosted: Thu Aug 31, 2006 3:51 pm    Post subject: Reply with quote

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

PostPosted: Thu Aug 31, 2006 5:08 pm    Post subject: Reply with quote

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. Very Happy

And thanks, Sven, for the tip about F6.

Take care, all.

-Ron T.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.