Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7766883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:32:09+00:00 2026-06-01T15:32:09+00:00

When I create a custom dialog in GTK ( both, GTK2 or GTK3 )

  • 0

When I create a custom dialog in GTK (both, GTK2 or GTK3) and set it to be modal, all input to other windows of my application is ignored. This works nearly always, but it fails under certain conditions.

When I add a ScrolledWindow containing a TreeView to my dialog, it still works as supposed. But if I fill the TreeView with entries until the ScrolledWindow starts to display its scroll bars — the modality is suddenly lost and I can click on my other windows!

Here is the most basic example I was able to set up. It’s written in Vala, but you’ll get the idea:

class MyDialog: Gtk.Dialog {

    public MyDialog() {
        this.modal = true;

        var data = new Gtk.ListStore(1, typeof(string)); 

        // increase this number -- the dialog is not modal anymore!
        for (int i=0; i<2; ++i) {
            Gtk.TreeIter current;
            data.append(out current);
            data.set(current, 0, "Lorem Ipsum"); 
        }

        var render = new Gtk.CellRendererText();

        var column = new Gtk.TreeViewColumn();
            column.pack_start(render, true);
            column.add_attribute(render, "text", 0);

        var treeview = new Gtk.TreeView.with_model(data);
            treeview.append_column(column);
            treeview.show();

        var scroll = new Gtk.ScrolledWindow(null, null);
            scroll.set_size_request(100, 100);
            scroll.add(treeview);
            scroll.show();

        (this.get_content_area() as Gtk.Box).add(scroll);
    }
}

int main (string[] args) {
    Gtk.init (ref args);

    var window = new Gtk.Window();

    window.set_default_size(350, 170);
    window.destroy.connect(Gtk.main_quit);

    var button = new Gtk.Button.with_label("Click me!");
    button.clicked.connect(() => {
        var dialog = new MyDialog();
        dialog.set_transient_for(window);
        dialog.run();
        dialog.destroy();
    });

    window.add(button);
    window.show_all();

    Gtk.main();
    return 0;
}

Compile it with:

valac --pkg gtk+-3.0 main.vala

Am I missing something? Is this behaviour wanted? Or is it a bug? If so, is there a workaround?

EDIT: I investigated a bit further: The problem disappears when the overlay-scrollbars from Ubuntu are uninstalled. So It’s not solved yet, but I know where I have to report this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:32:11+00:00Added an answer on June 1, 2026 at 3:32 pm

    Definitely a bug. Post a bug report and/or upgrade your GTK+ lib.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck! I am trying to create a custom modal dialog. I would like
I need create custom dialog and put JPanel into it. Is it possible?
I extended JDialog to create a custom dialog where the user must fill some
I am trying to create my first custom Print Dialog in C#. I found
I'm trying to generate a custom dialog in Android. I create my Dialog like
is it possible to create a custom dialog login button for facebook
I am trying to create a custom dialog box on the click of an
I need to create an modal dialog, which is to loaded from a nib
I am trying to create a custom shaped dialog in android. What I want
I am trying to create a custom dialog class that inherits from Dialog that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.