Quantcast

How to disable or remove default popup menu in TextView?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to disable or remove default popup menu in TextView?

Danilo Peixoto
How to disable or remove default popup menu in TextView?

TextView displays a default popup menu when right-click is pressed. Is it possible to implement the code below to not display this default popup menu?

import pygtk
pygtk.require('2.0')
import gtk

class main:
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_size_request(500, 500)
        self.verticalBox = gtk.VBox()
        self.textView = gtk.TextView()

        self.window.add(self.verticalBox)
        self.verticalBox.add(self.textView)

        self.window.show_all()

    def main(self):
        gtk.main()

if __name__ == '__main__':
    window = main()
    window.main()

Thanks in advance.

_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to disable or remove default popup menu in TextView?

Danilo Peixoto
How to disable or remove default popup menu in TextView?

TextView displays a default popup menu when right-click is pressed. Is it possible to implement the code below to not display this default popup menu?

import pygtk
pygtk.require('2.0')
import gtk

class main:
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_size_request(500, 500)
        self.verticalBox = gtk.VBox()
        self.textView = gtk.TextView()

        self.window.add(self.verticalBox)
        self.verticalBox.add(self.textView)

        self.window.show_all()

    def main(self):
        gtk.main()

if __name__ == '__main__':
    window = main()
    window.main()

Thanks in advance.


From: [hidden email]
To: [hidden email]
Subject: How to disable or remove default popup menu in TextView?
Date: Sat, 20 Dec 2014 18:27:22 +0000

How to disable or remove default popup menu in TextView?

TextView displays a default popup menu when right-click is pressed. Is it possible to implement the code below to not display this default popup menu?

import pygtk
pygtk.require('2.0')
import gtk

class main:
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_size_request(500, 500)
        self.verticalBox = gtk.VBox()
        self.textView = gtk.TextView()

        self.window.add(self.verticalBox)
        self.verticalBox.add(self.textView)

        self.window.show_all()

    def main(self):
        gtk.main()

if __name__ == '__main__':
    window = main()
    window.main()

Thanks in advance.

_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to disable or remove default popup menu in TextView?

Ignacio Rodríguez
Not sure if is that what you want.. But that works for me.

import pygtk
pygtk.require('2.0')
import gtk


class main:

    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_size_request(500, 500)
        self.verticalBox = gtk.VBox()
        self.textView = gtk.TextView()
        self.textView.connect('button-press-event', self.disable_popup)

        self.window.add(self.verticalBox)
        self.verticalBox.add(self.textView)

        self.window.show_all()

    def disable_popup(self, widget, event):
        if event.button == 3:
            return True

    def main(self):
        gtk.main()

if __name__ == '__main__':
    window = main()
    window.main()




2014-12-22 14:29 GMT-02:00 Danilo Peixoto <[hidden email]>:
How to disable or remove default popup menu in TextView?

TextView displays a default popup menu when right-click is pressed. Is it possible to implement the code below to not display this default popup menu?

import pygtk
pygtk.require('2.0')
import gtk

class main:
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_size_request(500, 500)
        self.verticalBox = gtk.VBox()
        self.textView = gtk.TextView()

        self.window.add(self.verticalBox)
        self.verticalBox.add(self.textView)

        self.window.show_all()

    def main(self):
        gtk.main()

if __name__ == '__main__':
    window = main()
    window.main()

Thanks in advance.


From: [hidden email]
To: [hidden email]
Subject: How to disable or remove default popup menu in TextView?
Date: Sat, 20 Dec 2014 18:27:22 +0000


How to disable or remove default popup menu in TextView?

TextView displays a default popup menu when right-click is pressed. Is it possible to implement the code below to not display this default popup menu?

import pygtk
pygtk.require('2.0')
import gtk

class main:
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_size_request(500, 500)
        self.verticalBox = gtk.VBox()
        self.textView = gtk.TextView()

        self.window.add(self.verticalBox)
        self.verticalBox.add(self.textView)

        self.window.show_all()

    def main(self):
        gtk.main()

if __name__ == '__main__':
    window = main()
    window.main()

Thanks in advance.

_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Loading...