GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Oct 25, 2014 10:53 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Gedit plugin
PostPosted: Tue Oct 18, 2011 6:40 am 
Offline

Joined: Tue Oct 18, 2011 6:25 am
Posts: 1
Hi
I have a problem an hope that you can help me solve it.
I'm writing a simple plugin for gedit (gnome 3). My plugin class looks like this:

class Plug(GObject.Object, Gedit.WindowActivatable, PeasGtk.Configurable):
bla="a"
def __init__(self):
...
def do_activate(self):
...
...

def do_create_configure_widget(self):
widged=...
...
rb1.connect("toggled", self.change, "a")
rb2.connect("toggled", self.change, "b")
rb2.connect("toggled", self.change, "c")
...
return widget

def change(self, widget, data):
self.bla=data
...


The problem is, when I change the selection in configuration widget, variable bla doesn't change.
What am I doing wrong?

Thank you


Top
 Profile  
 
 Post subject: Re: Gedit plugin
PostPosted: Wed Oct 19, 2011 1:03 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hello and welcome to the GTK+ forums!

You're probably having troubles because GtkToggleButton::toggled signal is emitted twice when radio buttons are operated (first button is deselected and second button is selected). You'll probably want to filter out the first signal emission by checking for active flag of your button.

Cheers,
Tadej


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group