bitmap in button doesn't appear in 64bit 9.10
Hey, All, The following code works great in 32 bit and 64bit = 9.04, but no bitmap appears when I run in 64bit 9.10. Gtk::Image* img = NULL; if (btnImageName.length() 0) { cppstring path = GUtils::OSGetIconFolder() + btnImageName + L.png; img = new Gtk::Image(GTextUtils::ConvertUTF16WideStringToUTF8String(path)); } Gtk::Button* btn = new Gtk::Button; if (img != NULL) { btn-set_image(*img); btn-set_image_position(Gtk::POS_LEFT); } btn-set_alignment(0.0, 0.5); btn-signal_clicked().connect(sigc::bind(sigc::mem_fun(this, LXLiveReadoutManager::ToggleSourceWindow), sourceID)); m_ButtonMap[sourceID] = btn; m_ButtonBox-add(*btn); m_ButtonBox-show_all(); It is finding the image and making the btn-set_image call. Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: bitmap in button doesn't appear in 64bit 9.10
Thanks. After some digging, I managed to find out how to set the settings: // Set button/menu images on by default -- 9.10 turned them off GtkSettings *settings = gtk_settings_get_default (); gtk_settings_set_long_property (settings, gtk-button-images, 1, .gtkrc:0); // I don't understand the significance of the origin param. I just saw this on some thread and tried it -- it works... gtk_settings_set_long_property (settings, gtk-menu-images, 1, .gtkrc:0); Thanks, again! -Garth On Tue, Jan 19, 2010 at 11:35 AM, Tadej Borovšak tadeb...@gmail.com wrote: Hello. The following code works great in 32 bit and 64bit = 9.04, but no bitmap appears when I run in 64bit 9.10. Gtk::Image* img = NULL; if (btnImageName.length() 0) { cppstring path = GUtils::OSGetIconFolder() + btnImageName + L.png; img = new Gtk::Image(GTextUtils::ConvertUTF16WideStringToUTF8String(path)); } Gtk::Button* btn = new Gtk::Button; if (img != NULL) { btn-set_image(*img); btn-set_image_position(Gtk::POS_LEFT); } btn-set_alignment(0.0, 0.5); btn-signal_clicked().connect(sigc::bind(sigc::mem_fun(this, LXLiveReadoutManager::ToggleSourceWindow), sourceID)); m_ButtonMap[sourceID] = btn; m_ButtonBox-add(*btn); m_ButtonBox-show_all(); I think this is Ubuntu's fault. They decided to reduce visual clutter and trim images from menu items, buttons, etc. by default. User can change this by setting gtk-button-images and gtk-menu-images GtkSettings to TRUE, but I cannot help you with GUI tools, since I don't use Ubuntu or GNOME. Tadej -- Tadej Borovšak tadeboro.blogspot.com tadeb...@gmail.com tadej.borov...@gmail.com -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: bitmap in button doesn't appear in 64bit 9.10
okay. I want to do things the right way. It's hard sometimes because the documentation is a little light. *grin* I guess I'll look into how to construct the button manually. Garth Upshaw On Jan 19, 2010, at 4:20 PM, David Nečas y...@physics.muni.cz wrote: On Tue, Jan 19, 2010 at 10:14:28AM -0800, Garth's KidStuff wrote: Thanks. After some digging, I managed to find out how to set the settings: // Set button/menu images on by default -- 9.10 turned them off GtkSettings *settings = gtk_settings_get_default (); gtk_settings_set_long_property (settings, gtk-button-images, 1, .gtkrc:0); // I don't understand the significance of the origin param. I just saw this on some thread and tried it -- it works... gtk_settings_set_long_property (settings, gtk-menu-images, 1, .gtkrc:0); You can set images on menu items where they are really, really necessary by setting the always-show-image property. If you have buttons that make no sense without the image, you have always the option of constructing their content manually instead of using the image property. I did both in a few cases in my programs, namely in special menus and where the image carried the primary information and the text only auxiliary. By changing the settings in *code* you behave a thousand times worse than Ubuntu did. The GtkSettings distro defaults can be probably changed in some user preferences; and in the worst case by gconf- editor or gconftool-2 --type boolean --set /desktop/gnome/interface/ menus_have_icons true or similar means. How will anyone using your app disable the icons in menus? Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
menu bitmaps on 64-bit build
Hey All, I build the same source on both 32-bit and 64-bit machines running various versions of ubuntu (64-bit is only 9.04 and 9.10) and on the 32-bit builds I see the menu item bitmaps, but on 64-bit, I don't. I'm using the gtk_icon_factory methods. Anyone have any ideas about what's going on? TIA -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
inter process communication
Hey All, What's the best way to communicate between 2 applications? And can you point me to some nice C/C++ sample code? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: best way to communicate between 2 applications
More details: I'm running a large application written in gtkmm on an Ubuntu (8.1 or 9.04) machine. I'd like to know when a usb device has been attached or detached. Some other kind people on this list pointed me to udev for the usb event handling, and told me how I could run a little program when udev detected an event, so the missing piece is how does this little udev app tell the first application that something has happened? Thanks! -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
usb plug/unplug notifications
Hi All, I'd like to know how to intercept usb events. Right now, I'm polling for changes, but that isn't the right way to handle device discovery. Is there a way to get a notification when something happens in the usb world? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: enumerating available fonts
How do I enumerate the fonts available on a system? Here's a little function using Gtkmm that I use... vectorstring* LXUtils::GetAllFontNames() { // RETURN a pointer to a static string vector that contains the font names static vectorstring vsFonts; if (vsFonts.empty()) { // Only bother to do this the first time through LXMainWindow* pWind = LXMainWindow::GetAppMainWindow(); // Get Gtk::Window* Glib::RefPtrPango::Context rPC = pWind-get_pango_context(); Glib::ArrayHandle Glib::RefPtrPango::FontFamily fonts = rPC-list_families(); Glib::Container_Helpers::ArrayHandleIteratorGlib::Container_Helpers::TypeTraitsGlib::RefPtrPango::FontFamily iFont = fonts.begin(); for (; iFont != fonts.end(); iFont++) { vsFonts.push_back((*iFont)-get_name()); } } return vsFonts; } -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: re: tuning widgets base size
A pointer to the context's default font description. This value must not be modified or freed Well, yes. I interpreted this as meaning that I shouldn't modify the pointer itself. And yes -- the solution I gave was gtkmm. Glad you found the gtk solution. I should point out that one thing that tripped me up for a bit was figuring out where the Gtk::Label object was for arbitrary controls -- i.e. you have to dig into the control to get to the label. Happy programming! -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: tuning widgets base size
But this doesn't work. What is the right solution of my problem? Finaly I want make widgets smaller than default widgets, like toolbox widgets in The GIMP. void LXDialog::ShrinkWidgetFont( Gtk::Widget* pCtrl, // [in] Control to shrink the text of real scale) // [in] scale factor (should be 1.0 to shrink control) { // Different kinds of controls need different sub-objects' font resized Gtk::Frame* pFrame = dynamic_castGtk::Frame*(pCtrl); if (NULL != pFrame) // e.g. Frames have label widgets they use to display their text pCtrl = pFrame-get_label_widget(); else { // ...and radio buttons and check buttons are simply containers with a single label child Gtk::Bin* pBin = dynamic_castGtk::Bin*(pCtrl); if (NULL != pBin) pCtrl = pBin-get_child(); } Gtk::Label* pLabel = dynamic_castGtk::Label*(pCtrl); if (NULL != pLabel) { // Other controls might not have a label whose font we need to set Glib::RefPtrPango::Context pPangoContext = pLabel-get_pango_context(); Pango::FontDescription fontD = pPangoContext-get_font_description(); fontD.set_size((int)(scale * fontD.get_size())); pLabel-modify_font(fontD); } -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How to make a simple beep?
Hey All, I'm running under Ubuntu 8.10 and want to make a simple beep -- like the Windows Beep function which takes a frequency (in Hz) and a duration (in milliseconds). Does anyone have a place to point me? TIA -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: problems updating statusbar
add: while (gtk_events_pending()) gtk_main_iteration(); to your code where you want to make sure a UI change appears. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Full Screen mode behaves differently on two identical systems
Hey All, I have 2 computers, both running Ubuntu 8.10 (kernel2.6.27-9-generic). When my gtkmm application goes to full screen mode, and the user brings up any modal dialog (which is a child of the application main window), on one system everything looks fine. On the other, I get the System menu (Applications Places System) appearing instead of the application menu. When the dialog closes, the Application menu comes back. This is somewhat disconcerting to my users *grin*. Clearly, the systems are different somehow, but I'm at a loss as to exactly where and why it would make a difference. I have multiple examples of each behavior. So far, it seems that older PCs and newer netbooks have the bad behavior, while my development laptops and some newer desktop PCs work flawlessly. The same bad/good behavior happened when all my machines were running Ubuntu 8.04 with multiple kernels. Any ideas? Thanks in advance. -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: gtk_main_iteration() exits app first time through
Hey All, It was my app bug. We'd added a new polling loop activated by a timer but during the gtk_main_iteration the program state wasn't correct for the new code. No worries! -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Toolbar text makes toolbar very, very wide
Hey All, When I turn on toolbar button labels Text Below Items (System Preference Appearance Interface), the toolbar gets much, much wider than it seems it should. There's lots of wasted space and it makes the toolbar for the app I'm working on almost useless on smaller screens. Does anyone have ideas for how to make the text use space more efficiently? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk_main_iteration() exits app first time through
Hey All, Some months ago, I asked how to make a modeless dialog (a progress dialog) appear while continuing to execute in the main thread. Someone (thanks!) suggested using while (gtk_events_pending()) gtk_main_iteration(); to make sure the new dialog gets shown. I implemented that and it worked great for the last 6 months or so. Just today, I noticed that the program exits the first time it calls gtk_main_iteration(); Does anyone know what happened? TIA -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
programmatic screenshots?
Hey All, I'm runnign a Gtk++ app under ubuntu 8.04 and I'd liek to take a screenshot from inside the app. Any hints? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Tips on translating to other languages
Hi All, I'm working on a very large Application that has already shipped in multiple languages on Mac and Windows. There's a whole scheme in place which already works to extract strings from a special text file so I don't need to use any of the gettext stuff as described in the gtkmm documentation here: http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-internationalization.html My question is, how do I tell gtk to load the Spanish version of system dialogs (e.g. the File Open dialog). TIA -Garth Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: Ok button key binding
Also how do i make the Ok button to react on the return key. Hey there. This is in gtkmm: Gtk::Button m_IDOK; ... m_IDOK.set_flags(Gtk::CAN_DEFAULT); m_IDOK.grab_default(); The one subtle point for me was that any Gtk::Entry controls in the dialog ate the return unless I did the following: Gtk::Entry m_IDC_ADD_PAGE_TITLE; ... m_IDC_ADD_PAGE_TITLE.set_activates_default(true); // Enter while editing should activate default OK Happy coding. -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Ok button key binding
shoot. Nope, I don't have an off-the-top-of-my-head idea for you. Except to maybe get notified on every keypress and filter the return by hand. Not sure how to do that, though. Let me know if you get a good answer to this one. On Fri, Nov 14, 2008 at 12:02 PM, Till Harbaum / Lists [EMAIL PROTECTED]wrote: Hi, Am Freitag 14 November 2008 schrieb Garth's KidStuff: The one subtle point for me was that any Gtk::Entry controls in the dialog ate the return unless I did the following: Gtk::Entry m_IDC_ADD_PAGE_TITLE; ... m_IDC_ADD_PAGE_TITLE.set_activates_default(true); // Enter while editing should activate default OK Thanks, that was my problem! This works in those dialogs that have entries. Now i am still facing a similar issue with dialogs containing a gtktreeview based list. Pressing return selects an item in that list, but not the default dialog button. Any hint how to cope with the treeview? Unfortunately it doesn't have a set_activates_default() function ... Thanks again, Till -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
on_expose_event not being called when expected
Hey All, I have a large application whose drawing logic is based on the clock example (http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch15s07.html) in the documentation: * When objects need to be redrawn they set a rectangle * A timer fires every so often (100ms in my case), and I call invalidate_rect with the above rectangle * My Gtk::DrawingArea-derived class overrides on_expose_event and draws the objects This logic works impeccably (*grin*) until the CPU is under heavy load. In that case, I can see the invalidate_rect calls happening but on_expose_event doesn't get called until the cpu load is back to normal. I've been banging my head against this for a few days now and would love some new ideas about how to attack the problem. Thanks in advance. -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Print dialog is too big on some systems (Ubuntu 8.04 on an Asus Eee)
Hey all, I'm using the standard print method from Gtk (not Gtkmm because of a bug in the mm implementation), and the print dialog is way too big for the (admittedly very small) screen on the Asus Eee PC (800x480). Am I stuck with this behavior? The QA folks noted that Open Office has a dialog that's the right size -- did they roll their own? Thanks in advance for your ideas. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How do I set up the system to launch my app when the user double-clicks a file?
Hey All, I'd like to have a user install my application (LoggerLite) and then be able to double-click on a LoggerLite file and have LoggerLite automatically launch. I see how one can use the Open With tab in a File's properties dialog to change what app launches when double-clicking that file, but I want to do this programatically -- without having to ask the user to set this. Any ideas? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Stop text view to scroll on pageup/down (Gabriele Greco)
I've assigned a global meaning to the PageUp/Down keys in a application and I catch them with a key snooper. The keys are catched and the action performed, but if the window contains a textview also the textview contents are scrolled, so I tried to catch the keys in the textview, and then in the scrolledwindow but without results: g_signal_connect(sw, key-press-event, (GCallback)eat_pageupdown, NULL); I just asked a very similar question a few days ago on the list and Murray was kind enough to point out that I needed to connect my signal *before* the regular signal handler (as opposed to after, which is the default). In gtkmm, this was easy as the connect function has a parameter for that very purpose. I don't see how to so so here. Sorry :( -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How do I intercept keys in a Gtk::Entry widget?
Hey All, I'd like to process the right arrow key in a Gtk::Entry widget (so, for instance, if the cursor is at the rightmost insert position, I'd like to do something special) but if I connect to the signal keypress event as so: // LXWidgetEntry inherits from Gtk::Entry LXWidgetEntry::LXWidgetEntry() { signal_key_press_event().connect(sigc::mem_fun(*this, LXWidgetEntry::OnKeypress)); } bool LXWidgetEntry::OnKeypress( GdkEventKey* event) // [in] event from the system (with key, state, etc.) { if (event-keyval == GDK_Right) { // Do my thing here } return false; } I never get the right arrow key (I can get other keys, such as Tab, but not keys the entry control uses). Once I get the key, how do I either let the widget continue to handle the key in some of the cases? Thanks in advance! -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
When in Full screen mode, dialogs make system menu appear (replacing app menu)
Hey All, In my app, I go into full screen mode and then bring up a dialog. The application menu goes away and is replaced by the system menu (Applications Places System, etc.). I don't want this behavior, and I don't see any reference in the documentation. Is this a bug? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to set the font's size of the Gtklabel
Hey there, Using Gtkmm void ChangeLabelFontSize( Glib::RefPtrPango::Context pPangoContext = pLabel-get_pango_context(); Pango::FontDescription fontD = pPangoContext-get_font_description(); fontD.set_size((int)(scale * fontD.get_size())); pLabel-modify_font(fontD); -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to set the font's size of the Gtklabel
Whops, hit the send button before I was finished.. the method should be: void ChangeLabelFontSize( Gtk::Label *pLabel, // [in] Pointer to label to change font on float scale) // [in] amount to scale font size by. 1.0 leaves label unchanged { Glib::RefPtrPango::Context pPangoContext = pLabel-get_pango_context(); Pango::FontDescription fontD = pPangoContext-get_font_description(); fontD.set_size((int)(scale * fontD.get_size())); pLabel-modify_font(fontD); } -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Full Screen mode and odd menu behavior
Hey All, When I put my application into full screen mode (by calling fullscreen), the Linux System menu (Applications, Places, etc.) nicely goes away. However, doing some things in my app (e.g. bringing up a modal dialog) can cause the system menu to appear unexpectedly. Am I missing something on how this is supposed to work? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Hitting return in Gtk::Entry control doesn't do default action in dialog with Gtk::Notebook
Hi All, I have a dialogs with a Gtk::Entry control in a Gtk::Notebook and -- unlike other Gtk::Entry controls in dialogs without notebooks -- if I set: m_IDOK.set_flags(Gtk::CAN_DEFAULT); m_IDOK.grab_default(); ... m_ENTRY.set_activates_default(true); // Enter while editing should activate default OK Hitting Entry still doesn't activate the OK button. Thanks in Advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Can't install gtkmm (package manager won't install libgtkmm-2.4-dev)
This is unusual on a stable Ubuntu release. Anyway, Ubuntu's launchpad is the best place to get help about it, I guess. Thanks Murry, I re-installed Ubuntu 8.04 from the CD, and then installed gtkmm BEFORE allowing the Ubuntu updates to install. I've submitted a bug in the proper Ubuntu place. On Mon, 2008-08-04 at 16:12 -0700, Garth's KidStuff wrote: Hi All, Help! I'm trying to install a build environment on a machine I just installed Ubuntu 8.04.1 on and the package manager won't install libgtkmm-2.4-dev. It gives the following message: libgtkmm-2.4-dev: Depends: libatk1.0-dev but it is not going to be installed Depends: libcairomm-1.0-dev but it is not going to be installed Depends: libglibmm-2.4-dev but it is not going to be installed Depends: libgtk2.0-dev but it is not going to be installed If I try to install some of the dependencies, I get this message: libglib2.0-dev: Depends: libglib2.0-0 (=2.16.3-1ubuntu2) but 2.16.4-0ubuntu2 is to be installed This used to work -- I installed this build environment on a machine just a couple of months ago and know I'm, not doing anything different. Anyone have any ideas? Thanks tons in advance -- this is seriously killing my productivity! -- [EMAIL PROTECTED] www.murrayc.com www.openismus.com -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Can't install gtkmm (package manager won't install libgtkmm-2.4-dev)
Hi All, Help! I'm trying to install a build environment on a machine I just installed Ubuntu 8.04.1 on and the package manager won't install libgtkmm-2.4-dev. It gives the following message: libgtkmm-2.4-dev: Depends: libatk1.0-dev but it is not going to be installed Depends: libcairomm-1.0-dev but it is not going to be installed Depends: libglibmm-2.4-dev but it is not going to be installed Depends: libgtk2.0-dev but it is not going to be installed If I try to install some of the dependencies, I get this message: libglib2.0-dev: Depends: libglib2.0-0 (=2.16.3-1ubuntu2) but 2.16.4-0ubuntu2 is to be installed This used to work -- I installed this build environment on a machine just a couple of months ago and know I'm, not doing anything different. Anyone have any ideas? Thanks tons in advance -- this is seriously killing my productivity! -Garth ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How do I get the enter key to press OK when in a GTk::Entry widget?
Hi All, I've got a dialog with a Gtk:Entry widget and some other widgets. I've set the OK button the be the default and that works fine as long as the user isn't editing text in the Entry widget. How do I make the Entry widget ignore the return key? Thanks in advance. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: font size gtk_*_new_with_label
I'm using gtk_widget_modify_font() and style = gtk_rc_style_new(); pango_font_description_free( style-font_desc ); style-font_desc = pfont; gtk_widget_modify_style( widget, style ); to change the font size of my labels, but I can't do it on created buttons with gtk_*_new_with_label() and neither in my statusbar. I couldn't find any example on the net. I understand that I dont have the reference to the labels... , but when gtk refresh the screen needs the reference to the labels... So how to get the reference pointer or directly how to change the font size on these objects ? I have custom labels with my widgets... Now, I'd rather change as less as possible the Glade code (Glade use _with_label in generation code). I think that would be better using with_label than a custom button (I'm not completetly sure about it on gtk). Could any body give me some help about this problem? I need to solve it Thanks in advance, Regards Luis I wrote a short gtkmm method to scale the fontsize of various controls. It's not complete (e.g. it doesn't do comboboxes, or entry widgets), but it may answer your question. ScaleWidgetFont( Gtk::Widget* pCtrl, // [in] Control to shrink the text of real scale) // [in] scale factor (should be 1.0 to shrink control) { // Different kinds of controls need different sub-objects' font resized Gtk::Frame* pFrame = dynamic_castGtk::Frame*(pCtrl); if (NULL != pFrame) // e.g. Frames have label widgets they use to display their text pCtrl = pFrame-get_label_widget(); else { // ...and radio buttons and check buttons are simply containers with a single label child Gtk::Bin* pBin = dynamic_castGtk::Bin*(pCtrl); if (NULL != pBin) pCtrl = pBin-get_child(); } Gtk::Label* pLabel = dynamic_castGtk::Label*(pCtrl); if (NULL != pLabel) { // If we have a label we can set its font Glib::RefPtrPango::Context pPangoContext = pLabel-get_pango_context(); Pango::FontDescription fontD = pPangoContext-get_font_description(); fontD.set_size((int)(scale * fontD.get_size())); pLabel-modify_font(fontD); } } Cheers ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
how to get signal_changed on a TextView widget
Hi All, I'm replacing some Gtk::Entry widgets with Gtk::TextView widgets and the signal_changed method is not available -- how can I tell when the user changes the text in the TextView? Thanks in advance. -Garth ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How do I use the fullscreen in a gtkmm app?
Hi All, I notice that quite a few apps (firefox, gimp, terminal, etc. -- but not gedit, huh?) have the option to toggle fullscreen mode in their view menu using the F11 key. How would I implement this in my Gtkmm app? Thanks in advance -Garth ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How do I tell when my app gets de-focused
Hey all, Thanks in advance. I'm creating a Gtk::Entry widget that needs to sit on top of everything else in my app and so I call set_keep_above(true). This works great as long as my app is the focused app, but it stays on top of *everything* -- even other apps when they get the focus. Is there a better way to do this? Or is there a way to tell when my app loses focus? -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: setting the font of a dialog widget
Hey there, I just now got back to this problem. Maybe I'm misunderstanding something, but it seems that the solution you recommend is solely a solution for Gtk::Labels -- not for general widgets. I can change the font size for labels -- but not for other widgets (e.g. CheckButton, RadioButton.). That's my issue. To recap: How do I change the font size of a general widget? Thanks in advance. 2008/4/18 Garth's KidStuff [EMAIL PROTECTED]: that's not relevant). If the widget I'm trying to set happens to be a Gtk::Label, then it works. But other widgets (e.g. Gtk::Frame or Gtk::Checkbutton) don't and just seem to use their default font no matter what. For example: I do this with gtk_label_set_markup(). For example: gtk_label_set_markup (GTK_LABEL (label), span font_desc=\Sans\ size=\medium\hello/span); // Add the fixed widget to the dialog and size it properly get_vbox()-add(m_Fixed); m_Fixed.set_size_request( 566, 500 ); Fixed size widgets should be avoided if you possibly can, I'm sure you know this. gtk has a lot of layout widgets you can use to make resizeable dialogs. John -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: gtk_text_buffer_insert function does not insert...
Have you tried forcing the main run loop to execute? i.e.: while (gtk_events_pending()) gtk_main_iteration(); I am writing a simple application with GTK+, I updated the text view area with the text using gtk_text_buffer_insert function. I am wondering why the new text was not displayed immediately on the text view right after the line: gtk_text_buffer_insert (..., new text); ? The new text was displayed after the application has finished other statements like: copying a big file...? Could anyone point me out how can I display the new text value immediately when the gtk_text_buffer_insert() function is called? Thanks, Soulivanh -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtkmm Printing in Ubuntu 7.10
Hi, As covered in some earlier posts, Murry helped point me to the bug report on Ubuntu 7.10 that showed that gtk+ printing just didn't work there. I've upgraded to Ubuntu 8.04 (beta), and Printing now works great for me (yay!). BUT I'd like to distribute this app to users who are still on Ubuntu 7.10. Is there a recommended way to solve this? (Other than, of course, having the Ubuntu folks upgrade gtk+ so that it's just fixed). BTW Using the Gtkmm::PrintOperation was an absolute pleasure once I upgraded to 8.04. It's a nicely designed bunch of code *grin* . ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtk::ProgressBar doesn't work synchronously
Hi All, I'm converting a large Windows/Mac project to run on Ubuntu, and I'm a little stuck when trying to use a ProgressBar. We have a cross-platform class that assumes I can create a Progress Monitor dialog during time-intensive tasks, and then periodically update the progress as the task completes. The problem that I'm having with using Gtk::ProgressBar seems to be a fundemental one about when dialogs can actually appear in the main window. For example, what I'd like to do is something along the lines of: [in my main thread] ... Start a complex task Create a Progress Monitor dialog and show it Update the dialog as the task progresses Destroy the dialog When I try this, nothing shows up *grin*. As far as I can tell, I need to let the run loop process so that the dialog can be shown. (i.e. if I omit the destroy step in the above, I see the dialog as soon as I drop out of my code in the main thread, but that's too late -- the task is already completed) One way to solve this is, of course, to rewrite all the places that use the Progress Monitor so that the work is done in a thread and the main thread can just be showing the progress bar. I'd hesitate to try that with this code base because of the number of places in cross-platform code that would have to be rewritten. Do any of you have any thoughts? Thanks in advance! -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
I'd like (working) printing sample code
Hi, Thanks in advance. The sample code at: http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-printing-example.html doesn't work for me. I get the on_begin_print callback as expected, but never receive the on_draw_page callback. Instead I get an endless series of error/warning messages as follows: (Opus:7115): GLib-GObject-CRITICAL **: g_value_type_compatible: assertion `G_TYPE_IS_VALUE (src_type)' failed (Opus:7115): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.14.1/gobject/gsignal.c:2180: invalid object type `g-key-file-error-quark' for value type `GtkPrintContext' repeat ad infinitum I'm writing a gtkmm app in C++ and have had great luck with the other examples in the tutorials I refer to above. -Garth -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list