This is really the suggestion from augustss' comment. Thoroughly untested, but this will get you started: import Control.Applicative import Control.Monad import Control.Monad.Trans import Control.Monad.Trans.Reader import Graphics.UI.Gtk import Graphics.UI.Gtk.Glade getButton :: String -> ReaderT GladeXML IO Button getButton buttonName = do gladeXML <- ask return . lift $ xmlGetWidget gladeXML castToButton...
python-3.x,gtk,glade,pygobject
I just had the same kind of problem. To solve it, I have installed GTK3+ from http://www.gtk.org/download/win32.php the all-in-one bundle of the GTK+ stack including 3rd-party dependencies at http://win32builder.gnome.org/gtk+-bundle_3.6.4-20130921_win32.zip after unzip the file in somedir. You can test it by running somedir\bin\gtk3-demo.exe you have to add the bin dir which...
python,user-interface,gtk,gtk3,glade
You mean to compile and distribute ? yes, you can create .exe s. If you are using Win, then you can use pyinstaller. Worked for me. But certainly, had some issues with some libraries, but newer versions may support them, evenly. If not, py2exe is one such another. Try them....
Use gtk_combo_box_text_get_active_text (GtkComboBoxText *cmb); Since you did not set gtk_combo_box_set_active_id(), you cannot pull the active_id. Anyway, the "id" is used if you use GtkTreeModel to fill up the combo box....
You have to get the value from the ListStore that is used by the CombobBox. Basically you call get_active_iter on the ComboBox to get an iterator to the active entry and then you call get_value with that iterator and the column you want to retrieve from the list store. Your...
gtk,interface-builder,locale,pygtk,glade
the following method works succefully with me > use locale module not gettext. execute locale.setlocale(category , language ) Set the translation_domain of gtk.Builder by gtk.Builder.set_translation_domain() before loading glade file by : EX:gtk.Builder.add_from_file Code ## import locale from locale import gettext as _ def apply_locale(self , current_lang ): domain = "Rockdome"...
Look at the very first error message. You call g_object_unref() on the builder (many times even) yet keep using the builder afterwards. Remove all but the the last unref call. Same goes for those gtk_builder_connect_signals() calls....
You need to connect a callback to the Login CheckButton that toggles the sensitivity of your two Entry widgets by calling the widget set_sensitive(sensitive) method on them. From the GTK2 docs: def set_sensitive(sensitive) sensitive : if True make the widget sensitive The set_sensitive() method sets the "sensitive" property of the...
You are looking for the transient-for property of the modal window (which should be available in Glade). If the modal window needs to be transient to either of the two other windows, then you need to use gtk_window_set_transient_for() as needed since the modal can only be transient for one window...
You fix this warning by giving the GtkDialog a parent to be modal to. The relevant functions are gtk_window_set_transient_for() (which sets this window to always be on top of, or transient for, another one) and optionally gtk_window_set_modal() to make it a modal dialog. This is ultimately what the various GtkDialog...
python,python-3.x,gtk,pygtk,glade
You should use GLib.idle_add() when you are modifying widgets from a thread and not the GTK main loop. In this case: GLib.idle_add(self._textBuffer.set_text, content) ...
From the GTK+ 3 Reference Manual: The “clicked” signal void user_function (GtkButton *button, gpointer user_data) This means that, when the callback function is called, the first argument passed to it will be the button, not the window. To fix this, you have two options: You can either change changetitle to...
I think you have two options, pass the list or a function that modifies the list to the secondary window. For example this is how the function could be passed: class Main(): def __init__(self): s = Secondary(self.modify_list) mylist = [] . . s.run() . . def modify_list(self, new_values): mylist =...
haskell,gtk,base64,glade,gtk2hs
name2 is of type String, whereas encode requires a ByteString. The simplest thing to do is just use the pack function from Data.ByteString.Char8 to make the conversion. However, there's a problem with this: it will only work properly for ASCII codepoints. What happens if the user enters non-ASCII characters (לדוגמה,...
Thanks to help from the gtkmm mailing list, I have the solution. In Glade, I had created a Gtk::Window with a single Gtk::Box in it, and put all my controls in the Box. This caused problems when trying to add the Box as a new tab, because the Box already...
Select the GtkEntry, then go into the Properties window and switch to the General tab. Near the top you should see an entry that says "Completion" with an icon on the right of it. Click that icon, and the Objects window should pop up, letting you choose the GtkEntryCompletion you...
Change: GtkWidget *builder,*window,*button; with: GtkWidget *window,*button; GtkBuilder *builder; this should fix. Example: #include <stdlib.h> #include <gtk/gtk.h> static void close_window ( GtkWidget *widget, gpointer window) { printf("application close...\n"); gtk_widget_destroy((GtkWidget*)window); } int main (int argc, char *argv[]) { GtkWidget *window, *button; GtkBuilder *builder; gtk_init (&argc, &argv); builder=gtk_builder_new(); gtk_builder_add_from_file(builder,"a.glade",NULL); window = GTK_WIDGET...
c,user-interface,gtk,gtk3,glade
You can try using void gtk_widget_set_size_request(GtkWidget *widget, gint width, gint height); or you can use Glade to adjust GtkWindow properties of "default-width" and "default-height" rather than hardcode it. Let me know the result. p.s : that is why i hate Glade :(...
I managed to solve most of what my question was. Most importantly it seems that one has to use Gtk.Application and Gtk.ApplicationWindow. I can't say that I fully understand why, but that makes it possible to add Actions in the form of Gio.SimpleActions to the application. Gtk.Builder parses the XML...
After a lot of searching for a Glade-only solution, I think that Gtk.Menuitem doesn't have a URL-open option. I now just defined on_menuitem_clicked-function that uses: webbrowser.open_new_tab() from the standard library....
You can use builder.connect_signals(self). Then you just have to make methods that are named like the handler in your xml file. So in this case: class TutorialApp(object): def __init__(self): builder = gtk.Builder() builder.add_from_file('./tutorial.xml') builder.connect_signals(self) self.window = builder.get_object('disasm') ##rest of you __init__ def abc(self, menuitem): print "tst" def on_window_destroy(self, window): gtk.main_quit()...
Nevermind I figured out what was wrong with my little project. Still don't know what is wrong with the example but the main thing for me is the subwindow need to be created with "new", otherwise it will be deleted straight away. ExampleSubWindow *subWindow = new ExampleSubWindow(); ...
You have to set a window with greater than the position of the HPane divider. Here is a stripped down example: import gtk class Source(gtk.Window): def __init__(self): super(Source, self).__init__() label1 = gtk.Label("The first label") label2 = gtk.Label("The second label") paned = gtk.HPaned() paned.add1(label1) paned.add2(label2) paned.set_position(600) self.add(paned) self.set_size_request(800, 400) # needs...
If you're trying to 'capture' the output of a system call, then I would suggest the best approach is to use open and open a filehandle to your process: my $pid = open ( my $process_output, '-|', "command" ); Then you can read $process_output exactly as you would a file...
You are using the GtkDrawingArea incorrectly. A drawing area is not a canvas on which you can draw only once and expect the system to refresh the drawing; it is a widget that allows (and requires) you to draw on it during the expose event. This is useful when you...