Re[2]: Migrating from GTK-1.2 to GTK-2



Logged on as Ilyak(Online)

Hi all. I am now trying to develop really small project for my
university, with GTK+
I am now trying to switch to GTK+-2 from 1.2. I have faced problem:
==
  gtk_signal_connect_after (GTK_OBJECT (startXEntry), "key_press_event",
                      GTK_SIGNAL_FUNC (on_CoordEntry_key_press_event),
                      NULL);
==
This simply does not work. Function does not get called as I press
keys. It did with GTK+-1.2. What should i do? I use it just to filter
input to make this field look like %lf... Is there another ways?
PB> Why do you use connect_after? Just use simple connect and return TRUE or
PB> FALSE if you want the defalut handler be executed or not...
Example:
I have "-15e" and user presses "1". I should put "-15e+5" into text
entry...

If i will use simple connect and such, code will become more
complex...
It is a good workaround, but i don't really have time for it if i have
any choice.

PB> Btw, you should substitute gtk_signal with g_signal.
Ok, i will try. But anyway? Why does not this work? Any suggestions?

Update: just changed it to focus_out_event. Kinda dirty, but i don't
getting paid for it...

And: strangely, if text field is disabled, connected_after function
will work (just doing nothing, but will). If it is enabled, it does
not. Looks like standard handler does not gives control to the rest
of chain. Is this a bug or feature?

And, font in gtk2 apps is smaller than in gtk1.2. Is this a feature? Is
this changeable? Or i just have to make some passes at gtkrc?
Can i change header in message_dialog from Info, Error, etc to smth,
or it is hardcoded?..
PB> I admit I did not try but does gtk_window_set_title not work?
Thanks! This does work.

Not logged on. Reconnecting..........




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]